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() { |
Gilles Peskine | 0bc5729 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 276 | for x in "$@"; do |
| 277 | if ! is_config_enabled "$x"; then |
| 278 | SKIP_NEXT="YES" |
| 279 | return |
| 280 | fi |
| 281 | done |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 282 | } |
| 283 | |
| 284 | requires_all_configs_disabled() { |
Gilles Peskine | 0bc5729 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 285 | for x in "$@"; do |
| 286 | if is_config_enabled "$x"; then |
| 287 | SKIP_NEXT="YES" |
| 288 | return |
| 289 | fi |
| 290 | done |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 291 | } |
| 292 | |
| 293 | requires_any_configs_enabled() { |
Gilles Peskine | 0bc5729 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 294 | for x in "$@"; do |
| 295 | if is_config_enabled "$x"; then |
| 296 | return |
| 297 | fi |
| 298 | done |
| 299 | SKIP_NEXT="YES" |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 300 | } |
| 301 | |
| 302 | requires_any_configs_disabled() { |
Gilles Peskine | 0bc5729 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 303 | for x in "$@"; do |
| 304 | if ! is_config_enabled "$x"; then |
| 305 | return |
| 306 | fi |
| 307 | done |
| 308 | SKIP_NEXT="YES" |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 309 | } |
| 310 | |
Ronald Cron | 454eb91 | 2022-10-21 08:56:04 +0200 | [diff] [blame] | 311 | TLS1_2_KEY_EXCHANGES_WITH_CERT="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 312 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 313 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 314 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 315 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED \ |
| 316 | MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED \ |
| 317 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 318 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 319 | TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT="MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 320 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 321 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 322 | TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
| 323 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 324 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 325 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 326 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED" |
| 327 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 328 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled() { |
Gilles Peskine | 0bc5729 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 329 | if is_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 330 | then |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 331 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Gilles Peskine | 0bc5729 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 332 | elif ! is_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 333 | then |
| 334 | SKIP_NEXT="YES" |
| 335 | fi |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 336 | } |
| 337 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 338 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 339 | # This function uses the query_config command line option to query the |
| 340 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 341 | # program. The command will always return a success value if the |
| 342 | # configuration is defined and the value will be printed to stdout. |
| 343 | # |
| 344 | # Note that if the configuration is not defined or is defined to nothing, |
| 345 | # the output of this function will be an empty string. |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 346 | if [ "$LIST_TESTS" -eq 0 ];then |
| 347 | ${P_SRV} "query_config=${1}" |
| 348 | else |
| 349 | echo "1" |
| 350 | fi |
| 351 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 352 | } |
| 353 | |
| 354 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 355 | VAL="$( get_config_value_or_default "$1" )" |
| 356 | if [ -z "$VAL" ]; then |
| 357 | # Should never happen |
| 358 | echo "Mbed TLS configuration $1 is not defined" |
| 359 | exit 1 |
| 360 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 361 | SKIP_NEXT="YES" |
| 362 | fi |
| 363 | } |
| 364 | |
| 365 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 366 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 367 | if [ -z "$VAL" ]; then |
| 368 | # Should never happen |
| 369 | echo "Mbed TLS configuration $1 is not defined" |
| 370 | exit 1 |
| 371 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 372 | SKIP_NEXT="YES" |
| 373 | fi |
| 374 | } |
| 375 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 376 | requires_config_value_equals() { |
| 377 | VAL=$( get_config_value_or_default "$1" ) |
| 378 | if [ -z "$VAL" ]; then |
| 379 | # Should never happen |
| 380 | echo "Mbed TLS configuration $1 is not defined" |
| 381 | exit 1 |
| 382 | elif [ "$VAL" -ne "$2" ]; then |
| 383 | SKIP_NEXT="YES" |
| 384 | fi |
| 385 | } |
| 386 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 387 | # Require Mbed TLS to support the given protocol version. |
| 388 | # |
| 389 | # Inputs: |
| 390 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 391 | requires_protocol_version() { |
| 392 | # Support for DTLS is detected separately in detect_dtls(). |
| 393 | case "$1" in |
| 394 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 395 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; |
| 396 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 397 | esac |
| 398 | } |
| 399 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 400 | # Space-separated list of ciphersuites supported by this build of |
| 401 | # Mbed TLS. |
Ronald Cron | 5b73de8 | 2023-11-28 15:49:25 +0100 | [diff] [blame] | 402 | P_CIPHERSUITES="" |
| 403 | if [ "$LIST_TESTS" -eq 0 ]; then |
| 404 | P_CIPHERSUITES=" $($P_CLI help_ciphersuites 2>/dev/null | |
| 405 | grep 'TLS-\|TLS1-3' | |
| 406 | tr -s ' \n' ' ')" |
| 407 | |
| 408 | if [ -z "${P_CIPHERSUITES# }" ]; then |
| 409 | echo >&2 "$0: fatal error: no cipher suites found!" |
| 410 | exit 125 |
| 411 | fi |
| 412 | fi |
| 413 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 414 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 415 | case $P_CIPHERSUITES in |
| 416 | *" $1 "*) :;; |
| 417 | *) SKIP_NEXT="YES";; |
| 418 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 419 | } |
| 420 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 421 | requires_cipher_enabled() { |
| 422 | KEY_TYPE=$1 |
| 423 | MODE=${2:-} |
| 424 | if is_config_enabled MBEDTLS_USE_PSA_CRYPTO; then |
| 425 | case "$KEY_TYPE" in |
| 426 | CHACHA20) |
| 427 | requires_config_enabled PSA_WANT_ALG_CHACHA20_POLY1305 |
| 428 | requires_config_enabled PSA_WANT_KEY_TYPE_CHACHA20 |
| 429 | ;; |
| 430 | *) |
| 431 | requires_config_enabled PSA_WANT_ALG_${MODE} |
| 432 | requires_config_enabled PSA_WANT_KEY_TYPE_${KEY_TYPE} |
| 433 | ;; |
| 434 | esac |
| 435 | else |
| 436 | case "$KEY_TYPE" in |
| 437 | CHACHA20) |
| 438 | requires_config_enabled MBEDTLS_CHACHA20_C |
| 439 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 440 | ;; |
| 441 | *) |
| 442 | requires_config_enabled MBEDTLS_${MODE}_C |
| 443 | requires_config_enabled MBEDTLS_${KEY_TYPE}_C |
| 444 | ;; |
| 445 | esac |
| 446 | fi |
| 447 | } |
| 448 | |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 449 | # Automatically detect required features based on command line parameters. |
| 450 | # Parameters are: |
| 451 | # - $1 = command line (call to a TLS client or server program) |
| 452 | # - $2 = client/server |
| 453 | # - $3 = TLS version (TLS12 or TLS13) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 454 | # - $4 = Use an external tool without ECDH support |
| 455 | # - $5 = run test options |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 456 | detect_required_features() { |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 457 | CMD_LINE=$1 |
| 458 | ROLE=$2 |
| 459 | TLS_VERSION=$3 |
| 460 | EXT_WO_ECDH=$4 |
| 461 | TEST_OPTIONS=${5:-} |
| 462 | |
| 463 | case "$CMD_LINE" in |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 464 | *\ force_version=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 465 | tmp="${CMD_LINE##*\ force_version=}" |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 466 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 467 | requires_protocol_version "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 468 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 469 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 470 | case "$CMD_LINE" in |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 471 | *\ force_ciphersuite=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 472 | tmp="${CMD_LINE##*\ force_ciphersuite=}" |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 473 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 474 | requires_ciphersuite_enabled "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 475 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 476 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 477 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 478 | *[-_\ =]tickets=[^0]*) |
| 479 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 480 | esac |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 481 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 482 | *[-_\ =]alpn=*) |
| 483 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 484 | esac |
| 485 | |
Gilles Peskine | 6eff90f | 2024-09-06 15:34:59 +0200 | [diff] [blame^] | 486 | case " $CMD_LINE " in |
| 487 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 488 | requires_certificate_authentication;; |
| 489 | esac |
| 490 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 491 | case "$CMD_LINE" in |
Gilles Peskine | 1bc28fe | 2024-04-26 21:28:49 +0200 | [diff] [blame] | 492 | */server5*|\ |
| 493 | */server7*|\ |
| 494 | */dir-maxpath*) |
Gilles Peskine | 6eff90f | 2024-09-06 15:34:59 +0200 | [diff] [blame^] | 495 | requires_certificate_authentication |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 496 | if [ "$TLS_VERSION" = "TLS13" ]; then |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 497 | # In case of TLS13 the support for ECDSA is enough |
| 498 | requires_pk_alg "ECDSA" |
| 499 | else |
| 500 | # For TLS12 requirements are different between server and client |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 501 | if [ "$ROLE" = "server" ]; then |
Valerio Setti | 194e2bd | 2023-03-02 17:18:10 +0100 | [diff] [blame] | 502 | # If the server uses "server5*" certificates, then an ECDSA based |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 503 | # key exchange is required. However gnutls also does not |
| 504 | # support ECDH, so this limit the choice to ECDHE-ECDSA |
| 505 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 506 | requires_any_configs_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
| 507 | else |
| 508 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT |
| 509 | fi |
| 510 | elif [ "$ROLE" = "client" ]; then |
| 511 | # On the client side it is enough to have any certificate |
| 512 | # based authentication together with support for ECDSA. |
| 513 | # Of course the GnuTLS limitation mentioned above applies |
| 514 | # also here. |
| 515 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 516 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH |
| 517 | else |
| 518 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 519 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 520 | requires_pk_alg "ECDSA" |
| 521 | fi |
| 522 | fi |
| 523 | ;; |
| 524 | esac |
| 525 | |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 526 | case "$CMD_LINE" in |
Gilles Peskine | 121a7bf | 2024-04-29 16:03:02 +0200 | [diff] [blame] | 527 | */server1*|\ |
Gilles Peskine | 1bc28fe | 2024-04-26 21:28:49 +0200 | [diff] [blame] | 528 | */server2*|\ |
| 529 | */server7*) |
Gilles Peskine | 6eff90f | 2024-09-06 15:34:59 +0200 | [diff] [blame^] | 530 | requires_certificate_authentication |
Gilles Peskine | 121a7bf | 2024-04-29 16:03:02 +0200 | [diff] [blame] | 531 | # Certificates with an RSA key. The algorithm requirement is |
| 532 | # some subset of {PKCS#1v1.5 encryption, PKCS#1v1.5 signature, |
| 533 | # PSS signature}. We can't easily tell which subset works, and |
| 534 | # we aren't currently running ssl-opt.sh in configurations |
| 535 | # where partial RSA support is a problem, so generically, we |
| 536 | # just require RSA and it works out for our tests so far. |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 537 | requires_config_enabled "MBEDTLS_RSA_C" |
| 538 | esac |
| 539 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 540 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 541 | } |
| 542 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 543 | requires_certificate_authentication () { |
| 544 | if [ "$PSK_ONLY" = "YES" ]; then |
| 545 | SKIP_NEXT="YES" |
| 546 | fi |
| 547 | } |
| 548 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 549 | adapt_cmd_for_psk () { |
| 550 | case "$2" in |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 551 | *openssl*s_server*) s='-psk 73776f726466697368 -nocert';; |
| 552 | *openssl*) s='-psk 73776f726466697368';; |
Gilles Peskine | 9cd5848 | 2024-09-06 15:27:57 +0200 | [diff] [blame] | 553 | *gnutls-cli*) s='--pskusername=Client_identity --pskkey=73776f726466697368';; |
| 554 | *gnutls-serv*) s='--pskpasswd=../framework/data_files/simplepass.psk';; |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 555 | *) s='psk=73776f726466697368';; |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 556 | esac |
| 557 | eval $1='"$2 $s"' |
| 558 | unset s |
| 559 | } |
| 560 | |
| 561 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 562 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 563 | # |
| 564 | # If not running in a PSK-only build, do nothing. |
| 565 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 566 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 567 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 568 | # a pre-shared key, do nothing. |
| 569 | # |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 570 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 571 | # |
| 572 | # Inputs: |
| 573 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 574 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 575 | # * "$@": options passed to run_test. |
| 576 | # |
| 577 | # Outputs: |
| 578 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 579 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 580 | maybe_adapt_for_psk() { |
| 581 | if [ "$PSK_ONLY" != "YES" ]; then |
| 582 | return |
| 583 | fi |
| 584 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 585 | return |
| 586 | fi |
| 587 | case "$CLI_CMD $SRV_CMD" in |
| 588 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 589 | return;; |
| 590 | *force_ciphersuite*) |
| 591 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 592 | # PSK cipher suite could be substituted, but we're not ready for |
| 593 | # that yet. |
| 594 | SKIP_NEXT="YES" |
| 595 | return;; |
| 596 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 597 | # The test case involves certificates. PSK won't do. |
| 598 | SKIP_NEXT="YES" |
| 599 | return;; |
| 600 | esac |
| 601 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 602 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 603 | } |
| 604 | |
| 605 | case " $CONFIGS_ENABLED " in |
| 606 | *\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";; |
| 607 | *\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";; |
| 608 | *\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";; |
| 609 | *\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";; |
| 610 | *\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";; |
| 611 | *) PSK_ONLY="NO";; |
| 612 | esac |
| 613 | |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 614 | HAS_ALG_MD5="NO" |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 615 | HAS_ALG_SHA_1="NO" |
| 616 | HAS_ALG_SHA_224="NO" |
| 617 | HAS_ALG_SHA_256="NO" |
| 618 | HAS_ALG_SHA_384="NO" |
| 619 | HAS_ALG_SHA_512="NO" |
| 620 | |
| 621 | check_for_hash_alg() |
| 622 | { |
| 623 | CURR_ALG="INVALID"; |
| 624 | USE_PSA="NO" |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 625 | if is_config_enabled "MBEDTLS_USE_PSA_CRYPTO"; then |
| 626 | USE_PSA="YES"; |
| 627 | fi |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 628 | if [ $USE_PSA = "YES" ]; then |
| 629 | CURR_ALG=PSA_WANT_ALG_${1} |
| 630 | else |
| 631 | CURR_ALG=MBEDTLS_${1}_C |
| 632 | # Remove the second underscore to match MBEDTLS_* naming convention |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 633 | # MD5 is an exception to this convention |
| 634 | if [ "${1}" != "MD5" ]; then |
| 635 | CURR_ALG=$(echo "$CURR_ALG" | sed 's/_//2') |
| 636 | fi |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 637 | fi |
| 638 | |
| 639 | case $CONFIGS_ENABLED in |
| 640 | *" $CURR_ALG"[\ =]*) |
| 641 | return 0 |
| 642 | ;; |
| 643 | *) :;; |
| 644 | esac |
| 645 | return 1 |
| 646 | } |
| 647 | |
| 648 | populate_enabled_hash_algs() |
| 649 | { |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 650 | 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] | 651 | if check_for_hash_alg "$hash_alg"; then |
| 652 | hash_alg_variable=HAS_ALG_${hash_alg} |
| 653 | eval ${hash_alg_variable}=YES |
| 654 | fi |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 655 | done |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 656 | } |
| 657 | |
| 658 | # skip next test if the given hash alg is not supported |
| 659 | requires_hash_alg() { |
| 660 | HASH_DEFINE="Invalid" |
| 661 | HAS_HASH_ALG="NO" |
| 662 | case $1 in |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 663 | MD5):;; |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 664 | SHA_1):;; |
| 665 | SHA_224):;; |
| 666 | SHA_256):;; |
| 667 | SHA_384):;; |
| 668 | SHA_512):;; |
| 669 | *) |
| 670 | echo "Unsupported hash alg - $1" |
| 671 | exit 1 |
| 672 | ;; |
| 673 | esac |
| 674 | |
| 675 | HASH_DEFINE=HAS_ALG_${1} |
| 676 | eval "HAS_HASH_ALG=\${${HASH_DEFINE}}" |
| 677 | if [ "$HAS_HASH_ALG" = "NO" ] |
| 678 | then |
| 679 | SKIP_NEXT="YES" |
| 680 | fi |
| 681 | } |
| 682 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 683 | # Skip next test if the given pk alg is not enabled |
| 684 | requires_pk_alg() { |
| 685 | case $1 in |
| 686 | ECDSA) |
| 687 | if is_config_enabled MBEDTLS_USE_PSA_CRYPTO; then |
| 688 | requires_config_enabled PSA_WANT_ALG_ECDSA |
| 689 | else |
| 690 | requires_config_enabled MBEDTLS_ECDSA_C |
| 691 | fi |
| 692 | ;; |
| 693 | *) |
| 694 | echo "Unknown/unimplemented case $1 in requires_pk_alg" |
| 695 | exit 1 |
| 696 | ;; |
| 697 | esac |
| 698 | } |
| 699 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 700 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 701 | requires_openssl_with_fallback_scsv() { |
| 702 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 703 | 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] | 704 | then |
| 705 | OPENSSL_HAS_FBSCSV="YES" |
| 706 | else |
| 707 | OPENSSL_HAS_FBSCSV="NO" |
| 708 | fi |
| 709 | fi |
| 710 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 711 | SKIP_NEXT="YES" |
| 712 | fi |
| 713 | } |
| 714 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 715 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 716 | requires_max_content_len() { |
| 717 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 718 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 719 | } |
| 720 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 721 | # skip next test if GnuTLS isn't available |
| 722 | requires_gnutls() { |
| 723 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 724 | 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] | 725 | GNUTLS_AVAILABLE="YES" |
| 726 | else |
| 727 | GNUTLS_AVAILABLE="NO" |
| 728 | fi |
| 729 | fi |
| 730 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 731 | SKIP_NEXT="YES" |
| 732 | fi |
| 733 | } |
| 734 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 735 | # skip next test if GnuTLS-next isn't available |
| 736 | requires_gnutls_next() { |
| 737 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 738 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 739 | GNUTLS_NEXT_AVAILABLE="YES" |
| 740 | else |
| 741 | GNUTLS_NEXT_AVAILABLE="NO" |
| 742 | fi |
| 743 | fi |
| 744 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 745 | SKIP_NEXT="YES" |
| 746 | fi |
| 747 | } |
| 748 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 749 | requires_openssl_next() { |
| 750 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 751 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 752 | OPENSSL_NEXT_AVAILABLE="YES" |
| 753 | else |
| 754 | OPENSSL_NEXT_AVAILABLE="NO" |
| 755 | fi |
| 756 | fi |
| 757 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 758 | SKIP_NEXT="YES" |
| 759 | fi |
| 760 | } |
| 761 | |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 762 | # skip next test if openssl version is lower than 3.0 |
| 763 | requires_openssl_3_x() { |
| 764 | requires_openssl_next |
| 765 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 766 | OPENSSL_3_X_AVAILABLE="NO" |
| 767 | fi |
| 768 | if [ -z "${OPENSSL_3_X_AVAILABLE:-}" ]; then |
Przemek Stekiel | a53dca1 | 2023-06-14 20:53:09 +0200 | [diff] [blame] | 769 | if $OPENSSL_NEXT version 2>&1 | grep "OpenSSL 3." >/dev/null |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 770 | then |
| 771 | OPENSSL_3_X_AVAILABLE="YES" |
| 772 | else |
| 773 | OPENSSL_3_X_AVAILABLE="NO" |
| 774 | fi |
| 775 | fi |
| 776 | if [ "$OPENSSL_3_X_AVAILABLE" = "NO" ]; then |
| 777 | SKIP_NEXT="YES" |
| 778 | fi |
| 779 | } |
| 780 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 781 | # skip next test if openssl does not support ffdh keys |
| 782 | requires_openssl_tls1_3_with_ffdh() { |
| 783 | requires_openssl_3_x |
| 784 | } |
| 785 | |
Przemek Stekiel | 7dda271 | 2023-06-27 14:43:33 +0200 | [diff] [blame] | 786 | # skip next test if openssl cannot handle ephemeral key exchange |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 787 | requires_openssl_tls1_3_with_compatible_ephemeral() { |
| 788 | requires_openssl_next |
| 789 | |
| 790 | if !(is_config_enabled "PSA_WANT_ALG_ECDH"); then |
| 791 | requires_openssl_tls1_3_with_ffdh |
| 792 | fi |
| 793 | } |
| 794 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 795 | # skip next test if tls1_3 is not available |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 796 | requires_openssl_tls1_3() { |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 797 | requires_openssl_next |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 798 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 799 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 800 | fi |
| 801 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 802 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 803 | then |
| 804 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 805 | else |
| 806 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 807 | fi |
| 808 | fi |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 809 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 810 | SKIP_NEXT="YES" |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 811 | fi |
| 812 | } |
| 813 | |
Gilles Peskine | ed8cc46 | 2024-09-06 13:52:14 +0200 | [diff] [blame] | 814 | # OpenSSL 3 servers forbid client renegotiation by default. |
| 815 | # Older versions always alow it. |
| 816 | OPENSSL_S_SERVER_CLIENT_RENEGOTIATION= |
| 817 | case $($OPENSSL s_server -help 2>&1) in |
| 818 | *-client_renegotiation*) |
| 819 | OPENSSL_S_SERVER_CLIENT_RENEGOTIATION=-client_renegotiation;; |
| 820 | esac |
| 821 | |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 822 | # skip next test if tls1_3 is not available |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 823 | requires_gnutls_tls1_3() { |
| 824 | requires_gnutls_next |
| 825 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 826 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 827 | fi |
| 828 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 829 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 830 | then |
| 831 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 832 | else |
| 833 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 834 | fi |
| 835 | fi |
| 836 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 837 | SKIP_NEXT="YES" |
| 838 | fi |
| 839 | } |
| 840 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 841 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 842 | requires_gnutls_next_no_ticket() { |
| 843 | requires_gnutls_next |
| 844 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 845 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 846 | fi |
| 847 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 848 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 849 | then |
| 850 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 851 | else |
| 852 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 853 | fi |
| 854 | fi |
| 855 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 856 | SKIP_NEXT="YES" |
| 857 | fi |
| 858 | } |
| 859 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 860 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 861 | requires_gnutls_next_disable_tls13_compat() { |
| 862 | requires_gnutls_next |
| 863 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 864 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 865 | fi |
| 866 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 867 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 868 | then |
| 869 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 870 | else |
| 871 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 872 | fi |
| 873 | fi |
| 874 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 875 | SKIP_NEXT="YES" |
| 876 | fi |
| 877 | } |
| 878 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 879 | # skip next test if GnuTLS does not support the record size limit extension |
| 880 | requires_gnutls_record_size_limit() { |
| 881 | requires_gnutls_next |
| 882 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 883 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="NO" |
| 884 | else |
| 885 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="YES" |
| 886 | fi |
| 887 | if [ "$GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE" = "NO" ]; then |
| 888 | SKIP_NEXT="YES" |
| 889 | fi |
| 890 | } |
| 891 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 892 | # skip next test if IPv6 isn't available on this host |
| 893 | requires_ipv6() { |
| 894 | if [ -z "${HAS_IPV6:-}" ]; then |
| 895 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 896 | SRV_PID=$! |
| 897 | sleep 1 |
| 898 | kill $SRV_PID >/dev/null 2>&1 |
| 899 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 900 | HAS_IPV6="NO" |
| 901 | else |
| 902 | HAS_IPV6="YES" |
| 903 | fi |
| 904 | rm -r $SRV_OUT |
| 905 | fi |
| 906 | |
| 907 | if [ "$HAS_IPV6" = "NO" ]; then |
| 908 | SKIP_NEXT="YES" |
| 909 | fi |
| 910 | } |
| 911 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 912 | # skip next test if it's i686 or uname is not available |
| 913 | requires_not_i686() { |
| 914 | if [ -z "${IS_I686:-}" ]; then |
| 915 | IS_I686="YES" |
| 916 | if which "uname" >/dev/null 2>&1; then |
| 917 | if [ -z "$(uname -a | grep i686)" ]; then |
| 918 | IS_I686="NO" |
| 919 | fi |
| 920 | fi |
| 921 | fi |
| 922 | if [ "$IS_I686" = "YES" ]; then |
| 923 | SKIP_NEXT="YES" |
| 924 | fi |
| 925 | } |
| 926 | |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 927 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 928 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 929 | 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] | 930 | if [ "$LIST_TESTS" -eq 0 ];then |
| 931 | # Calculate the input & output maximum content lengths set in the config |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 932 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 933 | # Calculate the maximum content length that fits both |
| 934 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 935 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 936 | fi |
| 937 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 938 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 939 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 940 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 941 | # skip the next test if the SSL output buffer is less than 16KB |
| 942 | requires_full_size_output_buffer() { |
| 943 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 944 | SKIP_NEXT="YES" |
| 945 | fi |
| 946 | } |
| 947 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 948 | # skip the next test if valgrind is in use |
| 949 | not_with_valgrind() { |
| 950 | if [ "$MEMCHECK" -gt 0 ]; then |
| 951 | SKIP_NEXT="YES" |
| 952 | fi |
| 953 | } |
| 954 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 955 | # skip the next test if valgrind is NOT in use |
| 956 | only_with_valgrind() { |
| 957 | if [ "$MEMCHECK" -eq 0 ]; then |
| 958 | SKIP_NEXT="YES" |
| 959 | fi |
| 960 | } |
| 961 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 962 | # 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] | 963 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 964 | CLI_DELAY_FACTOR=$1 |
| 965 | } |
| 966 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 967 | # wait for the given seconds after the client finished in the next test |
| 968 | server_needs_more_time() { |
| 969 | SRV_DELAY_SECONDS=$1 |
| 970 | } |
| 971 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 972 | # print_name <name> |
| 973 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 974 | TESTS=$(( $TESTS + 1 )) |
| 975 | LINE="" |
| 976 | |
| 977 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 978 | LINE="$TESTS " |
| 979 | fi |
| 980 | |
| 981 | LINE="$LINE$1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 982 | |
Tomás González | 378e364 | 2023-09-04 10:41:37 +0100 | [diff] [blame] | 983 | printf "%s " "$LINE" |
| 984 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
| 985 | for i in `seq 1 $LEN`; do printf '.'; done |
| 986 | printf ' ' |
| 987 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 988 | } |
| 989 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 990 | # record_outcome <outcome> [<failure-reason>] |
| 991 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 992 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 993 | record_outcome() { |
| 994 | echo "$1" |
| 995 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 996 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 997 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Jerry Yu | 9e47b26 | 2023-11-06 10:52:01 +0800 | [diff] [blame] | 998 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 999 | "$1" "${2-}" \ |
| 1000 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 1001 | fi |
| 1002 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 1003 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1004 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 1005 | # True if the presence of the given pattern in a log definitely indicates |
| 1006 | # that the test has failed. False if the presence is inconclusive. |
| 1007 | # |
| 1008 | # Inputs: |
| 1009 | # * $1: pattern found in the logs |
| 1010 | # * $TIMES_LEFT: >0 if retrying is an option |
| 1011 | # |
| 1012 | # Outputs: |
| 1013 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 1014 | # unchanged otherwise. |
| 1015 | # * Return value: 1 if the pattern is inconclusive, |
| 1016 | # 0 if the failure is definitive. |
| 1017 | log_pattern_presence_is_conclusive() { |
| 1018 | # If we've run out of attempts, then don't retry no matter what. |
| 1019 | if [ $TIMES_LEFT -eq 0 ]; then |
| 1020 | return 0 |
| 1021 | fi |
| 1022 | case $1 in |
| 1023 | "resend") |
| 1024 | # An undesired resend may have been caused by the OS dropping or |
| 1025 | # delaying a packet at an inopportune time. |
| 1026 | outcome="RETRY(resend)" |
| 1027 | return 1;; |
| 1028 | esac |
| 1029 | } |
| 1030 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1031 | # fail <message> |
| 1032 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1033 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 1034 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1035 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 1036 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1037 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1038 | if [ -n "$PXY_CMD" ]; then |
| 1039 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1040 | fi |
| 1041 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1042 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 1043 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1044 | echo " ! server output:" |
| 1045 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1046 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1047 | echo " ! client output:" |
| 1048 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1049 | if [ -n "$PXY_CMD" ]; then |
| 1050 | echo " ! ========================================================" |
| 1051 | echo " ! proxy output:" |
| 1052 | cat o-pxy-${TESTS}.log |
| 1053 | fi |
| 1054 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1055 | fi |
| 1056 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 1057 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1058 | } |
| 1059 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1060 | # is_polar <cmd_line> |
| 1061 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1062 | case "$1" in |
| 1063 | *ssl_client2*) true;; |
| 1064 | *ssl_server2*) true;; |
| 1065 | *) false;; |
| 1066 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1067 | } |
| 1068 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 1069 | # openssl s_server doesn't have -www with DTLS |
| 1070 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1071 | case "$SRV_CMD" in |
| 1072 | *s_server*-dtls*) |
| 1073 | NEEDS_INPUT=1 |
| 1074 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 1075 | *) NEEDS_INPUT=0;; |
| 1076 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 1077 | } |
| 1078 | |
| 1079 | # provide input to commands that need it |
| 1080 | provide_input() { |
| 1081 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 1082 | return |
| 1083 | fi |
| 1084 | |
| 1085 | while true; do |
| 1086 | echo "HTTP/1.0 200 OK" |
| 1087 | sleep 1 |
| 1088 | done |
| 1089 | } |
| 1090 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1091 | # has_mem_err <log_file_name> |
| 1092 | has_mem_err() { |
| 1093 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 1094 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 1095 | then |
| 1096 | return 1 # false: does not have errors |
| 1097 | else |
| 1098 | return 0 # true: has errors |
| 1099 | fi |
| 1100 | } |
| 1101 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1102 | # 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] | 1103 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1104 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1105 | newline=' |
| 1106 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1107 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1108 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1109 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1110 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1111 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1112 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1113 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 1114 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1115 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1116 | # When we use a proxy, it will be listening on the same port we |
| 1117 | # 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] | 1118 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1119 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1120 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1121 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1122 | echo "$3 START TIMEOUT" |
| 1123 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1124 | break |
| 1125 | fi |
| 1126 | # Linux and *BSD support decimal arguments to sleep. On other |
| 1127 | # OSes this may be a tight loop. |
| 1128 | sleep 0.1 2>/dev/null || true |
| 1129 | done |
| 1130 | } |
| 1131 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1132 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 1133 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1134 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1135 | } |
| 1136 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1137 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1138 | # Wait for server process $2 to be listening on port $1. |
| 1139 | wait_server_start() { |
| 1140 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 1141 | } |
| 1142 | |
| 1143 | # Wait for proxy process $2 to be listening on port $1. |
| 1144 | wait_proxy_start() { |
| 1145 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 1146 | } |
| 1147 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1148 | # 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] | 1149 | # 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] | 1150 | # acceptable bounds |
| 1151 | check_server_hello_time() { |
| 1152 | # 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] | 1153 | 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] | 1154 | # Get the Unix timestamp for now |
| 1155 | CUR_TIME=$(date +'%s') |
| 1156 | THRESHOLD_IN_SECS=300 |
| 1157 | |
| 1158 | # Check if the ServerHello time was printed |
| 1159 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 1160 | return 1 |
| 1161 | fi |
| 1162 | |
| 1163 | # Check the time in ServerHello is within acceptable bounds |
| 1164 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 1165 | # The time in ServerHello is at least 5 minutes before now |
| 1166 | return 1 |
| 1167 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 1168 | # 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] | 1169 | return 1 |
| 1170 | else |
| 1171 | return 0 |
| 1172 | fi |
| 1173 | } |
| 1174 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1175 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 1176 | handshake_memory_get() { |
| 1177 | OUTPUT_VARIABLE="$1" |
| 1178 | OUTPUT_FILE="$2" |
| 1179 | |
| 1180 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 1181 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 1182 | |
| 1183 | # Check if memory usage was read |
| 1184 | if [ -z "$MEM_USAGE" ]; then |
| 1185 | echo "Error: Can not read the value of handshake memory usage" |
| 1186 | return 1 |
| 1187 | else |
| 1188 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 1189 | return 0 |
| 1190 | fi |
| 1191 | } |
| 1192 | |
| 1193 | # Get handshake memory usage from server or client output and check if this value |
| 1194 | # is not higher than the maximum given by the first argument |
| 1195 | handshake_memory_check() { |
| 1196 | MAX_MEMORY="$1" |
| 1197 | OUTPUT_FILE="$2" |
| 1198 | |
| 1199 | # Get memory usage |
| 1200 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 1201 | return 1 |
| 1202 | fi |
| 1203 | |
| 1204 | # Check if memory usage is below max value |
| 1205 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 1206 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 1207 | "but should be below $MAX_MEMORY bytes" |
| 1208 | return 1 |
| 1209 | else |
| 1210 | return 0 |
| 1211 | fi |
| 1212 | } |
| 1213 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1214 | # wait for client to terminate and set CLI_EXIT |
| 1215 | # must be called right after starting the client |
| 1216 | wait_client_done() { |
| 1217 | CLI_PID=$! |
| 1218 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1219 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 1220 | CLI_DELAY_FACTOR=1 |
| 1221 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1222 | ( 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] | 1223 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1224 | |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1225 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
| 1226 | # To remove it from stdout, redirect stdout/stderr to CLI_OUT |
| 1227 | wait $CLI_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1228 | CLI_EXIT=$? |
| 1229 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1230 | kill $DOG_PID >/dev/null 2>&1 |
Jerry Yu | fe52e55 | 2022-07-09 04:23:43 +0000 | [diff] [blame] | 1231 | wait $DOG_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1232 | |
| 1233 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1234 | |
| 1235 | sleep $SRV_DELAY_SECONDS |
| 1236 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1237 | } |
| 1238 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1239 | # check if the given command uses dtls and sets global variable DTLS |
| 1240 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1241 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 1242 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1243 | *) DTLS=0;; |
| 1244 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1245 | } |
| 1246 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1247 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 1248 | is_gnutls() { |
| 1249 | case "$1" in |
| 1250 | *gnutls-cli*) |
| 1251 | CMD_IS_GNUTLS=1 |
| 1252 | ;; |
| 1253 | *gnutls-serv*) |
| 1254 | CMD_IS_GNUTLS=1 |
| 1255 | ;; |
| 1256 | *) |
| 1257 | CMD_IS_GNUTLS=0 |
| 1258 | ;; |
| 1259 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1260 | } |
| 1261 | |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 1262 | # Some external tools (gnutls or openssl) might not have support for static ECDH |
| 1263 | # 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] | 1264 | # and client command lines, given as input, to verify if the current test |
| 1265 | # is using one of these tools. |
| 1266 | use_ext_tool_without_ecdh_support() { |
| 1267 | case "$1" in |
| 1268 | *$GNUTLS_SERV*|\ |
| 1269 | *${GNUTLS_NEXT_SERV:-"gnutls-serv-dummy"}*|\ |
| 1270 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1271 | echo "yes" |
| 1272 | return;; |
| 1273 | esac |
| 1274 | case "$2" in |
| 1275 | *$GNUTLS_CLI*|\ |
| 1276 | *${GNUTLS_NEXT_CLI:-"gnutls-cli-dummy"}*|\ |
| 1277 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1278 | echo "yes" |
| 1279 | return;; |
| 1280 | esac |
| 1281 | echo "no" |
| 1282 | } |
| 1283 | |
Jerry Yu | f467d46 | 2022-11-07 13:12:44 +0800 | [diff] [blame] | 1284 | # Generate random psk_list argument for ssl_server2 |
| 1285 | get_srv_psk_list () |
| 1286 | { |
| 1287 | case $(( TESTS % 3 )) in |
| 1288 | 0) echo "psk_list=abc,dead,def,beef,Client_identity,6162636465666768696a6b6c6d6e6f70";; |
| 1289 | 1) echo "psk_list=abc,dead,Client_identity,6162636465666768696a6b6c6d6e6f70,def,beef";; |
| 1290 | 2) echo "psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70,abc,dead,def,beef";; |
| 1291 | esac |
| 1292 | } |
| 1293 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1294 | # Determine what calc_verify trace is to be expected, if any. |
| 1295 | # |
| 1296 | # calc_verify is only called for two things: to calculate the |
| 1297 | # extended master secret, and to process client authentication. |
| 1298 | # |
| 1299 | # Warning: the current implementation assumes that extended_ms is not |
| 1300 | # disabled on the client or on the server. |
| 1301 | # |
| 1302 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1303 | # * $1: the value of the server auth_mode parameter. |
| 1304 | # 'required' if client authentication is expected, |
| 1305 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1306 | # * $CONFIGS_ENABLED |
| 1307 | # |
| 1308 | # Outputs: |
| 1309 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 1310 | set_maybe_calc_verify() { |
| 1311 | maybe_calc_verify= |
| 1312 | case $CONFIGS_ENABLED in |
| 1313 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 1314 | *) |
| 1315 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1316 | ''|none) return;; |
| 1317 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1318 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 1319 | esac |
| 1320 | esac |
| 1321 | case $CONFIGS_ENABLED in |
| 1322 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 1323 | *) maybe_calc_verify="<= calc verify";; |
| 1324 | esac |
| 1325 | } |
| 1326 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1327 | # Compare file content |
| 1328 | # Usage: find_in_both pattern file1 file2 |
| 1329 | # extract from file1 the first line matching the pattern |
| 1330 | # check in file2 that the same line can be found |
| 1331 | find_in_both() { |
| 1332 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 1333 | if [ -z "$srv_pattern" ]; then |
| 1334 | return 1; |
| 1335 | fi |
| 1336 | |
| 1337 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 1338 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1339 | else |
| 1340 | return 1; |
| 1341 | fi |
| 1342 | } |
| 1343 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1344 | SKIP_HANDSHAKE_CHECK="NO" |
| 1345 | skip_handshake_stage_check() { |
| 1346 | SKIP_HANDSHAKE_CHECK="YES" |
| 1347 | } |
| 1348 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1349 | # Analyze the commands that will be used in a test. |
| 1350 | # |
| 1351 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 1352 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 1353 | # |
| 1354 | # Inputs: |
| 1355 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 1356 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 1357 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 1358 | # |
| 1359 | # Outputs: |
| 1360 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1361 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1362 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 1363 | # 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] | 1364 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1365 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 1366 | case " $SRV_CMD " in |
| 1367 | *' server_addr=::1 '*) |
| 1368 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 1369 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1370 | fi |
| 1371 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1372 | # update CMD_IS_GNUTLS variable |
| 1373 | is_gnutls "$SRV_CMD" |
| 1374 | |
| 1375 | # if the server uses gnutls but doesn't set priority, explicitly |
| 1376 | # set the default priority |
| 1377 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1378 | case "$SRV_CMD" in |
| 1379 | *--priority*) :;; |
| 1380 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 1381 | esac |
| 1382 | fi |
| 1383 | |
| 1384 | # update CMD_IS_GNUTLS variable |
| 1385 | is_gnutls "$CLI_CMD" |
| 1386 | |
| 1387 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1388 | # set the default priority |
| 1389 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1390 | case "$CLI_CMD" in |
| 1391 | *--priority*) :;; |
| 1392 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1393 | esac |
| 1394 | fi |
| 1395 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1396 | # fix client port |
| 1397 | if [ -n "$PXY_CMD" ]; then |
| 1398 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1399 | else |
| 1400 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 1401 | fi |
| 1402 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1403 | # prepend valgrind to our commands if active |
| 1404 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1405 | if is_polar "$SRV_CMD"; then |
| 1406 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1407 | fi |
| 1408 | if is_polar "$CLI_CMD"; then |
| 1409 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1410 | fi |
| 1411 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1412 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1413 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1414 | # Check for failure conditions after a test case. |
| 1415 | # |
| 1416 | # Inputs from run_test: |
| 1417 | # * positional parameters: test options (see run_test documentation) |
| 1418 | # * $CLI_EXIT: client return code |
| 1419 | # * $CLI_EXPECT: expected client return code |
| 1420 | # * $SRV_RET: server return code |
| 1421 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1422 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1423 | # |
| 1424 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1425 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1426 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1427 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1428 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1429 | if [ $TIMES_LEFT -gt 0 ] && |
| 1430 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1431 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1432 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1433 | return |
| 1434 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1435 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1436 | # 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] | 1437 | # (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] | 1438 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1439 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1440 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1441 | then |
| 1442 | if is_polar "$SRV_CMD"; then |
| 1443 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1444 | else |
| 1445 | fail "server or client failed to reach handshake stage" |
| 1446 | return |
| 1447 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1448 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1449 | if is_polar "$CLI_CMD"; then |
| 1450 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1451 | else |
| 1452 | fail "server or client failed to reach handshake stage" |
| 1453 | return |
| 1454 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1455 | fi |
| 1456 | fi |
| 1457 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1458 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1459 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1460 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1461 | # care anyway), in case e.g. the server reports a memory leak. |
| 1462 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1463 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1464 | return |
| 1465 | fi |
| 1466 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1467 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1468 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1469 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1470 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1471 | 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] | 1472 | return |
| 1473 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1474 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1475 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1476 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1477 | # 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] | 1478 | while [ $# -gt 0 ] |
| 1479 | do |
| 1480 | case $1 in |
| 1481 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1482 | 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] | 1483 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1484 | return |
| 1485 | fi |
| 1486 | ;; |
| 1487 | |
| 1488 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1489 | 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] | 1490 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1491 | return |
| 1492 | fi |
| 1493 | ;; |
| 1494 | |
| 1495 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1496 | 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] | 1497 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1498 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1499 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1500 | return |
| 1501 | fi |
| 1502 | ;; |
| 1503 | |
| 1504 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1505 | 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] | 1506 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1507 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1508 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1509 | return |
| 1510 | fi |
| 1511 | ;; |
| 1512 | |
| 1513 | # The filtering in the following two options (-u and -U) do the following |
| 1514 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1515 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1516 | # - keep one of each non-unique line |
| 1517 | # - count how many lines remain |
| 1518 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1519 | # if there were no duplicates. |
| 1520 | "-U") |
| 1521 | 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 |
| 1522 | fail "lines following pattern '$2' must be unique in Server output" |
| 1523 | return |
| 1524 | fi |
| 1525 | ;; |
| 1526 | |
| 1527 | "-u") |
| 1528 | 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 |
| 1529 | 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] | 1530 | return |
| 1531 | fi |
| 1532 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1533 | "-F") |
| 1534 | if ! $2 "$SRV_OUT"; then |
| 1535 | fail "function call to '$2' failed on Server output" |
| 1536 | return |
| 1537 | fi |
| 1538 | ;; |
| 1539 | "-f") |
| 1540 | if ! $2 "$CLI_OUT"; then |
| 1541 | fail "function call to '$2' failed on Client output" |
| 1542 | return |
| 1543 | fi |
| 1544 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1545 | "-g") |
| 1546 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1547 | fail "function call to '$2' failed on Server and Client output" |
| 1548 | return |
| 1549 | fi |
| 1550 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1551 | |
| 1552 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1553 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1554 | exit 1 |
| 1555 | esac |
| 1556 | shift 2 |
| 1557 | done |
| 1558 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1559 | # check valgrind's results |
| 1560 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1561 | 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] | 1562 | fail "Server has memory errors" |
| 1563 | return |
| 1564 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1565 | 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] | 1566 | fail "Client has memory errors" |
| 1567 | return |
| 1568 | fi |
| 1569 | fi |
| 1570 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1571 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1572 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1573 | } |
| 1574 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1575 | # Run the current test case: start the server and if applicable the proxy, run |
| 1576 | # the client, wait for all processes to finish or time out. |
| 1577 | # |
| 1578 | # Inputs: |
| 1579 | # * $NAME: test case name |
| 1580 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1581 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1582 | # |
| 1583 | # Outputs: |
| 1584 | # * $CLI_EXIT: client return code |
| 1585 | # * $SRV_RET: server return code |
| 1586 | do_run_test_once() { |
| 1587 | # run the commands |
| 1588 | if [ -n "$PXY_CMD" ]; then |
| 1589 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1590 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1591 | PXY_PID=$! |
| 1592 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1593 | fi |
| 1594 | |
| 1595 | check_osrv_dtls |
| 1596 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1597 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1598 | SRV_PID=$! |
| 1599 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1600 | |
| 1601 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1602 | # The client must be a subprocess of the script in order for killing it to |
| 1603 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1604 | # not at the end of the line: the latter approach will spawn eval as a |
| 1605 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1606 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1607 | wait_client_done |
| 1608 | |
| 1609 | sleep 0.05 |
| 1610 | |
| 1611 | # terminate the server (and the proxy) |
| 1612 | kill $SRV_PID |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1613 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
Jerry Yu | 27d8092 | 2022-08-02 21:28:55 +0800 | [diff] [blame] | 1614 | # To remove it from stdout, redirect stdout/stderr to SRV_OUT |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1615 | wait $SRV_PID >> $SRV_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1616 | SRV_RET=$? |
| 1617 | |
| 1618 | if [ -n "$PXY_CMD" ]; then |
| 1619 | kill $PXY_PID >/dev/null 2>&1 |
Jerry Yu | 6969eee | 2022-10-10 10:25:26 +0800 | [diff] [blame] | 1620 | wait $PXY_PID >> $PXY_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1621 | fi |
| 1622 | } |
| 1623 | |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1624 | # 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] | 1625 | # $1 and $2 contain the server and client command lines, respectively. |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1626 | # |
| 1627 | # Note: this function only provides some guess about TLS version by simply |
Yanray Wang | 7b320fa | 2023-11-08 10:33:30 +0800 | [diff] [blame] | 1628 | # looking at the server/client command lines. Even though this works |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1629 | # for the sake of tests' filtering (especially in conjunction with the |
| 1630 | # detect_required_features() function), it does NOT guarantee that the |
| 1631 | # result is accurate. It does not check other conditions, such as: |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1632 | # - we can force a ciphersuite which contains "WITH" in its name, meaning |
| 1633 | # that we are going to use TLS 1.2 |
| 1634 | # - etc etc |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1635 | get_tls_version() { |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1636 | # First check if the version is forced on an Mbed TLS peer |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1637 | case $1 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1638 | *tls12*) |
| 1639 | echo "TLS12" |
| 1640 | return;; |
| 1641 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1642 | echo "TLS13" |
| 1643 | return;; |
| 1644 | esac |
| 1645 | case $2 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1646 | *tls12*) |
| 1647 | echo "TLS12" |
| 1648 | return;; |
| 1649 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1650 | echo "TLS13" |
| 1651 | return;; |
| 1652 | esac |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1653 | # Second check if the version is forced on an OpenSSL or GnuTLS peer |
| 1654 | case $1 in |
| 1655 | tls1_2*) |
| 1656 | echo "TLS12" |
| 1657 | return;; |
| 1658 | *tls1_3) |
| 1659 | echo "TLS13" |
| 1660 | return;; |
| 1661 | esac |
| 1662 | case $2 in |
| 1663 | *tls1_2) |
| 1664 | echo "TLS12" |
| 1665 | return;; |
| 1666 | *tls1_3) |
| 1667 | echo "TLS13" |
| 1668 | return;; |
| 1669 | esac |
| 1670 | # Third if the version is not forced, if TLS 1.3 is enabled then the test |
| 1671 | # is aimed to run a TLS 1.3 handshake. |
Gilles Peskine | 0bc5729 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 1672 | if is_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1673 | then |
| 1674 | echo "TLS13" |
| 1675 | else |
| 1676 | echo "TLS12" |
| 1677 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1678 | } |
| 1679 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1680 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1681 | # Options: -s pattern pattern that must be present in server output |
| 1682 | # -c pattern pattern that must be present in client output |
| 1683 | # -u pattern lines after pattern must be unique in client output |
| 1684 | # -f call shell function on client output |
| 1685 | # -S pattern pattern that must be absent in server output |
| 1686 | # -C pattern pattern that must be absent in client output |
| 1687 | # -U pattern lines after pattern must be unique in server output |
| 1688 | # -F call shell function on server output |
| 1689 | # -g call shell function on server and client output |
| 1690 | run_test() { |
| 1691 | NAME="$1" |
| 1692 | shift 1 |
| 1693 | |
Tomás González | 787428a | 2023-08-23 15:27:19 +0100 | [diff] [blame] | 1694 | if is_excluded "$NAME"; then |
| 1695 | SKIP_NEXT="NO" |
| 1696 | # There was no request to run the test, so don't record its outcome. |
| 1697 | return |
| 1698 | fi |
| 1699 | |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1700 | if [ "$LIST_TESTS" -gt 0 ]; then |
Pengyu Lv | 3c170d3 | 2023-11-29 13:53:34 +0800 | [diff] [blame] | 1701 | printf "%s\n" "${TEST_SUITE_NAME:-ssl-opt};$NAME" |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1702 | return |
| 1703 | fi |
| 1704 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 1705 | # Use ssl-opt as default test suite name. Also see record_outcome function |
| 1706 | if is_excluded_test_suite "${TEST_SUITE_NAME:-ssl-opt}"; then |
| 1707 | # Do not skip next test and skip current test. |
| 1708 | SKIP_NEXT="NO" |
| 1709 | return |
| 1710 | fi |
| 1711 | |
Tomás González | 51cb704 | 2023-09-07 10:21:19 +0100 | [diff] [blame] | 1712 | print_name "$NAME" |
| 1713 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1714 | # Do we only run numbered tests? |
| 1715 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1716 | case ",$RUN_TEST_NUMBER," in |
| 1717 | *",$TESTS,"*) :;; |
| 1718 | *) SKIP_NEXT="YES";; |
| 1719 | esac |
| 1720 | fi |
| 1721 | |
| 1722 | # does this test use a proxy? |
| 1723 | if [ "X$1" = "X-p" ]; then |
| 1724 | PXY_CMD="$2" |
| 1725 | shift 2 |
| 1726 | else |
| 1727 | PXY_CMD="" |
| 1728 | fi |
| 1729 | |
| 1730 | # get commands and client output |
| 1731 | SRV_CMD="$1" |
| 1732 | CLI_CMD="$2" |
| 1733 | CLI_EXPECT="$3" |
| 1734 | shift 3 |
| 1735 | |
| 1736 | # Check if test uses files |
| 1737 | case "$SRV_CMD $CLI_CMD" in |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1738 | *$DATA_FILES_PATH/*) |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1739 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1740 | esac |
| 1741 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1742 | # Check if the test uses DTLS. |
| 1743 | detect_dtls "$SRV_CMD" |
| 1744 | if [ "$DTLS" -eq 1 ]; then |
| 1745 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1746 | fi |
| 1747 | |
Yanray Wang | 7b320fa | 2023-11-08 10:33:30 +0800 | [diff] [blame] | 1748 | # 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] | 1749 | EXT_WO_ECDH=$(use_ext_tool_without_ecdh_support "$SRV_CMD" "$CLI_CMD") |
| 1750 | |
Valerio Setti | 726ffbf | 2023-08-02 20:02:44 +0200 | [diff] [blame] | 1751 | # Guess the TLS version which is going to be used |
| 1752 | if [ "$EXT_WO_ECDH" = "no" ]; then |
| 1753 | TLS_VERSION=$(get_tls_version "$SRV_CMD" "$CLI_CMD") |
| 1754 | else |
| 1755 | TLS_VERSION="TLS12" |
| 1756 | fi |
| 1757 | |
| 1758 | # 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] | 1759 | # from their command-line arguments, check whether they're enabled. |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1760 | detect_required_features "$SRV_CMD" "server" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
| 1761 | detect_required_features "$CLI_CMD" "client" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1762 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 1763 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1764 | maybe_adapt_for_psk "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1765 | |
| 1766 | # should we skip? |
| 1767 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1768 | SKIP_NEXT="NO" |
| 1769 | record_outcome "SKIP" |
| 1770 | SKIPS=$(( $SKIPS + 1 )) |
| 1771 | return |
| 1772 | fi |
| 1773 | |
| 1774 | analyze_test_commands "$@" |
| 1775 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1776 | # One regular run and two retries |
| 1777 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1778 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1779 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1780 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1781 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1782 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1783 | check_test_failure "$@" |
| 1784 | case $outcome in |
| 1785 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1786 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1787 | FAIL) return;; |
| 1788 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1789 | done |
| 1790 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1791 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1792 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1793 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1794 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1795 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1796 | if [ -n "$PXY_CMD" ]; then |
| 1797 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1798 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1799 | fi |
| 1800 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1801 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1802 | } |
| 1803 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1804 | run_test_psa() { |
| 1805 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1806 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1807 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1808 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1809 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1810 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1811 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1812 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1813 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1814 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1815 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1816 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1817 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1818 | -S "error" \ |
| 1819 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1820 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1821 | } |
| 1822 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1823 | run_test_psa_force_curve() { |
| 1824 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1825 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1826 | run_test "PSA - ECDH with $1" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 1827 | "$P_SRV debug_level=4 force_version=tls12 groups=$1" \ |
| 1828 | "$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] | 1829 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1830 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1831 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1832 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1833 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1834 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1835 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1836 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1837 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1838 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1839 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1840 | } |
| 1841 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1842 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1843 | # a maximum fragment length. |
| 1844 | # first argument ($1) is MFL for SSL client |
| 1845 | # 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] | 1846 | run_test_memory_after_handshake_with_mfl() |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1847 | { |
| 1848 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1849 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1850 | |
| 1851 | # Leave some margin for robustness |
| 1852 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1853 | |
| 1854 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1855 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1856 | "$P_CLI debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1857 | 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] | 1858 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1859 | 0 \ |
| 1860 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1861 | } |
| 1862 | |
| 1863 | |
| 1864 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1865 | # 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] | 1866 | run_tests_memory_after_handshake() |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1867 | { |
| 1868 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1869 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1870 | |
| 1871 | # first test with default MFU is to get reference memory usage |
| 1872 | MEMORY_USAGE_MFL_16K=0 |
| 1873 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1874 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1875 | "$P_CLI debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1876 | 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] | 1877 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1878 | 0 \ |
| 1879 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1880 | |
| 1881 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1882 | run_test_memory_after_handshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1883 | |
| 1884 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1885 | run_test_memory_after_handshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1886 | |
| 1887 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1888 | run_test_memory_after_handshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1889 | |
| 1890 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1891 | run_test_memory_after_handshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1892 | } |
| 1893 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1894 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1895 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1896 | rm -f context_srv.txt |
| 1897 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1898 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1899 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1900 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1901 | 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] | 1902 | exit 1 |
| 1903 | } |
| 1904 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1905 | # |
| 1906 | # MAIN |
| 1907 | # |
| 1908 | |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 1909 | # Make the outcome file path relative to the original directory, not |
| 1910 | # to .../tests |
| 1911 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 1912 | [!/]*) |
| 1913 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 1914 | ;; |
| 1915 | esac |
| 1916 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 1917 | populate_enabled_hash_algs |
| 1918 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1919 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1920 | # patterns rather than regular expressions, use a case statement instead |
| 1921 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1922 | # detects simple cases: plain substring, everything, nothing. |
| 1923 | # |
| 1924 | # As an exception, the character '.' is treated as an ordinary character |
| 1925 | # if it is the only special character in the string. This is because it's |
| 1926 | # rare to need "any one character", but needing a literal '.' is common |
| 1927 | # (e.g. '-f "DTLS 1.2"'). |
| 1928 | need_grep= |
| 1929 | case "$FILTER" in |
| 1930 | '^$') simple_filter=;; |
| 1931 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1932 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1933 | need_grep=1;; |
| 1934 | *) # No regexp or shell-pattern special character |
| 1935 | simple_filter="*$FILTER*";; |
| 1936 | esac |
| 1937 | case "$EXCLUDE" in |
| 1938 | '^$') simple_exclude=;; |
| 1939 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1940 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1941 | need_grep=1;; |
| 1942 | *) # No regexp or shell-pattern special character |
| 1943 | simple_exclude="*$EXCLUDE*";; |
| 1944 | esac |
| 1945 | if [ -n "$need_grep" ]; then |
| 1946 | is_excluded () { |
| 1947 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1948 | } |
| 1949 | else |
| 1950 | is_excluded () { |
| 1951 | case "$1" in |
| 1952 | $simple_exclude) true;; |
| 1953 | $simple_filter) false;; |
| 1954 | *) true;; |
| 1955 | esac |
| 1956 | } |
| 1957 | fi |
| 1958 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 1959 | # Filter tests according to TEST_SUITE_NAME |
| 1960 | is_excluded_test_suite () { |
| 1961 | if [ -n "$RUN_TEST_SUITE" ] |
| 1962 | then |
| 1963 | case ",$RUN_TEST_SUITE," in |
| 1964 | *",$1,"*) false;; |
| 1965 | *) true;; |
| 1966 | esac |
| 1967 | else |
| 1968 | false |
| 1969 | fi |
| 1970 | |
| 1971 | } |
| 1972 | |
| 1973 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 1974 | if [ "$LIST_TESTS" -eq 0 ];then |
| 1975 | |
| 1976 | # sanity checks, avoid an avalanche of errors |
| 1977 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1978 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1979 | P_PXY_BIN="${P_PXY%%[ ]*}" |
| 1980 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1981 | echo "Command '$P_SRV_BIN' is not an executable file" |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1982 | exit 1 |
| 1983 | fi |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 1984 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1985 | echo "Command '$P_CLI_BIN' is not an executable file" |
| 1986 | exit 1 |
| 1987 | fi |
| 1988 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1989 | echo "Command '$P_PXY_BIN' is not an executable file" |
| 1990 | exit 1 |
| 1991 | fi |
| 1992 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1993 | if which valgrind >/dev/null 2>&1; then :; else |
| 1994 | echo "Memcheck not possible. Valgrind not found" |
| 1995 | exit 1 |
| 1996 | fi |
| 1997 | fi |
| 1998 | if which $OPENSSL >/dev/null 2>&1; then :; else |
| 1999 | echo "Command '$OPENSSL' not found" |
| 2000 | exit 1 |
| 2001 | fi |
| 2002 | |
| 2003 | # used by watchdog |
| 2004 | MAIN_PID="$$" |
| 2005 | |
| 2006 | # We use somewhat arbitrary delays for tests: |
| 2007 | # - how long do we wait for the server to start (when lsof not available)? |
| 2008 | # - how long do we allow for the client to finish? |
| 2009 | # (not to check performance, just to avoid waiting indefinitely) |
| 2010 | # Things are slower with valgrind, so give extra time here. |
| 2011 | # |
| 2012 | # Note: without lsof, there is a trade-off between the running time of this |
| 2013 | # script and the risk of spurious errors because we didn't wait long enough. |
| 2014 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 2015 | # the script, only the case where a client or server gets stuck. |
| 2016 | if [ "$MEMCHECK" -gt 0 ]; then |
| 2017 | START_DELAY=6 |
| 2018 | DOG_DELAY=60 |
| 2019 | else |
| 2020 | START_DELAY=2 |
| 2021 | DOG_DELAY=20 |
| 2022 | fi |
| 2023 | |
| 2024 | # some particular tests need more time: |
| 2025 | # - for the client, we multiply the usual watchdog limit by a factor |
| 2026 | # - for the server, we sleep for a number of seconds after the client exits |
| 2027 | # see client_need_more_time() and server_needs_more_time() |
| 2028 | CLI_DELAY_FACTOR=1 |
| 2029 | SRV_DELAY_SECONDS=0 |
| 2030 | |
| 2031 | # fix commands to use this port, force IPv4 while at it |
| 2032 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
| 2033 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 2034 | # machines that will resolve to ::1, and we don't want ipv6 here. |
| 2035 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 2036 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
| 2037 | 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"}" |
| 2038 | O_SRV="$O_SRV -accept $SRV_PORT" |
| 2039 | O_CLI="$O_CLI -connect 127.0.0.1:+SRV_PORT" |
| 2040 | G_SRV="$G_SRV -p $SRV_PORT" |
| 2041 | G_CLI="$G_CLI -p +SRV_PORT" |
| 2042 | |
| 2043 | # Newer versions of OpenSSL have a syntax to enable all "ciphers", even |
| 2044 | # low-security ones. This covers not just cipher suites but also protocol |
| 2045 | # versions. It is necessary, for example, to use (D)TLS 1.0/1.1 on |
| 2046 | # OpenSSL 1.1.1f from Ubuntu 20.04. The syntax was only introduced in |
| 2047 | # OpenSSL 1.1.0 (21e0c1d23afff48601eb93135defddae51f7e2e3) and I can't find |
| 2048 | # a way to discover it from -help, so check the openssl version. |
| 2049 | case $($OPENSSL version) in |
| 2050 | "OpenSSL 0"*|"OpenSSL 1.0"*) :;; |
| 2051 | *) |
| 2052 | O_CLI="$O_CLI -cipher ALL@SECLEVEL=0" |
| 2053 | O_SRV="$O_SRV -cipher ALL@SECLEVEL=0" |
| 2054 | ;; |
| 2055 | esac |
| 2056 | |
| 2057 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 2058 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
| 2059 | O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT" |
| 2060 | O_NEXT_SRV_EARLY_DATA="$O_NEXT_SRV_EARLY_DATA -accept $SRV_PORT" |
| 2061 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
| 2062 | O_NEXT_CLI_NO_CERT="$O_NEXT_CLI_NO_CERT -connect 127.0.0.1:+SRV_PORT" |
| 2063 | fi |
| 2064 | |
| 2065 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
| 2066 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 2067 | G_NEXT_SRV_NO_CERT="$G_NEXT_SRV_NO_CERT -p $SRV_PORT" |
| 2068 | fi |
| 2069 | |
| 2070 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
| 2071 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
| 2072 | G_NEXT_CLI_NO_CERT="$G_NEXT_CLI_NO_CERT -p +SRV_PORT localhost" |
| 2073 | fi |
| 2074 | |
| 2075 | # Allow SHA-1, because many of our test certificates use it |
| 2076 | P_SRV="$P_SRV allow_sha1=1" |
| 2077 | P_CLI="$P_CLI allow_sha1=1" |
| 2078 | |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 2079 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2080 | # Also pick a unique name for intermediate files |
| 2081 | SRV_OUT="srv_out.$$" |
| 2082 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 2083 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2084 | SESSION="session.$$" |
| 2085 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 2086 | SKIP_NEXT="NO" |
| 2087 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 2088 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 2089 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2090 | # Basic test |
| 2091 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2092 | # Checks that: |
| 2093 | # - 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] | 2094 | # - the expected parameters are selected |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2095 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2096 | requires_hash_alg SHA_512 # "signature_algorithm ext: 6" |
Valerio Setti | 482a0b9 | 2023-08-18 15:55:10 +0200 | [diff] [blame] | 2097 | requires_any_configs_enabled "MBEDTLS_ECP_DP_CURVE25519_ENABLED \ |
| 2098 | PSA_WANT_ECC_MONTGOMERY_255" |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2099 | run_test "Default, TLS 1.2" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2100 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2101 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2102 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2103 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 2104 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2105 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 2106 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2107 | -S "error" \ |
| 2108 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2109 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2110 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2111 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2112 | run_test "Default, DTLS" \ |
| 2113 | "$P_SRV dtls=1" \ |
| 2114 | "$P_CLI dtls=1" \ |
| 2115 | 0 \ |
| 2116 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 2117 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2118 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 2119 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 2120 | run_test "TLS client auth: required" \ |
| 2121 | "$P_SRV auth_mode=required" \ |
| 2122 | "$P_CLI" \ |
| 2123 | 0 \ |
| 2124 | -s "Verifying peer X.509 certificate... ok" |
| 2125 | |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 2126 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2127 | "$P_SRV" \ |
| 2128 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2129 | 0 \ |
| 2130 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2131 | -c "Key size is 256" |
| 2132 | |
| 2133 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2134 | "$P_SRV" \ |
| 2135 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2136 | 0 \ |
| 2137 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2138 | -c "Key size is 128" |
| 2139 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2140 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2141 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2142 | # module does not support PSA dispatching so we need builtin support. |
| 2143 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2144 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2145 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2146 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2147 | run_test "TLS: password protected client key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2148 | "$P_SRV force_version=tls12 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2149 | "$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] | 2150 | 0 |
| 2151 | |
| 2152 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2153 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2154 | # module does not support PSA dispatching so we need builtin support. |
| 2155 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2156 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2157 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2158 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2159 | run_test "TLS: password protected server key" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2160 | "$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] | 2161 | "$P_CLI force_version=tls12" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2162 | 0 |
| 2163 | |
| 2164 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2165 | requires_config_enabled MBEDTLS_RSA_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2166 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2167 | # module does not support PSA dispatching so we need builtin support. |
| 2168 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2169 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2170 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2171 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2172 | run_test "TLS: password protected server key, two certificates" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2173 | "$P_SRV force_version=tls12\ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2174 | key_file=$DATA_FILES_PATH/server5.key.enc key_pwd=PolarSSLTest crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2175 | 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] | 2176 | "$P_CLI" \ |
| 2177 | 0 |
| 2178 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2179 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2180 | run_test "CA callback on client" \ |
| 2181 | "$P_SRV debug_level=3" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 2182 | "$P_CLI ca_callback=1 debug_level=3 " \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2183 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2184 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2185 | -S "error" \ |
| 2186 | -C "error" |
| 2187 | |
| 2188 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2189 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2190 | requires_hash_alg SHA_256 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2191 | run_test "CA callback on server" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 2192 | "$P_SRV auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2193 | "$P_CLI ca_callback=1 debug_level=3 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2194 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2195 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2196 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2197 | -s "Verifying peer X.509 certificate... ok" \ |
| 2198 | -S "error" \ |
| 2199 | -C "error" |
| 2200 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2201 | # Test using an EC opaque private key for client authentication |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2202 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2203 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2204 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2205 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2206 | run_test "Opaque key for client authentication: ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2207 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2208 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 2209 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2210 | 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] | 2211 | 0 \ |
| 2212 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2213 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2214 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2215 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2216 | -S "error" \ |
| 2217 | -C "error" |
| 2218 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2219 | # Test using a RSA opaque private key for client authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2220 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2221 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2222 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2223 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2224 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2225 | run_test "Opaque key for client authentication: ECDHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2226 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2227 | key_file=$DATA_FILES_PATH/server2.key" \ |
| 2228 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2229 | 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] | 2230 | 0 \ |
| 2231 | -c "key type: Opaque" \ |
| 2232 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2233 | -s "Verifying peer X.509 certificate... ok" \ |
| 2234 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2235 | -S "error" \ |
| 2236 | -C "error" |
| 2237 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2238 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2239 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2240 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2241 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2242 | run_test "Opaque key for client authentication: DHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2243 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2244 | key_file=$DATA_FILES_PATH/server2.key" \ |
| 2245 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2246 | 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] | 2247 | key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2248 | 0 \ |
| 2249 | -c "key type: Opaque" \ |
| 2250 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2251 | -s "Verifying peer X.509 certificate... ok" \ |
| 2252 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2253 | -S "error" \ |
| 2254 | -C "error" |
| 2255 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2256 | # Test using an EC opaque private key for server authentication |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2257 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2258 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2259 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2260 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2261 | run_test "Opaque key for server authentication: ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2262 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2263 | 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] | 2264 | "$P_CLI force_version=tls12" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2265 | 0 \ |
| 2266 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2267 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2268 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2269 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2270 | -S "error" \ |
| 2271 | -C "error" |
| 2272 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2273 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2274 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2275 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2276 | run_test "Opaque key for server authentication: ECDH-" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2277 | "$P_SRV auth_mode=required key_opaque=1\ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2278 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt\ |
| 2279 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdh,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2280 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2281 | 0 \ |
| 2282 | -c "Verifying peer X.509 certificate... ok" \ |
| 2283 | -c "Ciphersuite is TLS-ECDH-" \ |
| 2284 | -s "key types: Opaque, none" \ |
| 2285 | -s "Ciphersuite is TLS-ECDH-" \ |
| 2286 | -S "error" \ |
| 2287 | -C "error" |
| 2288 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2289 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2290 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2291 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2292 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2293 | 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] | 2294 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2295 | 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] | 2296 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2297 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2298 | 1 \ |
| 2299 | -s "key types: Opaque, none" \ |
| 2300 | -s "error" \ |
| 2301 | -c "error" \ |
| 2302 | -c "Public key type mismatch" |
| 2303 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2304 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2305 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2306 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2307 | requires_config_enabled MBEDTLS_RSA_C |
| 2308 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2309 | requires_hash_alg SHA_256 |
| 2310 | 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] | 2311 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2312 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=ecdh,none \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2313 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2314 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2315 | 1 \ |
| 2316 | -s "key types: Opaque, none" \ |
| 2317 | -s "error" \ |
| 2318 | -c "error" \ |
| 2319 | -c "Public key type mismatch" |
| 2320 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2321 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2322 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2323 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2324 | requires_hash_alg SHA_256 |
| 2325 | 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] | 2326 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2327 | 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] | 2328 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2329 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2330 | 1 \ |
| 2331 | -s "key types: Opaque, none" \ |
| 2332 | -s "got ciphersuites in common, but none of them usable" \ |
| 2333 | -s "error" \ |
| 2334 | -c "error" |
| 2335 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2336 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2337 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2338 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2339 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2340 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2341 | 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] | 2342 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2343 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2344 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2345 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2346 | 1 \ |
| 2347 | -s "key types: Opaque, none" \ |
| 2348 | -s "got ciphersuites in common, but none of them usable" \ |
| 2349 | -s "error" \ |
| 2350 | -c "error" |
| 2351 | |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2352 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2353 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2354 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2355 | 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] | 2356 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2357 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2358 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2359 | "$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] | 2360 | 1 \ |
| 2361 | -s "key types: Opaque, none" \ |
| 2362 | -s "got ciphersuites in common, but none of them usable" \ |
| 2363 | -s "error" \ |
| 2364 | -c "error" |
| 2365 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2366 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2367 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2368 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2369 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2370 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2371 | 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] | 2372 | "$P_SRV force_version=tls12 key_opaque=1 crt_file=$DATA_FILES_PATH/server7.crt \ |
| 2373 | key_file=$DATA_FILES_PATH/server7.key key_opaque_algs=ecdh,none \ |
| 2374 | 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] | 2375 | key_opaque_algs2=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2376 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2377 | 0 \ |
| 2378 | -c "Verifying peer X.509 certificate... ok" \ |
| 2379 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2380 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2381 | -s "key types: Opaque, Opaque" \ |
| 2382 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2383 | -S "error" \ |
| 2384 | -C "error" |
| 2385 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2386 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2387 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2388 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2389 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2390 | 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] | 2391 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server7.crt \ |
| 2392 | key_file=$DATA_FILES_PATH/server7.key key_opaque_algs=ecdsa-sign,none \ |
| 2393 | 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] | 2394 | key_opaque_algs2=ecdh,none debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2395 | "$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] | 2396 | 0 \ |
| 2397 | -c "Verifying peer X.509 certificate... ok" \ |
| 2398 | -c "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2399 | -c "CN=Polarssl Test EC CA" \ |
| 2400 | -s "key types: Opaque, Opaque" \ |
| 2401 | -s "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2402 | -S "error" \ |
| 2403 | -C "error" |
| 2404 | |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2405 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2406 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2407 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2408 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2409 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2410 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2411 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2412 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2413 | 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] | 2414 | "$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] | 2415 | 0 \ |
| 2416 | -c "Verifying peer X.509 certificate... ok" \ |
| 2417 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2418 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2419 | -s "key types: Opaque, Opaque" \ |
| 2420 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2421 | -S "error" \ |
| 2422 | -C "error" |
| 2423 | |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2424 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2425 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2426 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2427 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2428 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2429 | run_test "TLS 1.3 opaque key: no suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2430 | "$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] | 2431 | "$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] | 2432 | 1 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2433 | -c "key type: Opaque" \ |
| 2434 | -s "key types: Opaque, Opaque" \ |
| 2435 | -c "error" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 2436 | -s "no suitable signature algorithm" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2437 | |
| 2438 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2439 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2440 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2441 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2442 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2443 | run_test "TLS 1.3 opaque key: suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2444 | "$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] | 2445 | "$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] | 2446 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2447 | -c "key type: Opaque" \ |
| 2448 | -s "key types: Opaque, Opaque" \ |
| 2449 | -C "error" \ |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2450 | -S "error" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2451 | |
| 2452 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2453 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2454 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2455 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2456 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2457 | 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] | 2458 | "$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] | 2459 | "$P_CLI debug_level=4 sig_algs=rsa_pss_rsae_sha256,rsa_pss_rsae_sha512" \ |
| 2460 | 0 \ |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2461 | -s "key types: Opaque, Opaque" \ |
| 2462 | -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \ |
| 2463 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 2464 | -C "error" \ |
| 2465 | -S "error" \ |
| 2466 | |
| 2467 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2468 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2469 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2470 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2471 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2472 | 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] | 2473 | "$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] | 2474 | "$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] | 2475 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2476 | -c "key type: Opaque" \ |
| 2477 | -s "key types: Opaque, Opaque" \ |
| 2478 | -C "error" \ |
| 2479 | -S "error" \ |
| 2480 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2481 | # Test using a RSA opaque private key for server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2482 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2483 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2484 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2485 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2486 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2487 | run_test "Opaque key for server authentication: ECDHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2488 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2489 | 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] | 2490 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2491 | 0 \ |
| 2492 | -c "Verifying peer X.509 certificate... ok" \ |
| 2493 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2494 | -s "key types: Opaque, none" \ |
| 2495 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2496 | -S "error" \ |
| 2497 | -C "error" |
| 2498 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2499 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2500 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2501 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2502 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2503 | run_test "Opaque key for server authentication: DHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2504 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2505 | 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] | 2506 | "$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] | 2507 | 0 \ |
| 2508 | -c "Verifying peer X.509 certificate... ok" \ |
| 2509 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2510 | -s "key types: Opaque, none" \ |
| 2511 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2512 | -S "error" \ |
| 2513 | -C "error" |
| 2514 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2515 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2516 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2517 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2518 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2519 | run_test "Opaque key for server authentication: RSA-PSK" \ |
| 2520 | "$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] | 2521 | psk=73776f726466697368 psk_identity=foo" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2522 | "$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] | 2523 | psk=73776f726466697368 psk_identity=foo" \ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2524 | 0 \ |
| 2525 | -c "Verifying peer X.509 certificate... ok" \ |
| 2526 | -c "Ciphersuite is TLS-RSA-PSK-" \ |
| 2527 | -s "key types: Opaque, Opaque" \ |
| 2528 | -s "Ciphersuite is TLS-RSA-PSK-" \ |
| 2529 | -S "error" \ |
| 2530 | -C "error" |
| 2531 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2532 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2533 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2534 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2535 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2536 | run_test "Opaque key for server authentication: RSA-" \ |
| 2537 | "$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] | 2538 | "$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] | 2539 | 0 \ |
| 2540 | -c "Verifying peer X.509 certificate... ok" \ |
| 2541 | -c "Ciphersuite is TLS-RSA-" \ |
| 2542 | -s "key types: Opaque, Opaque" \ |
| 2543 | -s "Ciphersuite is TLS-RSA-" \ |
| 2544 | -S "error" \ |
| 2545 | -C "error" |
| 2546 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2547 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2548 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2549 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2550 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2551 | 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] | 2552 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2553 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ |
| 2554 | "$P_CLI crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2555 | 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] | 2556 | 1 \ |
| 2557 | -s "key types: Opaque, none" \ |
| 2558 | -s "got ciphersuites in common, but none of them usable" \ |
| 2559 | -s "error" \ |
| 2560 | -c "error" |
| 2561 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2562 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2563 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2564 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2565 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2566 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2567 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2568 | run_test "Opaque keys for server authentication: RSA keys with different algs" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2569 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2570 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pss,none \ |
| 2571 | crt_file2=$DATA_FILES_PATH/server4.crt \ |
| 2572 | 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] | 2573 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2574 | 0 \ |
| 2575 | -c "Verifying peer X.509 certificate... ok" \ |
| 2576 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2577 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2578 | -s "key types: Opaque, Opaque" \ |
| 2579 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2580 | -S "error" \ |
| 2581 | -C "error" |
| 2582 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2583 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2584 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2585 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2586 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2587 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2588 | run_test "Opaque keys for server authentication: EC + RSA, force DHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2589 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2590 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2591 | crt_file2=$DATA_FILES_PATH/server4.crt \ |
| 2592 | 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] | 2593 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2594 | 0 \ |
| 2595 | -c "Verifying peer X.509 certificate... ok" \ |
| 2596 | -c "Ciphersuite is TLS-DHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2597 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2598 | -s "key types: Opaque, Opaque" \ |
| 2599 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2600 | -S "error" \ |
| 2601 | -C "error" |
| 2602 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2603 | # Test using an EC opaque private key for client/server authentication |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2604 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2605 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2606 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2607 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2608 | run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2609 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2610 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none" \ |
| 2611 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2612 | 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] | 2613 | 0 \ |
| 2614 | -c "key type: Opaque" \ |
| 2615 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2616 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2617 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2618 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2619 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2620 | -S "error" \ |
| 2621 | -C "error" |
| 2622 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2623 | # Test using a RSA opaque private key for client/server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2624 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2625 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2626 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2627 | requires_hash_alg SHA_256 |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2628 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2629 | run_test "Opaque key for client/server authentication: ECDHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2630 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2631 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
| 2632 | "$P_CLI force_version=tls12 key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2633 | 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] | 2634 | 0 \ |
| 2635 | -c "key type: Opaque" \ |
| 2636 | -c "Verifying peer X.509 certificate... ok" \ |
| 2637 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2638 | -s "key types: Opaque, none" \ |
| 2639 | -s "Verifying peer X.509 certificate... ok" \ |
| 2640 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2641 | -S "error" \ |
| 2642 | -C "error" |
| 2643 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2644 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2645 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2646 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2647 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2648 | run_test "Opaque key for client/server authentication: DHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2649 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2650 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
| 2651 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2652 | 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] | 2653 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2654 | 0 \ |
| 2655 | -c "key type: Opaque" \ |
| 2656 | -c "Verifying peer X.509 certificate... ok" \ |
| 2657 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2658 | -s "key types: Opaque, none" \ |
| 2659 | -s "Verifying peer X.509 certificate... ok" \ |
| 2660 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2661 | -S "error" \ |
| 2662 | -C "error" |
| 2663 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2664 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2665 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 2666 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 2667 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 2668 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 2669 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 2670 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 2671 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 2672 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 2673 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 2674 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 2675 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 2676 | |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2677 | requires_config_enabled PSA_WANT_ECC_SECP_R1_521 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2678 | run_test_psa_force_curve "secp521r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2679 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_512 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2680 | run_test_psa_force_curve "brainpoolP512r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2681 | requires_config_enabled PSA_WANT_ECC_SECP_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2682 | run_test_psa_force_curve "secp384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2683 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2684 | run_test_psa_force_curve "brainpoolP384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2685 | requires_config_enabled PSA_WANT_ECC_SECP_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2686 | run_test_psa_force_curve "secp256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2687 | requires_config_enabled PSA_WANT_ECC_SECP_K1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2688 | run_test_psa_force_curve "secp256k1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2689 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2690 | run_test_psa_force_curve "brainpoolP256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2691 | requires_config_enabled PSA_WANT_ECC_SECP_R1_224 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2692 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2693 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 2694 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2695 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 2696 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 2697 | ## 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] | 2698 | #requires_config_enabled PSA_WANT_ECC_SECP_K1_224 |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2699 | #run_test_psa_force_curve "secp224k1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2700 | requires_config_enabled PSA_WANT_ECC_SECP_R1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2701 | run_test_psa_force_curve "secp192r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2702 | requires_config_enabled PSA_WANT_ECC_SECP_K1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2703 | run_test_psa_force_curve "secp192k1" |
| 2704 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2705 | # Test current time in ServerHello |
| 2706 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 2707 | run_test "ServerHello contains gmt_unix_time" \ |
| 2708 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2709 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2710 | 0 \ |
| 2711 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2712 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2713 | |
| 2714 | # Test for uniqueness of IVs in AEAD ciphersuites |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2715 | run_test "Unique IV in GCM" \ |
| 2716 | "$P_SRV exchanges=20 debug_level=4" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 2717 | "$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] | 2718 | 0 \ |
| 2719 | -u "IV used" \ |
| 2720 | -U "IV used" |
| 2721 | |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2722 | # Test for correctness of sent single supported algorithm |
Valerio Setti | 482a0b9 | 2023-08-18 15:55:10 +0200 | [diff] [blame] | 2723 | requires_any_configs_enabled "MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2724 | PSA_WANT_ECC_SECP_R1_256" |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2725 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2726 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Paul Elliott | 3b4ceda | 2022-11-17 12:47:10 +0000 | [diff] [blame] | 2727 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2728 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 2729 | requires_pk_alg "ECDSA" |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2730 | requires_hash_alg SHA_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2731 | run_test "Single supported algorithm sending: mbedtls client" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2732 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2733 | "$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] | 2734 | 0 \ |
| 2735 | -c "Supported Signature Algorithm found: 04 03" |
| 2736 | |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2737 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2738 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Valerio Setti | 482a0b9 | 2023-08-18 15:55:10 +0200 | [diff] [blame] | 2739 | requires_any_configs_enabled "MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2740 | PSA_WANT_ECC_SECP_R1_256" |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2741 | requires_hash_alg SHA_256 |
| 2742 | run_test "Single supported algorithm sending: openssl client" \ |
| 2743 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2744 | "$O_CLI -cert $DATA_FILES_PATH/server6.crt \ |
| 2745 | -key $DATA_FILES_PATH/server6.key" \ |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2746 | 0 |
| 2747 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2748 | # Tests for certificate verification callback |
Manuel Pégourié-Gonnard | ff28e4c | 2024-08-16 12:57:34 +0200 | [diff] [blame] | 2749 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2750 | run_test "Configuration-specific CRT verification callback" \ |
| 2751 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | dee6ffa | 2024-08-16 09:53:41 +0200 | [diff] [blame] | 2752 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2753 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2754 | -S "error" \ |
| 2755 | -c "Verify requested for " \ |
| 2756 | -c "Use configuration-specific verification callback" \ |
| 2757 | -C "Use context-specific verification callback" \ |
| 2758 | -C "error" |
| 2759 | |
Manuel Pégourié-Gonnard | ff28e4c | 2024-08-16 12:57:34 +0200 | [diff] [blame] | 2760 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2761 | run_test "Context-specific CRT verification callback" \ |
| 2762 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | dee6ffa | 2024-08-16 09:53:41 +0200 | [diff] [blame] | 2763 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2764 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2765 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2766 | -c "Verify requested for " \ |
| 2767 | -c "Use context-specific verification callback" \ |
| 2768 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2769 | -C "error" |
| 2770 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2771 | # Tests for SHA-1 support |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2772 | requires_hash_alg SHA_1 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2773 | run_test "SHA-1 forbidden by default in server certificate" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2774 | "$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] | 2775 | "$P_CLI debug_level=2 force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2776 | 1 \ |
| 2777 | -c "The certificate is signed with an unacceptable hash" |
| 2778 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2779 | requires_hash_alg SHA_1 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2780 | run_test "SHA-1 explicitly allowed in server certificate" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2781 | "$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] | 2782 | "$P_CLI force_version=tls12 allow_sha1=1" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2783 | 0 |
| 2784 | |
| 2785 | run_test "SHA-256 allowed by default in server certificate" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2786 | "$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] | 2787 | "$P_CLI force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2788 | 0 |
| 2789 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2790 | requires_hash_alg SHA_1 |
| 2791 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2792 | run_test "SHA-1 forbidden by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2793 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2794 | "$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] | 2795 | 1 \ |
| 2796 | -s "The certificate is signed with an unacceptable hash" |
| 2797 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2798 | requires_hash_alg SHA_1 |
| 2799 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2800 | run_test "SHA-1 explicitly allowed in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2801 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=1" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2802 | "$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] | 2803 | 0 |
| 2804 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2805 | requires_config_enabled MBEDTLS_RSA_C |
| 2806 | requires_hash_alg SHA_256 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2807 | run_test "SHA-256 allowed by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2808 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2809 | "$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] | 2810 | 0 |
| 2811 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2812 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2813 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2814 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2815 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2816 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2817 | 0 \ |
| 2818 | -c "next record in same datagram" \ |
| 2819 | -s "next record in same datagram" |
| 2820 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2821 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2822 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2823 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2824 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2825 | 0 \ |
| 2826 | -s "next record in same datagram" \ |
| 2827 | -C "next record in same datagram" |
| 2828 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2829 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2830 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2831 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2832 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2833 | 0 \ |
| 2834 | -S "next record in same datagram" \ |
| 2835 | -c "next record in same datagram" |
| 2836 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2837 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2838 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2839 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2840 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2841 | 0 \ |
| 2842 | -S "next record in same datagram" \ |
| 2843 | -C "next record in same datagram" |
| 2844 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2845 | # Tests for Context serialization |
| 2846 | |
| 2847 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2848 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2849 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2850 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2851 | 0 \ |
| 2852 | -c "Deserializing connection..." \ |
| 2853 | -S "Deserializing connection..." |
| 2854 | |
| 2855 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2856 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2857 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2858 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2859 | 0 \ |
| 2860 | -c "Deserializing connection..." \ |
| 2861 | -S "Deserializing connection..." |
| 2862 | |
| 2863 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2864 | run_test "Context serialization, client serializes, GCM" \ |
| 2865 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2866 | "$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] | 2867 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2868 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2869 | -S "Deserializing connection..." |
| 2870 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2871 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2872 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2873 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2874 | run_test "Context serialization, client serializes, with CID" \ |
| 2875 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2876 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2877 | 0 \ |
| 2878 | -c "Deserializing connection..." \ |
| 2879 | -S "Deserializing connection..." |
| 2880 | |
| 2881 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2882 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2883 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2884 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2885 | 0 \ |
| 2886 | -C "Deserializing connection..." \ |
| 2887 | -s "Deserializing connection..." |
| 2888 | |
| 2889 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2890 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2891 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2892 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2893 | 0 \ |
| 2894 | -C "Deserializing connection..." \ |
| 2895 | -s "Deserializing connection..." |
| 2896 | |
| 2897 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2898 | run_test "Context serialization, server serializes, GCM" \ |
| 2899 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2900 | "$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] | 2901 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2902 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2903 | -s "Deserializing connection..." |
| 2904 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2905 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2906 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2907 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2908 | run_test "Context serialization, server serializes, with CID" \ |
| 2909 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2910 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2911 | 0 \ |
| 2912 | -C "Deserializing connection..." \ |
| 2913 | -s "Deserializing connection..." |
| 2914 | |
| 2915 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2916 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2917 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2918 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2919 | 0 \ |
| 2920 | -c "Deserializing connection..." \ |
| 2921 | -s "Deserializing connection..." |
| 2922 | |
| 2923 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2924 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2925 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2926 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2927 | 0 \ |
| 2928 | -c "Deserializing connection..." \ |
| 2929 | -s "Deserializing connection..." |
| 2930 | |
| 2931 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2932 | run_test "Context serialization, both serialize, GCM" \ |
| 2933 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2934 | "$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] | 2935 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2936 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2937 | -s "Deserializing connection..." |
| 2938 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2939 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2940 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2941 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2942 | run_test "Context serialization, both serialize, with CID" \ |
| 2943 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2944 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2945 | 0 \ |
| 2946 | -c "Deserializing connection..." \ |
| 2947 | -s "Deserializing connection..." |
| 2948 | |
| 2949 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2950 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2951 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2952 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2953 | 0 \ |
| 2954 | -c "Deserializing connection..." \ |
| 2955 | -S "Deserializing connection..." |
| 2956 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2957 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2958 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2959 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2960 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2961 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 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, client serializes, GCM" \ |
| 2968 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2969 | "$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] | 2970 | 0 \ |
| 2971 | -c "Deserializing connection..." \ |
| 2972 | -S "Deserializing connection..." |
| 2973 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2974 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2975 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2976 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2977 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2978 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2979 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2980 | 0 \ |
| 2981 | -c "Deserializing connection..." \ |
| 2982 | -S "Deserializing connection..." |
| 2983 | |
| 2984 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2985 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2986 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2987 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2988 | 0 \ |
| 2989 | -C "Deserializing connection..." \ |
| 2990 | -s "Deserializing connection..." |
| 2991 | |
| 2992 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2993 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2994 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2995 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 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, server serializes, GCM" \ |
| 3002 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3003 | "$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] | 3004 | 0 \ |
| 3005 | -C "Deserializing connection..." \ |
| 3006 | -s "Deserializing connection..." |
| 3007 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3008 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 3009 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 3010 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3011 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 3012 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 3013 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 3014 | 0 \ |
| 3015 | -C "Deserializing connection..." \ |
| 3016 | -s "Deserializing connection..." |
| 3017 | |
| 3018 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3019 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 3020 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3021 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3022 | 0 \ |
| 3023 | -c "Deserializing connection..." \ |
| 3024 | -s "Deserializing connection..." |
| 3025 | |
| 3026 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3027 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 3028 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3029 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 3030 | 0 \ |
| 3031 | -c "Deserializing connection..." \ |
| 3032 | -s "Deserializing connection..." |
| 3033 | |
| 3034 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3035 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 3036 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3037 | "$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] | 3038 | 0 \ |
| 3039 | -c "Deserializing connection..." \ |
| 3040 | -s "Deserializing connection..." |
| 3041 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3042 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 3043 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3044 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3045 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 3046 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 3047 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 3048 | 0 \ |
| 3049 | -c "Deserializing connection..." \ |
| 3050 | -s "Deserializing connection..." |
| 3051 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3052 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 3053 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3054 | run_test "Saving the serialized context to a file" \ |
| 3055 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 3056 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 3057 | 0 \ |
| 3058 | -s "Save serialized context to a file... ok" \ |
| 3059 | -c "Save serialized context to a file... ok" |
| 3060 | rm -f context_srv.txt |
| 3061 | rm -f context_cli.txt |
| 3062 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3063 | # Tests for DTLS Connection ID extension |
| 3064 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3065 | # So far, the CID API isn't implemented, so we can't |
| 3066 | # grep for output witnessing its use. This needs to be |
| 3067 | # changed once the CID extension is implemented. |
| 3068 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3069 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3070 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3071 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3072 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 3073 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3074 | 0 \ |
| 3075 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3076 | -s "found CID extension" \ |
| 3077 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3078 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3079 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3080 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3081 | -C "found CID extension" \ |
| 3082 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3083 | -C "Copy CIDs into SSL transform" \ |
| 3084 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3085 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3086 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3087 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3088 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3089 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3090 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 3091 | 0 \ |
| 3092 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3093 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3094 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3095 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3096 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3097 | -C "found CID extension" \ |
| 3098 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3099 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 3100 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3101 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3102 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3103 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3104 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3105 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3106 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 3107 | 0 \ |
| 3108 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3109 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3110 | -c "client hello, adding CID extension" \ |
| 3111 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3112 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3113 | -s "server hello, adding CID extension" \ |
| 3114 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3115 | -c "Use of CID extension negotiated" \ |
| 3116 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3117 | -c "Copy CIDs into SSL transform" \ |
| 3118 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3119 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3120 | -s "Use of Connection ID has been negotiated" \ |
| 3121 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3122 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3123 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3124 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3125 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3126 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3127 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 3128 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 3129 | 0 \ |
| 3130 | -c "Enable use of CID extension." \ |
| 3131 | -s "Enable use of CID extension." \ |
| 3132 | -c "client hello, adding CID extension" \ |
| 3133 | -s "found CID extension" \ |
| 3134 | -s "Use of CID extension negotiated" \ |
| 3135 | -s "server hello, adding CID extension" \ |
| 3136 | -c "found CID extension" \ |
| 3137 | -c "Use of CID extension negotiated" \ |
| 3138 | -s "Copy CIDs into SSL transform" \ |
| 3139 | -c "Copy CIDs into SSL transform" \ |
| 3140 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3141 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3142 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3143 | -c "Use of Connection ID has been negotiated" \ |
| 3144 | -c "ignoring unexpected CID" \ |
| 3145 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3146 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3147 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3148 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3149 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 3150 | -p "$P_PXY mtu=800" \ |
| 3151 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3152 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3153 | 0 \ |
| 3154 | -c "Enable use of CID extension." \ |
| 3155 | -s "Enable use of CID extension." \ |
| 3156 | -c "client hello, adding CID extension" \ |
| 3157 | -s "found CID extension" \ |
| 3158 | -s "Use of CID extension negotiated" \ |
| 3159 | -s "server hello, adding CID extension" \ |
| 3160 | -c "found CID extension" \ |
| 3161 | -c "Use of CID extension negotiated" \ |
| 3162 | -s "Copy CIDs into SSL transform" \ |
| 3163 | -c "Copy CIDs into SSL transform" \ |
| 3164 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3165 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3166 | -s "Use of Connection ID has been negotiated" \ |
| 3167 | -c "Use of Connection ID has been negotiated" |
| 3168 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3169 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3170 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3171 | 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] | 3172 | -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] | 3173 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3174 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3175 | 0 \ |
| 3176 | -c "Enable use of CID extension." \ |
| 3177 | -s "Enable use of CID extension." \ |
| 3178 | -c "client hello, adding CID extension" \ |
| 3179 | -s "found CID extension" \ |
| 3180 | -s "Use of CID extension negotiated" \ |
| 3181 | -s "server hello, adding CID extension" \ |
| 3182 | -c "found CID extension" \ |
| 3183 | -c "Use of CID extension negotiated" \ |
| 3184 | -s "Copy CIDs into SSL transform" \ |
| 3185 | -c "Copy CIDs into SSL transform" \ |
| 3186 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3187 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3188 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3189 | -c "Use of Connection ID has been negotiated" \ |
| 3190 | -c "ignoring unexpected CID" \ |
| 3191 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3192 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3193 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3194 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3195 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3196 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3197 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3198 | 0 \ |
| 3199 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3200 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3201 | -c "client hello, adding CID extension" \ |
| 3202 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3203 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3204 | -s "server hello, adding CID extension" \ |
| 3205 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3206 | -c "Use of CID extension negotiated" \ |
| 3207 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3208 | -c "Copy CIDs into SSL transform" \ |
| 3209 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3210 | -s "Peer CID (length 0 Bytes):" \ |
| 3211 | -s "Use of Connection ID has been negotiated" \ |
| 3212 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3213 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3214 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3215 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3216 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3217 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3218 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3219 | 0 \ |
| 3220 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3221 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3222 | -c "client hello, adding CID extension" \ |
| 3223 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3224 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3225 | -s "server hello, adding CID extension" \ |
| 3226 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3227 | -c "Use of CID extension negotiated" \ |
| 3228 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3229 | -c "Copy CIDs into SSL transform" \ |
| 3230 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3231 | -c "Peer CID (length 0 Bytes):" \ |
| 3232 | -s "Use of Connection ID has been negotiated" \ |
| 3233 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3234 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3235 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3236 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3237 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3238 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3239 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3240 | 0 \ |
| 3241 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3242 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3243 | -c "client hello, adding CID extension" \ |
| 3244 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3245 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3246 | -s "server hello, adding CID extension" \ |
| 3247 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3248 | -c "Use of CID extension negotiated" \ |
| 3249 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3250 | -c "Copy CIDs into SSL transform" \ |
| 3251 | -S "Use of Connection ID has been negotiated" \ |
| 3252 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3253 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3254 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3255 | 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] | 3256 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3257 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3258 | 0 \ |
| 3259 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3260 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3261 | -c "client hello, adding CID extension" \ |
| 3262 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3263 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3264 | -s "server hello, adding CID extension" \ |
| 3265 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3266 | -c "Use of CID extension negotiated" \ |
| 3267 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3268 | -c "Copy CIDs into SSL transform" \ |
| 3269 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3270 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3271 | -s "Use of Connection ID has been negotiated" \ |
| 3272 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3273 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3274 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3275 | 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] | 3276 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3277 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3278 | 0 \ |
| 3279 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3280 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3281 | -c "client hello, adding CID extension" \ |
| 3282 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3283 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3284 | -s "server hello, adding CID extension" \ |
| 3285 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3286 | -c "Use of CID extension negotiated" \ |
| 3287 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3288 | -c "Copy CIDs into SSL transform" \ |
| 3289 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3290 | -s "Peer CID (length 0 Bytes):" \ |
| 3291 | -s "Use of Connection ID has been negotiated" \ |
| 3292 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3293 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3294 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3295 | 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] | 3296 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3297 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3298 | 0 \ |
| 3299 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3300 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3301 | -c "client hello, adding CID extension" \ |
| 3302 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3303 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3304 | -s "server hello, adding CID extension" \ |
| 3305 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3306 | -c "Use of CID extension negotiated" \ |
| 3307 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3308 | -c "Copy CIDs into SSL transform" \ |
| 3309 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3310 | -c "Peer CID (length 0 Bytes):" \ |
| 3311 | -s "Use of Connection ID has been negotiated" \ |
| 3312 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3313 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3314 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3315 | 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] | 3316 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3317 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3318 | 0 \ |
| 3319 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3320 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3321 | -c "client hello, adding CID extension" \ |
| 3322 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3323 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3324 | -s "server hello, adding CID extension" \ |
| 3325 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3326 | -c "Use of CID extension negotiated" \ |
| 3327 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3328 | -c "Copy CIDs into SSL transform" \ |
| 3329 | -S "Use of Connection ID has been negotiated" \ |
| 3330 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3331 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3332 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3333 | 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] | 3334 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3335 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3336 | 0 \ |
| 3337 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3338 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3339 | -c "client hello, adding CID extension" \ |
| 3340 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3341 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3342 | -s "server hello, adding CID extension" \ |
| 3343 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3344 | -c "Use of CID extension negotiated" \ |
| 3345 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3346 | -c "Copy CIDs into SSL transform" \ |
| 3347 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3348 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3349 | -s "Use of Connection ID has been negotiated" \ |
| 3350 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3351 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3352 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3353 | 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] | 3354 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3355 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3356 | 0 \ |
| 3357 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3358 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3359 | -c "client hello, adding CID extension" \ |
| 3360 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3361 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3362 | -s "server hello, adding CID extension" \ |
| 3363 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3364 | -c "Use of CID extension negotiated" \ |
| 3365 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3366 | -c "Copy CIDs into SSL transform" \ |
| 3367 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3368 | -s "Peer CID (length 0 Bytes):" \ |
| 3369 | -s "Use of Connection ID has been negotiated" \ |
| 3370 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3371 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3372 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3373 | 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] | 3374 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3375 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3376 | 0 \ |
| 3377 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3378 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3379 | -c "client hello, adding CID extension" \ |
| 3380 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3381 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3382 | -s "server hello, adding CID extension" \ |
| 3383 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3384 | -c "Use of CID extension negotiated" \ |
| 3385 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3386 | -c "Copy CIDs into SSL transform" \ |
| 3387 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3388 | -c "Peer CID (length 0 Bytes):" \ |
| 3389 | -s "Use of Connection ID has been negotiated" \ |
| 3390 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3391 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3392 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3393 | 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] | 3394 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3395 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3396 | 0 \ |
| 3397 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3398 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3399 | -c "client hello, adding CID extension" \ |
| 3400 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3401 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3402 | -s "server hello, adding CID extension" \ |
| 3403 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3404 | -c "Use of CID extension negotiated" \ |
| 3405 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3406 | -c "Copy CIDs into SSL transform" \ |
| 3407 | -S "Use of Connection ID has been negotiated" \ |
| 3408 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3409 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3410 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3411 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3412 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3413 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3414 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3415 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3416 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3417 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3418 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3419 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3420 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3421 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3422 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3423 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3424 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3425 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3426 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3427 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3428 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3429 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3430 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3431 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3432 | 0 \ |
| 3433 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3434 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3435 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3436 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3437 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3438 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3439 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3440 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3441 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3442 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3443 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3444 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3445 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 3446 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3447 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3448 | 0 \ |
| 3449 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3450 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3451 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3452 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3453 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3454 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3455 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3456 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3457 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3458 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3459 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3460 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3461 | 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] | 3462 | -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] | 3463 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3464 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3465 | 0 \ |
| 3466 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3467 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3468 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3469 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3470 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3471 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3472 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3473 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3474 | -c "ignoring unexpected CID" \ |
| 3475 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3476 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3477 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3478 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3479 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3480 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3481 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3482 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3483 | 0 \ |
| 3484 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3485 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3486 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3487 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3488 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3489 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3490 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3491 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3492 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3493 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3494 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3495 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3496 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 3497 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3498 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3499 | 0 \ |
| 3500 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3501 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3502 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3503 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3504 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3505 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3506 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3507 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3508 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3509 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3510 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3511 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3512 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3513 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3514 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3515 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3516 | 0 \ |
| 3517 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3518 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3519 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3520 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3521 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3522 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3523 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3524 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3525 | -c "ignoring unexpected CID" \ |
| 3526 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3527 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3528 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3529 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3530 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3531 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3532 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3533 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3534 | 0 \ |
| 3535 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3536 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3537 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3538 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3539 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3540 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3541 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3542 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3543 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3544 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3545 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 3546 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3547 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3548 | 0 \ |
| 3549 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3550 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3551 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3552 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3553 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3554 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3555 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3556 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3557 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3558 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3559 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3560 | -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] | 3561 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3562 | "$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" \ |
| 3563 | 0 \ |
| 3564 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3565 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3566 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3567 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3568 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3569 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3570 | -c "ignoring unexpected CID" \ |
| 3571 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3572 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3574 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3575 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3576 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3577 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3578 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3579 | 0 \ |
| 3580 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3581 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3582 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3583 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3584 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3585 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3586 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3587 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3588 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 3589 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3590 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3591 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3592 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3593 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3594 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3595 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3596 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3597 | 0 \ |
| 3598 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3599 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3600 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3601 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3602 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3603 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3604 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3605 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3606 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 3607 | -c "ignoring unexpected CID" \ |
| 3608 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3609 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3610 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3611 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3612 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3613 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 3614 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3615 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3616 | 0 \ |
| 3617 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3618 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3619 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3620 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3621 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3622 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3623 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3624 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3625 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 3626 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3627 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3628 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3629 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3630 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3631 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3632 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3633 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3634 | 0 \ |
| 3635 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3636 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3637 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3638 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3639 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3640 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3641 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3642 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3643 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 3644 | -c "ignoring unexpected CID" \ |
| 3645 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3646 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3647 | # 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] | 3648 | # tests check that the buffer contents are reallocated when the message is |
| 3649 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3650 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3651 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3652 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3653 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 3654 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3655 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 3656 | 0 \ |
| 3657 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3658 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3659 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3660 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3661 | -s "Reallocating in_buf" \ |
| 3662 | -s "Reallocating out_buf" |
| 3663 | |
| 3664 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3665 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3666 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3667 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 3668 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3669 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 3670 | 0 \ |
| 3671 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3672 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3673 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3674 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3675 | -s "Reallocating in_buf" \ |
| 3676 | -s "Reallocating out_buf" |
| 3677 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3678 | # Tests for Encrypt-then-MAC extension |
| 3679 | |
| 3680 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3681 | "$P_SRV debug_level=3 \ |
| 3682 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3683 | "$P_CLI debug_level=3" \ |
| 3684 | 0 \ |
| 3685 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3686 | -s "found encrypt then mac extension" \ |
| 3687 | -s "server hello, adding encrypt then mac extension" \ |
| 3688 | -c "found encrypt_then_mac extension" \ |
| 3689 | -c "using encrypt then mac" \ |
| 3690 | -s "using encrypt then mac" |
| 3691 | |
| 3692 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3693 | "$P_SRV debug_level=3 etm=0 \ |
| 3694 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3695 | "$P_CLI debug_level=3 etm=1" \ |
| 3696 | 0 \ |
| 3697 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3698 | -s "found encrypt then mac extension" \ |
| 3699 | -S "server hello, adding encrypt then mac extension" \ |
| 3700 | -C "found encrypt_then_mac extension" \ |
| 3701 | -C "using encrypt then mac" \ |
| 3702 | -S "using encrypt then mac" |
| 3703 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3704 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3705 | "$P_SRV debug_level=3 etm=1 \ |
| 3706 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3707 | "$P_CLI debug_level=3 etm=1" \ |
| 3708 | 0 \ |
| 3709 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3710 | -s "found encrypt then mac extension" \ |
| 3711 | -S "server hello, adding encrypt then mac extension" \ |
| 3712 | -C "found encrypt_then_mac extension" \ |
| 3713 | -C "using encrypt then mac" \ |
| 3714 | -S "using encrypt then mac" |
| 3715 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3716 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3717 | "$P_SRV debug_level=3 etm=1 \ |
| 3718 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3719 | "$P_CLI debug_level=3 etm=0" \ |
| 3720 | 0 \ |
| 3721 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3722 | -S "found encrypt then mac extension" \ |
| 3723 | -S "server hello, adding encrypt then mac extension" \ |
| 3724 | -C "found encrypt_then_mac extension" \ |
| 3725 | -C "using encrypt then mac" \ |
| 3726 | -S "using encrypt then mac" |
| 3727 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3728 | # Tests for Extended Master Secret extension |
| 3729 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3730 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3731 | run_test "Extended Master Secret: default" \ |
| 3732 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3733 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3734 | 0 \ |
| 3735 | -c "client hello, adding extended_master_secret extension" \ |
| 3736 | -s "found extended master secret extension" \ |
| 3737 | -s "server hello, adding extended master secret extension" \ |
| 3738 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3739 | -c "session hash for extended master secret" \ |
| 3740 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3741 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3742 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3743 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3744 | "$P_SRV debug_level=3 extended_ms=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3745 | "$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] | 3746 | 0 \ |
| 3747 | -c "client hello, adding extended_master_secret extension" \ |
| 3748 | -s "found extended master secret extension" \ |
| 3749 | -S "server hello, adding extended master secret extension" \ |
| 3750 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3751 | -C "session hash for extended master secret" \ |
| 3752 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3753 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3754 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3755 | run_test "Extended Master Secret: client disabled, server enabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3756 | "$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] | 3757 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3758 | 0 \ |
| 3759 | -C "client hello, adding extended_master_secret extension" \ |
| 3760 | -S "found extended master secret extension" \ |
| 3761 | -S "server hello, adding extended master secret extension" \ |
| 3762 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3763 | -C "session hash for extended master secret" \ |
| 3764 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3765 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3766 | # Test sending and receiving empty application data records |
| 3767 | |
| 3768 | run_test "Encrypt then MAC: empty application data record" \ |
| 3769 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3770 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3771 | 0 \ |
| 3772 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3773 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3774 | -c "0 bytes written in 1 fragments" |
| 3775 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3776 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3777 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3778 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3779 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3780 | 0 \ |
| 3781 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3782 | -c "0 bytes written in 1 fragments" |
| 3783 | |
| 3784 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3785 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3786 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3787 | 0 \ |
| 3788 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3789 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3790 | -c "0 bytes written in 1 fragments" |
| 3791 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3792 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3793 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3794 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3795 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3796 | 0 \ |
| 3797 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3798 | -c "0 bytes written in 1 fragments" |
| 3799 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3800 | # Tests for CBC 1/n-1 record splitting |
| 3801 | |
| 3802 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3803 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3804 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3805 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3806 | 0 \ |
| 3807 | -s "Read from client: 123 bytes read" \ |
| 3808 | -S "Read from client: 1 bytes read" \ |
| 3809 | -S "122 bytes read" |
| 3810 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3811 | # Tests for Session Tickets |
| 3812 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3813 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3814 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3815 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3816 | "$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] | 3817 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3818 | -c "client hello, adding session ticket extension" \ |
| 3819 | -s "found session ticket extension" \ |
| 3820 | -s "server hello, adding session ticket extension" \ |
| 3821 | -c "found session_ticket extension" \ |
| 3822 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3823 | -S "session successfully restored from cache" \ |
| 3824 | -s "session successfully restored from ticket" \ |
| 3825 | -s "a session has been resumed" \ |
| 3826 | -c "a session has been resumed" |
| 3827 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3828 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3829 | run_test "Session resume using tickets: manual rotation" \ |
| 3830 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3831 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3832 | 0 \ |
| 3833 | -c "client hello, adding session ticket extension" \ |
| 3834 | -s "found session ticket extension" \ |
| 3835 | -s "server hello, adding session ticket extension" \ |
| 3836 | -c "found session_ticket extension" \ |
| 3837 | -c "parse new session ticket" \ |
| 3838 | -S "session successfully restored from cache" \ |
| 3839 | -s "session successfully restored from ticket" \ |
| 3840 | -s "a session has been resumed" \ |
| 3841 | -c "a session has been resumed" |
| 3842 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3843 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3844 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3845 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3846 | "$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] | 3847 | 0 \ |
| 3848 | -c "client hello, adding session ticket extension" \ |
| 3849 | -s "found session ticket extension" \ |
| 3850 | -s "server hello, adding session ticket extension" \ |
| 3851 | -c "found session_ticket extension" \ |
| 3852 | -c "parse new session ticket" \ |
| 3853 | -S "session successfully restored from cache" \ |
| 3854 | -s "session successfully restored from ticket" \ |
| 3855 | -s "a session has been resumed" \ |
| 3856 | -c "a session has been resumed" |
| 3857 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3858 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3859 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3860 | "$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] | 3861 | "$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] | 3862 | 0 \ |
| 3863 | -c "client hello, adding session ticket extension" \ |
| 3864 | -s "found session ticket extension" \ |
| 3865 | -s "server hello, adding session ticket extension" \ |
| 3866 | -c "found session_ticket extension" \ |
| 3867 | -c "parse new session ticket" \ |
| 3868 | -S "session successfully restored from cache" \ |
| 3869 | -S "session successfully restored from ticket" \ |
| 3870 | -S "a session has been resumed" \ |
| 3871 | -C "a session has been resumed" |
| 3872 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3873 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3874 | run_test "Session resume using tickets: session copy" \ |
| 3875 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3876 | "$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] | 3877 | 0 \ |
| 3878 | -c "client hello, adding session ticket extension" \ |
| 3879 | -s "found session ticket extension" \ |
| 3880 | -s "server hello, adding session ticket extension" \ |
| 3881 | -c "found session_ticket extension" \ |
| 3882 | -c "parse new session ticket" \ |
| 3883 | -S "session successfully restored from cache" \ |
| 3884 | -s "session successfully restored from ticket" \ |
| 3885 | -s "a session has been resumed" \ |
| 3886 | -c "a session has been resumed" |
| 3887 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3888 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3889 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3890 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3891 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 3892 | "$P_CLI debug_level=3 tickets=1 new_session_tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3893 | 0 \ |
| 3894 | -c "client hello, adding session ticket extension" \ |
| 3895 | -c "found session_ticket extension" \ |
| 3896 | -c "parse new session ticket" \ |
| 3897 | -c "a session has been resumed" |
| 3898 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3899 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3900 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3901 | run_test "Session resume using tickets: openssl client" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 3902 | "$P_SRV force_version=tls12 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3903 | "( $O_CLI -sess_out $SESSION; \ |
| 3904 | $O_CLI -sess_in $SESSION; \ |
| 3905 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3906 | 0 \ |
| 3907 | -s "found session ticket extension" \ |
| 3908 | -s "server hello, adding session ticket extension" \ |
| 3909 | -S "session successfully restored from cache" \ |
| 3910 | -s "session successfully restored from ticket" \ |
| 3911 | -s "a session has been resumed" |
| 3912 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3913 | requires_cipher_enabled "AES" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3914 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3915 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3916 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3917 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3918 | 0 \ |
| 3919 | -c "client hello, adding session ticket extension" \ |
| 3920 | -s "found session ticket extension" \ |
| 3921 | -s "server hello, adding session ticket extension" \ |
| 3922 | -c "found session_ticket extension" \ |
| 3923 | -c "parse new session ticket" \ |
| 3924 | -S "session successfully restored from cache" \ |
| 3925 | -s "session successfully restored from ticket" \ |
| 3926 | -s "a session has been resumed" \ |
| 3927 | -c "a session has been resumed" |
| 3928 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3929 | requires_cipher_enabled "AES" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3930 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3931 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3932 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3933 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3934 | 0 \ |
| 3935 | -c "client hello, adding session ticket extension" \ |
| 3936 | -s "found session ticket extension" \ |
| 3937 | -s "server hello, adding session ticket extension" \ |
| 3938 | -c "found session_ticket extension" \ |
| 3939 | -c "parse new session ticket" \ |
| 3940 | -S "session successfully restored from cache" \ |
| 3941 | -s "session successfully restored from ticket" \ |
| 3942 | -s "a session has been resumed" \ |
| 3943 | -c "a session has been resumed" |
| 3944 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3945 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3946 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3947 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3948 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3949 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3950 | 0 \ |
| 3951 | -c "client hello, adding session ticket extension" \ |
| 3952 | -s "found session ticket extension" \ |
| 3953 | -s "server hello, adding session ticket extension" \ |
| 3954 | -c "found session_ticket extension" \ |
| 3955 | -c "parse new session ticket" \ |
| 3956 | -S "session successfully restored from cache" \ |
| 3957 | -s "session successfully restored from ticket" \ |
| 3958 | -s "a session has been resumed" \ |
| 3959 | -c "a session has been resumed" |
| 3960 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3961 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3962 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3963 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 3964 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3965 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3966 | 0 \ |
| 3967 | -c "client hello, adding session ticket extension" \ |
| 3968 | -s "found session ticket extension" \ |
| 3969 | -s "server hello, adding session ticket extension" \ |
| 3970 | -c "found session_ticket extension" \ |
| 3971 | -c "parse new session ticket" \ |
| 3972 | -S "session successfully restored from cache" \ |
| 3973 | -s "session successfully restored from ticket" \ |
| 3974 | -s "a session has been resumed" \ |
| 3975 | -c "a session has been resumed" |
| 3976 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3977 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3978 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3979 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 3980 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3981 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3982 | 0 \ |
| 3983 | -c "client hello, adding session ticket extension" \ |
| 3984 | -s "found session ticket extension" \ |
| 3985 | -s "server hello, adding session ticket extension" \ |
| 3986 | -c "found session_ticket extension" \ |
| 3987 | -c "parse new session ticket" \ |
| 3988 | -S "session successfully restored from cache" \ |
| 3989 | -s "session successfully restored from ticket" \ |
| 3990 | -s "a session has been resumed" \ |
| 3991 | -c "a session has been resumed" |
| 3992 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3993 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3994 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3995 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 3996 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3997 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3998 | 0 \ |
| 3999 | -c "client hello, adding session ticket extension" \ |
| 4000 | -s "found session ticket extension" \ |
| 4001 | -s "server hello, adding session ticket extension" \ |
| 4002 | -c "found session_ticket extension" \ |
| 4003 | -c "parse new session ticket" \ |
| 4004 | -S "session successfully restored from cache" \ |
| 4005 | -s "session successfully restored from ticket" \ |
| 4006 | -s "a session has been resumed" \ |
| 4007 | -c "a session has been resumed" |
| 4008 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4009 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4010 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4011 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 4012 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4013 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4014 | 0 \ |
| 4015 | -c "client hello, adding session ticket extension" \ |
| 4016 | -s "found session ticket extension" \ |
| 4017 | -s "server hello, adding session ticket extension" \ |
| 4018 | -c "found session_ticket extension" \ |
| 4019 | -c "parse new session ticket" \ |
| 4020 | -S "session successfully restored from cache" \ |
| 4021 | -s "session successfully restored from ticket" \ |
| 4022 | -s "a session has been resumed" \ |
| 4023 | -c "a session has been resumed" |
| 4024 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4025 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4026 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4027 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 4028 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4029 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4030 | 0 \ |
| 4031 | -c "client hello, adding session ticket extension" \ |
| 4032 | -s "found session ticket extension" \ |
| 4033 | -s "server hello, adding session ticket extension" \ |
| 4034 | -c "found session_ticket extension" \ |
| 4035 | -c "parse new session ticket" \ |
| 4036 | -S "session successfully restored from cache" \ |
| 4037 | -s "session successfully restored from ticket" \ |
| 4038 | -s "a session has been resumed" \ |
| 4039 | -c "a session has been resumed" |
| 4040 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4041 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4042 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4043 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 4044 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4045 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4046 | 0 \ |
| 4047 | -c "client hello, adding session ticket extension" \ |
| 4048 | -s "found session ticket extension" \ |
| 4049 | -s "server hello, adding session ticket extension" \ |
| 4050 | -c "found session_ticket extension" \ |
| 4051 | -c "parse new session ticket" \ |
| 4052 | -S "session successfully restored from cache" \ |
| 4053 | -s "session successfully restored from ticket" \ |
| 4054 | -s "a session has been resumed" \ |
| 4055 | -c "a session has been resumed" |
| 4056 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4057 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4058 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4059 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 4060 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4061 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4062 | 0 \ |
| 4063 | -c "client hello, adding session ticket extension" \ |
| 4064 | -s "found session ticket extension" \ |
| 4065 | -s "server hello, adding session ticket extension" \ |
| 4066 | -c "found session_ticket extension" \ |
| 4067 | -c "parse new session ticket" \ |
| 4068 | -S "session successfully restored from cache" \ |
| 4069 | -s "session successfully restored from ticket" \ |
| 4070 | -s "a session has been resumed" \ |
| 4071 | -c "a session has been resumed" |
| 4072 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4073 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4074 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4075 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 4076 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4077 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4078 | 0 \ |
| 4079 | -c "client hello, adding session ticket extension" \ |
| 4080 | -s "found session ticket extension" \ |
| 4081 | -s "server hello, adding session ticket extension" \ |
| 4082 | -c "found session_ticket extension" \ |
| 4083 | -c "parse new session ticket" \ |
| 4084 | -S "session successfully restored from cache" \ |
| 4085 | -s "session successfully restored from ticket" \ |
| 4086 | -s "a session has been resumed" \ |
| 4087 | -c "a session has been resumed" |
| 4088 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4089 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4090 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4091 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 4092 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4093 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4094 | 0 \ |
| 4095 | -c "client hello, adding session ticket extension" \ |
| 4096 | -s "found session ticket extension" \ |
| 4097 | -s "server hello, adding session ticket extension" \ |
| 4098 | -c "found session_ticket extension" \ |
| 4099 | -c "parse new session ticket" \ |
| 4100 | -S "session successfully restored from cache" \ |
| 4101 | -s "session successfully restored from ticket" \ |
| 4102 | -s "a session has been resumed" \ |
| 4103 | -c "a session has been resumed" |
| 4104 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4105 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4106 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4107 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 4108 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4109 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4110 | 0 \ |
| 4111 | -c "client hello, adding session ticket extension" \ |
| 4112 | -s "found session ticket extension" \ |
| 4113 | -s "server hello, adding session ticket extension" \ |
| 4114 | -c "found session_ticket extension" \ |
| 4115 | -c "parse new session ticket" \ |
| 4116 | -S "session successfully restored from cache" \ |
| 4117 | -s "session successfully restored from ticket" \ |
| 4118 | -s "a session has been resumed" \ |
| 4119 | -c "a session has been resumed" |
| 4120 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4121 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4122 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4123 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 4124 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4125 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4126 | 0 \ |
| 4127 | -c "client hello, adding session ticket extension" \ |
| 4128 | -s "found session ticket extension" \ |
| 4129 | -s "server hello, adding session ticket extension" \ |
| 4130 | -c "found session_ticket extension" \ |
| 4131 | -c "parse new session ticket" \ |
| 4132 | -S "session successfully restored from cache" \ |
| 4133 | -s "session successfully restored from ticket" \ |
| 4134 | -s "a session has been resumed" \ |
| 4135 | -c "a session has been resumed" |
| 4136 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4137 | requires_cipher_enabled "CHACHA20" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4138 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4139 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 4140 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4141 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4142 | 0 \ |
| 4143 | -c "client hello, adding session ticket extension" \ |
| 4144 | -s "found session ticket extension" \ |
| 4145 | -s "server hello, adding session ticket extension" \ |
| 4146 | -c "found session_ticket extension" \ |
| 4147 | -c "parse new session ticket" \ |
| 4148 | -S "session successfully restored from cache" \ |
| 4149 | -s "session successfully restored from ticket" \ |
| 4150 | -s "a session has been resumed" \ |
| 4151 | -c "a session has been resumed" |
| 4152 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4153 | # Tests for Session Tickets with DTLS |
| 4154 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4155 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4156 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4157 | run_test "Session resume using tickets, DTLS: basic" \ |
| 4158 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4159 | "$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] | 4160 | 0 \ |
| 4161 | -c "client hello, adding session ticket extension" \ |
| 4162 | -s "found session ticket extension" \ |
| 4163 | -s "server hello, adding session ticket extension" \ |
| 4164 | -c "found session_ticket extension" \ |
| 4165 | -c "parse new session ticket" \ |
| 4166 | -S "session successfully restored from cache" \ |
| 4167 | -s "session successfully restored from ticket" \ |
| 4168 | -s "a session has been resumed" \ |
| 4169 | -c "a session has been resumed" |
| 4170 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4171 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4172 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4173 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 4174 | "$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] | 4175 | "$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] | 4176 | 0 \ |
| 4177 | -c "client hello, adding session ticket extension" \ |
| 4178 | -s "found session ticket extension" \ |
| 4179 | -s "server hello, adding session ticket extension" \ |
| 4180 | -c "found session_ticket extension" \ |
| 4181 | -c "parse new session ticket" \ |
| 4182 | -S "session successfully restored from cache" \ |
| 4183 | -s "session successfully restored from ticket" \ |
| 4184 | -s "a session has been resumed" \ |
| 4185 | -c "a session has been resumed" |
| 4186 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4187 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4188 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4189 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 4190 | "$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] | 4191 | "$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] | 4192 | 0 \ |
| 4193 | -c "client hello, adding session ticket extension" \ |
| 4194 | -s "found session ticket extension" \ |
| 4195 | -s "server hello, adding session ticket extension" \ |
| 4196 | -c "found session_ticket extension" \ |
| 4197 | -c "parse new session ticket" \ |
| 4198 | -S "session successfully restored from cache" \ |
| 4199 | -S "session successfully restored from ticket" \ |
| 4200 | -S "a session has been resumed" \ |
| 4201 | -C "a session has been resumed" |
| 4202 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4203 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4204 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4205 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 4206 | "$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] | 4207 | "$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] | 4208 | 0 \ |
| 4209 | -c "client hello, adding session ticket extension" \ |
| 4210 | -s "found session ticket extension" \ |
| 4211 | -s "server hello, adding session ticket extension" \ |
| 4212 | -c "found session_ticket extension" \ |
| 4213 | -c "parse new session ticket" \ |
| 4214 | -S "session successfully restored from cache" \ |
| 4215 | -s "session successfully restored from ticket" \ |
| 4216 | -s "a session has been resumed" \ |
| 4217 | -c "a session has been resumed" |
| 4218 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4219 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4220 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4221 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 4222 | "$O_SRV -dtls" \ |
| 4223 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 4224 | 0 \ |
| 4225 | -c "client hello, adding session ticket extension" \ |
| 4226 | -c "found session_ticket extension" \ |
| 4227 | -c "parse new session ticket" \ |
| 4228 | -c "a session has been resumed" |
| 4229 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4230 | # 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] | 4231 | # 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] | 4232 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4233 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4234 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4235 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 4236 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4237 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4238 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4239 | rm -f $SESSION )" \ |
| 4240 | 0 \ |
| 4241 | -s "found session ticket extension" \ |
| 4242 | -s "server hello, adding session ticket extension" \ |
| 4243 | -S "session successfully restored from cache" \ |
| 4244 | -s "session successfully restored from ticket" \ |
| 4245 | -s "a session has been resumed" |
| 4246 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4247 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4248 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4249 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4250 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4251 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4252 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4253 | "$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] | 4254 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4255 | -c "client hello, adding session ticket extension" \ |
| 4256 | -s "found session ticket extension" \ |
| 4257 | -S "server hello, adding session ticket extension" \ |
| 4258 | -C "found session_ticket extension" \ |
| 4259 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4260 | -s "session successfully restored from cache" \ |
| 4261 | -S "session successfully restored from ticket" \ |
| 4262 | -s "a session has been resumed" \ |
| 4263 | -c "a session has been resumed" |
| 4264 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4265 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4266 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4267 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4268 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4269 | "$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] | 4270 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4271 | -C "client hello, adding session ticket extension" \ |
| 4272 | -S "found session ticket extension" \ |
| 4273 | -S "server hello, adding session ticket extension" \ |
| 4274 | -C "found session_ticket extension" \ |
| 4275 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4276 | -s "session successfully restored from cache" \ |
| 4277 | -S "session successfully restored from ticket" \ |
| 4278 | -s "a session has been resumed" \ |
| 4279 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4280 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4281 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4282 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4283 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4284 | "$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] | 4285 | 0 \ |
| 4286 | -S "session successfully restored from cache" \ |
| 4287 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4288 | -S "a session has been resumed" \ |
| 4289 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4290 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4291 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4292 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4293 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
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" \ |
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 |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4302 | run_test "Session resume using cache: cache removed" \ |
| 4303 | "$P_SRV debug_level=3 tickets=0 cache_remove=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" \ |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4305 | 0 \ |
| 4306 | -C "client hello, adding session ticket extension" \ |
| 4307 | -S "found session ticket extension" \ |
| 4308 | -S "server hello, adding session ticket extension" \ |
| 4309 | -C "found session_ticket extension" \ |
| 4310 | -C "parse new session ticket" \ |
| 4311 | -S "session successfully restored from cache" \ |
| 4312 | -S "session successfully restored from ticket" \ |
| 4313 | -S "a session has been resumed" \ |
| 4314 | -C "a session has been resumed" |
| 4315 | |
| 4316 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4317 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 4318 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4319 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4320 | "$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] | 4321 | 0 \ |
| 4322 | -s "session successfully restored from cache" \ |
| 4323 | -S "session successfully restored from ticket" \ |
| 4324 | -s "a session has been resumed" \ |
| 4325 | -c "a session has been resumed" |
| 4326 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4327 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4328 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4329 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4330 | "$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] | 4331 | 0 \ |
| 4332 | -S "session successfully restored from cache" \ |
| 4333 | -S "session successfully restored from ticket" \ |
| 4334 | -S "a session has been resumed" \ |
| 4335 | -C "a session has been resumed" |
| 4336 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4337 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4338 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4339 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4340 | "$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] | 4341 | 0 \ |
| 4342 | -s "session successfully restored from cache" \ |
| 4343 | -S "session successfully restored from ticket" \ |
| 4344 | -s "a session has been resumed" \ |
| 4345 | -c "a session has been resumed" |
| 4346 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4347 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4348 | run_test "Session resume using cache: session copy" \ |
| 4349 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4350 | "$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] | 4351 | 0 \ |
| 4352 | -s "session successfully restored from cache" \ |
| 4353 | -S "session successfully restored from ticket" \ |
| 4354 | -s "a session has been resumed" \ |
| 4355 | -c "a session has been resumed" |
| 4356 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4357 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4358 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4359 | run_test "Session resume using cache: openssl client" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4360 | "$P_SRV force_version=tls12 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 4361 | "( $O_CLI -sess_out $SESSION; \ |
| 4362 | $O_CLI -sess_in $SESSION; \ |
| 4363 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4364 | 0 \ |
| 4365 | -s "found session ticket extension" \ |
| 4366 | -S "server hello, adding session ticket extension" \ |
| 4367 | -s "session successfully restored from cache" \ |
| 4368 | -S "session successfully restored from ticket" \ |
| 4369 | -s "a session has been resumed" |
| 4370 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4371 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4372 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4373 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4374 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4375 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4376 | 0 \ |
| 4377 | -C "found session_ticket extension" \ |
| 4378 | -C "parse new session ticket" \ |
| 4379 | -c "a session has been resumed" |
| 4380 | |
Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 4381 | # Tests for Session resume and extensions |
| 4382 | |
| 4383 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4384 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 4385 | run_test "Session resume and connection ID" \ |
| 4386 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 4387 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 4388 | 0 \ |
| 4389 | -c "Enable use of CID extension." \ |
| 4390 | -s "Enable use of CID extension." \ |
| 4391 | -c "client hello, adding CID extension" \ |
| 4392 | -s "found CID extension" \ |
| 4393 | -s "Use of CID extension negotiated" \ |
| 4394 | -s "server hello, adding CID extension" \ |
| 4395 | -c "found CID extension" \ |
| 4396 | -c "Use of CID extension negotiated" \ |
| 4397 | -s "Copy CIDs into SSL transform" \ |
| 4398 | -c "Copy CIDs into SSL transform" \ |
| 4399 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 4400 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 4401 | -s "Use of Connection ID has been negotiated" \ |
| 4402 | -c "Use of Connection ID has been negotiated" |
| 4403 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4404 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 4405 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4406 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4407 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4408 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4409 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 4410 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4411 | "$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] | 4412 | 0 \ |
| 4413 | -c "client hello, adding session ticket extension" \ |
| 4414 | -s "found session ticket extension" \ |
| 4415 | -S "server hello, adding session ticket extension" \ |
| 4416 | -C "found session_ticket extension" \ |
| 4417 | -C "parse new session ticket" \ |
| 4418 | -s "session successfully restored from cache" \ |
| 4419 | -S "session successfully restored from ticket" \ |
| 4420 | -s "a session has been resumed" \ |
| 4421 | -c "a session has been resumed" |
| 4422 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4423 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4424 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4425 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4426 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 4427 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4428 | "$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] | 4429 | 0 \ |
| 4430 | -C "client hello, adding session ticket extension" \ |
| 4431 | -S "found session ticket extension" \ |
| 4432 | -S "server hello, adding session ticket extension" \ |
| 4433 | -C "found session_ticket extension" \ |
| 4434 | -C "parse new session ticket" \ |
| 4435 | -s "session successfully restored from cache" \ |
| 4436 | -S "session successfully restored from ticket" \ |
| 4437 | -s "a session has been resumed" \ |
| 4438 | -c "a session has been resumed" |
| 4439 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4440 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4441 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4442 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 4443 | "$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] | 4444 | "$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] | 4445 | 0 \ |
| 4446 | -S "session successfully restored from cache" \ |
| 4447 | -S "session successfully restored from ticket" \ |
| 4448 | -S "a session has been resumed" \ |
| 4449 | -C "a session has been resumed" |
| 4450 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4451 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4452 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4453 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 4454 | "$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] | 4455 | "$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] | 4456 | 0 \ |
| 4457 | -s "session successfully restored from cache" \ |
| 4458 | -S "session successfully restored from ticket" \ |
| 4459 | -s "a session has been resumed" \ |
| 4460 | -c "a session has been resumed" |
| 4461 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4462 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4463 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4464 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 4465 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4466 | "$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] | 4467 | 0 \ |
| 4468 | -s "session successfully restored from cache" \ |
| 4469 | -S "session successfully restored from ticket" \ |
| 4470 | -s "a session has been resumed" \ |
| 4471 | -c "a session has been resumed" |
| 4472 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4473 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4474 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4475 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 4476 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4477 | "$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] | 4478 | 0 \ |
| 4479 | -S "session successfully restored from cache" \ |
| 4480 | -S "session successfully restored from ticket" \ |
| 4481 | -S "a session has been resumed" \ |
| 4482 | -C "a session has been resumed" |
| 4483 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4485 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4486 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 4487 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4488 | "$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] | 4489 | 0 \ |
| 4490 | -s "session successfully restored from cache" \ |
| 4491 | -S "session successfully restored from ticket" \ |
| 4492 | -s "a session has been resumed" \ |
| 4493 | -c "a session has been resumed" |
| 4494 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4496 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4497 | run_test "Session resume using cache, DTLS: session copy" \ |
| 4498 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4499 | "$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] | 4500 | 0 \ |
| 4501 | -s "session successfully restored from cache" \ |
| 4502 | -S "session successfully restored from ticket" \ |
| 4503 | -s "a session has been resumed" \ |
| 4504 | -c "a session has been resumed" |
| 4505 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4506 | # 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] | 4507 | # 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] | 4508 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4509 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4510 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4511 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4512 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 4513 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4514 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4515 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4516 | rm -f $SESSION )" \ |
| 4517 | 0 \ |
| 4518 | -s "found session ticket extension" \ |
| 4519 | -S "server hello, adding session ticket extension" \ |
| 4520 | -s "session successfully restored from cache" \ |
| 4521 | -S "session successfully restored from ticket" \ |
| 4522 | -s "a session has been resumed" |
| 4523 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4524 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4525 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4526 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 4527 | "$O_SRV -dtls" \ |
| 4528 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 4529 | 0 \ |
| 4530 | -C "found session_ticket extension" \ |
| 4531 | -C "parse new session ticket" \ |
| 4532 | -c "a session has been resumed" |
| 4533 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4534 | # Tests for Max Fragment Length extension |
| 4535 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4536 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4537 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4538 | run_test "Max fragment length: enabled, default" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4539 | "$P_SRV debug_level=3 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4540 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4541 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4542 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4543 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4544 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4545 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4546 | -C "client hello, adding max_fragment_length extension" \ |
| 4547 | -S "found max fragment length extension" \ |
| 4548 | -S "server hello, max_fragment_length extension" \ |
| 4549 | -C "found max_fragment_length extension" |
| 4550 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4551 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4552 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4553 | run_test "Max fragment length: enabled, default, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4554 | "$P_SRV debug_level=3 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4555 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4556 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4557 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4558 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4559 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4560 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4561 | -C "client hello, adding max_fragment_length extension" \ |
| 4562 | -S "found max fragment length extension" \ |
| 4563 | -S "server hello, max_fragment_length extension" \ |
| 4564 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4565 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4566 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4567 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4568 | |
| 4569 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4570 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4571 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 4572 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4573 | "$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] | 4574 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4575 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4576 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4577 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4578 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4579 | -C "client hello, adding max_fragment_length extension" \ |
| 4580 | -S "found max fragment length extension" \ |
| 4581 | -S "server hello, max_fragment_length extension" \ |
| 4582 | -C "found max_fragment_length extension" \ |
| 4583 | -c "fragment larger than.*maximum " |
| 4584 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4585 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 4586 | # (session fragment length will be 16384 regardless of mbedtls |
| 4587 | # content length configuration.) |
| 4588 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4589 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4590 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4591 | run_test "Max fragment length: disabled, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4592 | "$P_SRV debug_level=3 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4593 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +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 16384" \ |
| 4596 | -C "Maximum outgoing record payload length is 16384" \ |
| 4597 | -S "Maximum incoming record payload length is 16384" \ |
| 4598 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4599 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4600 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4601 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4602 | |
| 4603 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4604 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4605 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4606 | "$P_SRV debug_level=3 dtls=1 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4607 | "$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] | 4608 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4609 | -C "Maximum incoming record payload length is 16384" \ |
| 4610 | -C "Maximum outgoing record payload length is 16384" \ |
| 4611 | -S "Maximum incoming record payload length is 16384" \ |
| 4612 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4613 | -c "fragment larger than.*maximum " |
| 4614 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4615 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4616 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4617 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4618 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4619 | "$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] | 4620 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4621 | -c "Maximum incoming record payload length is 4096" \ |
| 4622 | -c "Maximum outgoing record payload length is 4096" \ |
| 4623 | -s "Maximum incoming record payload length is 4096" \ |
| 4624 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4625 | -c "client hello, adding max_fragment_length extension" \ |
| 4626 | -s "found max fragment length extension" \ |
| 4627 | -s "server hello, max_fragment_length extension" \ |
| 4628 | -c "found max_fragment_length extension" |
| 4629 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4630 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4631 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4632 | run_test "Max fragment length: client 512, server 1024" \ |
| 4633 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4634 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4635 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4636 | -c "Maximum incoming record payload length is 512" \ |
| 4637 | -c "Maximum outgoing record payload length is 512" \ |
| 4638 | -s "Maximum incoming record payload length is 512" \ |
| 4639 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4640 | -c "client hello, adding max_fragment_length extension" \ |
| 4641 | -s "found max fragment length extension" \ |
| 4642 | -s "server hello, max_fragment_length extension" \ |
| 4643 | -c "found max_fragment_length extension" |
| 4644 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4645 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4646 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4647 | run_test "Max fragment length: client 512, server 2048" \ |
| 4648 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4649 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4650 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4651 | -c "Maximum incoming record payload length is 512" \ |
| 4652 | -c "Maximum outgoing record payload length is 512" \ |
| 4653 | -s "Maximum incoming record payload length is 512" \ |
| 4654 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4655 | -c "client hello, adding max_fragment_length extension" \ |
| 4656 | -s "found max fragment length extension" \ |
| 4657 | -s "server hello, max_fragment_length extension" \ |
| 4658 | -c "found max_fragment_length extension" |
| 4659 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4660 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4661 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4662 | run_test "Max fragment length: client 512, server 4096" \ |
| 4663 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4664 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4665 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4666 | -c "Maximum incoming record payload length is 512" \ |
| 4667 | -c "Maximum outgoing record payload length is 512" \ |
| 4668 | -s "Maximum incoming record payload length is 512" \ |
| 4669 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4670 | -c "client hello, adding max_fragment_length extension" \ |
| 4671 | -s "found max fragment length extension" \ |
| 4672 | -s "server hello, max_fragment_length extension" \ |
| 4673 | -c "found max_fragment_length extension" |
| 4674 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4675 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4676 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4677 | run_test "Max fragment length: client 1024, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4678 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4679 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4680 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4681 | -c "Maximum incoming record payload length is 1024" \ |
| 4682 | -c "Maximum outgoing record payload length is 1024" \ |
| 4683 | -s "Maximum incoming record payload length is 1024" \ |
| 4684 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4685 | -c "client hello, adding max_fragment_length extension" \ |
| 4686 | -s "found max fragment length extension" \ |
| 4687 | -s "server hello, max_fragment_length extension" \ |
| 4688 | -c "found max_fragment_length extension" |
| 4689 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4690 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4691 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4692 | run_test "Max fragment length: client 1024, server 2048" \ |
| 4693 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4694 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4695 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4696 | -c "Maximum incoming record payload length is 1024" \ |
| 4697 | -c "Maximum outgoing record payload length is 1024" \ |
| 4698 | -s "Maximum incoming record payload length is 1024" \ |
| 4699 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4700 | -c "client hello, adding max_fragment_length extension" \ |
| 4701 | -s "found max fragment length extension" \ |
| 4702 | -s "server hello, max_fragment_length extension" \ |
| 4703 | -c "found max_fragment_length extension" |
| 4704 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4705 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4706 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4707 | run_test "Max fragment length: client 1024, server 4096" \ |
| 4708 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4709 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4710 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4711 | -c "Maximum incoming record payload length is 1024" \ |
| 4712 | -c "Maximum outgoing record payload length is 1024" \ |
| 4713 | -s "Maximum incoming record payload length is 1024" \ |
| 4714 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4715 | -c "client hello, adding max_fragment_length extension" \ |
| 4716 | -s "found max fragment length extension" \ |
| 4717 | -s "server hello, max_fragment_length extension" \ |
| 4718 | -c "found max_fragment_length extension" |
| 4719 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4720 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4721 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4722 | run_test "Max fragment length: client 2048, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4723 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4724 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4725 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4726 | -c "Maximum incoming record payload length is 2048" \ |
| 4727 | -c "Maximum outgoing record payload length is 2048" \ |
| 4728 | -s "Maximum incoming record payload length is 2048" \ |
| 4729 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4730 | -c "client hello, adding max_fragment_length extension" \ |
| 4731 | -s "found max fragment length extension" \ |
| 4732 | -s "server hello, max_fragment_length extension" \ |
| 4733 | -c "found max_fragment_length extension" |
| 4734 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4735 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4736 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4737 | run_test "Max fragment length: client 2048, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4738 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4739 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4740 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4741 | -c "Maximum incoming record payload length is 2048" \ |
| 4742 | -c "Maximum outgoing record payload length is 2048" \ |
| 4743 | -s "Maximum incoming record payload length is 2048" \ |
| 4744 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4745 | -c "client hello, adding max_fragment_length extension" \ |
| 4746 | -s "found max fragment length extension" \ |
| 4747 | -s "server hello, max_fragment_length extension" \ |
| 4748 | -c "found max_fragment_length extension" |
| 4749 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4750 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4751 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4752 | run_test "Max fragment length: client 2048, server 4096" \ |
| 4753 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4754 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4755 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4756 | -c "Maximum incoming record payload length is 2048" \ |
| 4757 | -c "Maximum outgoing record payload length is 2048" \ |
| 4758 | -s "Maximum incoming record payload length is 2048" \ |
| 4759 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4760 | -c "client hello, adding max_fragment_length extension" \ |
| 4761 | -s "found max fragment length extension" \ |
| 4762 | -s "server hello, max_fragment_length extension" \ |
| 4763 | -c "found max_fragment_length extension" |
| 4764 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4765 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4766 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4767 | run_test "Max fragment length: client 4096, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4768 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4769 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4770 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4771 | -c "Maximum incoming record payload length is 4096" \ |
| 4772 | -c "Maximum outgoing record payload length is 4096" \ |
| 4773 | -s "Maximum incoming record payload length is 4096" \ |
| 4774 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4775 | -c "client hello, adding max_fragment_length extension" \ |
| 4776 | -s "found max fragment length extension" \ |
| 4777 | -s "server hello, max_fragment_length extension" \ |
| 4778 | -c "found max_fragment_length extension" |
| 4779 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4780 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4781 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4782 | run_test "Max fragment length: client 4096, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4783 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4784 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4785 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4786 | -c "Maximum incoming record payload length is 4096" \ |
| 4787 | -c "Maximum outgoing record payload length is 4096" \ |
| 4788 | -s "Maximum incoming record payload length is 4096" \ |
| 4789 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4790 | -c "client hello, adding max_fragment_length extension" \ |
| 4791 | -s "found max fragment length extension" \ |
| 4792 | -s "server hello, max_fragment_length extension" \ |
| 4793 | -c "found max_fragment_length extension" |
| 4794 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4795 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4796 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4797 | run_test "Max fragment length: client 4096, server 2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4798 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4799 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4800 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4801 | -c "Maximum incoming record payload length is 4096" \ |
| 4802 | -c "Maximum outgoing record payload length is 4096" \ |
| 4803 | -s "Maximum incoming record payload length is 4096" \ |
| 4804 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4805 | -c "client hello, adding max_fragment_length extension" \ |
| 4806 | -s "found max fragment length extension" \ |
| 4807 | -s "server hello, max_fragment_length extension" \ |
| 4808 | -c "found max_fragment_length extension" |
| 4809 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4810 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4811 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4812 | run_test "Max fragment length: used by server" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4813 | "$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] | 4814 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4815 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4816 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4817 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4818 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4819 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4820 | -C "client hello, adding max_fragment_length extension" \ |
| 4821 | -S "found max fragment length extension" \ |
| 4822 | -S "server hello, max_fragment_length extension" \ |
| 4823 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4824 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4825 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4826 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4827 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4828 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4829 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4830 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4831 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4832 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4833 | -c "Maximum incoming record payload length is 4096" \ |
| 4834 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4835 | -c "client hello, adding max_fragment_length extension" \ |
| 4836 | -c "found max_fragment_length extension" |
| 4837 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4838 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4839 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4840 | run_test "Max fragment length: client, message just fits" \ |
| 4841 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4842 | "$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] | 4843 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4844 | -c "Maximum incoming record payload length is 2048" \ |
| 4845 | -c "Maximum outgoing record payload length is 2048" \ |
| 4846 | -s "Maximum incoming record payload length is 2048" \ |
| 4847 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4848 | -c "client hello, adding max_fragment_length extension" \ |
| 4849 | -s "found max fragment length extension" \ |
| 4850 | -s "server hello, max_fragment_length extension" \ |
| 4851 | -c "found max_fragment_length extension" \ |
| 4852 | -c "2048 bytes written in 1 fragments" \ |
| 4853 | -s "2048 bytes read" |
| 4854 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4855 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4856 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4857 | run_test "Max fragment length: client, larger message" \ |
| 4858 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4859 | "$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] | 4860 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4861 | -c "Maximum incoming record payload length is 2048" \ |
| 4862 | -c "Maximum outgoing record payload length is 2048" \ |
| 4863 | -s "Maximum incoming record payload length is 2048" \ |
| 4864 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4865 | -c "client hello, adding max_fragment_length extension" \ |
| 4866 | -s "found max fragment length extension" \ |
| 4867 | -s "server hello, max_fragment_length extension" \ |
| 4868 | -c "found max_fragment_length extension" \ |
| 4869 | -c "2345 bytes written in 2 fragments" \ |
| 4870 | -s "2048 bytes read" \ |
| 4871 | -s "297 bytes read" |
| 4872 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4873 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4874 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4875 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4876 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4877 | "$P_SRV debug_level=3 dtls=1" \ |
| 4878 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4879 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4880 | -c "Maximum incoming record payload length is 2048" \ |
| 4881 | -c "Maximum outgoing record payload length is 2048" \ |
| 4882 | -s "Maximum incoming record payload length is 2048" \ |
| 4883 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4884 | -c "client hello, adding max_fragment_length extension" \ |
| 4885 | -s "found max fragment length extension" \ |
| 4886 | -s "server hello, max_fragment_length extension" \ |
| 4887 | -c "found max_fragment_length extension" \ |
| 4888 | -c "fragment larger than.*maximum" |
| 4889 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4890 | # Tests for Record Size Limit extension |
| 4891 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4892 | requires_gnutls_tls1_3 |
| 4893 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4894 | 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] | 4895 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4896 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4897 | 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] | 4898 | "$P_SRV debug_level=3 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4899 | "$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] | 4900 | 0 \ |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4901 | -s "RecordSizeLimit: 16385 Bytes" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4902 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4903 | -s "Maximum outgoing record payload length is 16383" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4904 | -s "bytes written in 1 fragments" |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4905 | |
| 4906 | requires_gnutls_tls1_3 |
| 4907 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4908 | 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] | 4909 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4910 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4911 | 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] | 4912 | "$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] | 4913 | "$P_CLI debug_level=4 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4914 | 0 \ |
Yanray Wang | 42017cd | 2023-11-08 11:15:23 +0800 | [diff] [blame] | 4915 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 4916 | -c "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 4917 | -c "EncryptedExtensions: record_size_limit(28) extension received." \ |
Yanray Wang | 42017cd | 2023-11-08 11:15:23 +0800 | [diff] [blame] | 4918 | -c "RecordSizeLimit: 16385 Bytes" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4919 | |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 4920 | # In the following tests, --recordsize is the value used by the G_NEXT_CLI (3.7.2) to configure the |
| 4921 | # maximum record size using gnutls_record_set_max_size() |
| 4922 | # (https://gnutls.org/reference/gnutls-gnutls.html#gnutls-record-set-max-size). |
| 4923 | # There is currently a lower limit of 512, caused by gnutls_record_set_max_size() |
| 4924 | # not respecting the "%ALLOW_SMALL_RECORDS" priority string and not using the |
| 4925 | # more recent function gnutls_record_set_max_recv_size() |
| 4926 | # (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] | 4927 | # There is currently an upper limit of 4096, caused by the cli arg parser: |
| 4928 | # 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] | 4929 | # Thus, these tests are currently limited to the value range 512-4096. |
| 4930 | # Also, the value sent in the extension will be one larger than the value |
| 4931 | # set at the command line: |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4932 | # 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] | 4933 | |
| 4934 | # 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] | 4935 | # so for 513 record size limit tests we use preshared key to avoid sending |
| 4936 | # the certificate. |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4937 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4938 | requires_gnutls_tls1_3 |
| 4939 | requires_gnutls_record_size_limit |
| 4940 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
| 4941 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4942 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4943 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 1 fragment" \ |
| 4944 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4945 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4946 | response_size=256" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4947 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4948 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4949 | 0 \ |
| 4950 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4951 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4952 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4953 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4954 | -s "Maximum outgoing record payload length is 511" \ |
| 4955 | -s "256 bytes written in 1 fragments" |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4956 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4957 | requires_gnutls_tls1_3 |
| 4958 | requires_gnutls_record_size_limit |
| 4959 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
| 4960 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4961 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4962 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 2 fragments" \ |
| 4963 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4964 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4965 | response_size=768" \ |
| 4966 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4967 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
| 4968 | 0 \ |
| 4969 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4970 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4971 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4972 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4973 | -s "Maximum outgoing record payload length is 511" \ |
| 4974 | -s "768 bytes written in 2 fragments" |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4975 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4976 | requires_gnutls_tls1_3 |
| 4977 | requires_gnutls_record_size_limit |
| 4978 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
| 4979 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4980 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4981 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 3 fragments" \ |
| 4982 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4983 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4984 | response_size=1280" \ |
| 4985 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4986 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
| 4987 | 0 \ |
| 4988 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4989 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4990 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4991 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4992 | -s "Maximum outgoing record payload length is 511" \ |
| 4993 | -s "1280 bytes written in 3 fragments" |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4994 | |
| 4995 | requires_gnutls_tls1_3 |
| 4996 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4997 | 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] | 4998 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4999 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5000 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 1 fragment" \ |
| 5001 | "$P_SRV debug_level=3 force_version=tls13 response_size=512" \ |
| 5002 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 5003 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5004 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 5005 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5006 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5007 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5008 | -s "Maximum outgoing record payload length is 1023" \ |
| 5009 | -s "512 bytes written in 1 fragments" |
| 5010 | |
| 5011 | requires_gnutls_tls1_3 |
| 5012 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5013 | 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] | 5014 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5015 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5016 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 2 fragments" \ |
| 5017 | "$P_SRV debug_level=3 force_version=tls13 response_size=1536" \ |
| 5018 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 5019 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5020 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 5021 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5022 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5023 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5024 | -s "Maximum outgoing record payload length is 1023" \ |
| 5025 | -s "1536 bytes written in 2 fragments" |
| 5026 | |
| 5027 | requires_gnutls_tls1_3 |
| 5028 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5029 | 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] | 5030 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5031 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5032 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 3 fragments" \ |
| 5033 | "$P_SRV debug_level=3 force_version=tls13 response_size=2560" \ |
| 5034 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 5035 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5036 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 5037 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5038 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5039 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5040 | -s "Maximum outgoing record payload length is 1023" \ |
| 5041 | -s "2560 bytes written in 3 fragments" |
| 5042 | |
| 5043 | requires_gnutls_tls1_3 |
| 5044 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5045 | 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] | 5046 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5047 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5048 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 1 fragment" \ |
| 5049 | "$P_SRV debug_level=3 force_version=tls13 response_size=2048" \ |
| 5050 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5051 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5052 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5053 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5054 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5055 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5056 | -s "Maximum outgoing record payload length is 4095" \ |
| 5057 | -s "2048 bytes written in 1 fragments" |
| 5058 | |
| 5059 | requires_gnutls_tls1_3 |
| 5060 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5061 | 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] | 5062 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5063 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5064 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 2 fragments" \ |
| 5065 | "$P_SRV debug_level=3 force_version=tls13 response_size=6144" \ |
| 5066 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5067 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5068 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5069 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5070 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5071 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5072 | -s "Maximum outgoing record payload length is 4095" \ |
| 5073 | -s "6144 bytes written in 2 fragments" |
| 5074 | |
| 5075 | requires_gnutls_tls1_3 |
| 5076 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5077 | 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] | 5078 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5079 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5080 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 3 fragments" \ |
| 5081 | "$P_SRV debug_level=3 force_version=tls13 response_size=10240" \ |
| 5082 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5083 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5084 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5085 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5086 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5087 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5088 | -s "Maximum outgoing record payload length is 4095" \ |
| 5089 | -s "10240 bytes written in 3 fragments" |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 5090 | |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5091 | requires_gnutls_tls1_3 |
| 5092 | requires_gnutls_record_size_limit |
| 5093 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5094 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5095 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5096 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 1 fragment" \ |
| 5097 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5098 | "$P_CLI debug_level=4 force_version=tls13 request_size=256" \ |
| 5099 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5100 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5101 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5102 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5103 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5104 | -c "Maximum outgoing record payload length is 511" \ |
| 5105 | -c "256 bytes written in 1 fragments" |
| 5106 | |
| 5107 | requires_gnutls_tls1_3 |
| 5108 | requires_gnutls_record_size_limit |
| 5109 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5110 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5111 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5112 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 2 fragments" \ |
| 5113 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5114 | "$P_CLI debug_level=4 force_version=tls13 request_size=768" \ |
| 5115 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5116 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5117 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5118 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5119 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5120 | -c "Maximum outgoing record payload length is 511" \ |
| 5121 | -c "768 bytes written in 2 fragments" |
| 5122 | |
| 5123 | requires_gnutls_tls1_3 |
| 5124 | requires_gnutls_record_size_limit |
| 5125 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5126 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5127 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5128 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 3 fragments" \ |
| 5129 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5130 | "$P_CLI debug_level=4 force_version=tls13 request_size=1280" \ |
| 5131 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5132 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5133 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5134 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5135 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5136 | -c "Maximum outgoing record payload length is 511" \ |
| 5137 | -c "1280 bytes written in 3 fragments" |
| 5138 | |
| 5139 | requires_gnutls_tls1_3 |
| 5140 | requires_gnutls_record_size_limit |
| 5141 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5142 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5143 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5144 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 1 fragment" \ |
| 5145 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5146 | "$P_CLI debug_level=4 force_version=tls13 request_size=512" \ |
| 5147 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5148 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5149 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5150 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5151 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5152 | -c "Maximum outgoing record payload length is 1023" \ |
| 5153 | -c "512 bytes written in 1 fragments" |
| 5154 | |
| 5155 | requires_gnutls_tls1_3 |
| 5156 | requires_gnutls_record_size_limit |
| 5157 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5158 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5159 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5160 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 2 fragments" \ |
| 5161 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5162 | "$P_CLI debug_level=4 force_version=tls13 request_size=1536" \ |
| 5163 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5164 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5165 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5166 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5167 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5168 | -c "Maximum outgoing record payload length is 1023" \ |
| 5169 | -c "1536 bytes written in 2 fragments" |
| 5170 | |
| 5171 | requires_gnutls_tls1_3 |
| 5172 | requires_gnutls_record_size_limit |
| 5173 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5174 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5175 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5176 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 3 fragments" \ |
| 5177 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5178 | "$P_CLI debug_level=4 force_version=tls13 request_size=2560" \ |
| 5179 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5180 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5181 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5182 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5183 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5184 | -c "Maximum outgoing record payload length is 1023" \ |
| 5185 | -c "2560 bytes written in 3 fragments" |
| 5186 | |
| 5187 | requires_gnutls_tls1_3 |
| 5188 | requires_gnutls_record_size_limit |
| 5189 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5190 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5191 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5192 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 1 fragment" \ |
| 5193 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5194 | "$P_CLI debug_level=4 force_version=tls13 request_size=2048" \ |
| 5195 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5196 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5197 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5198 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5199 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5200 | -c "Maximum outgoing record payload length is 4095" \ |
| 5201 | -c "2048 bytes written in 1 fragments" |
| 5202 | |
| 5203 | requires_gnutls_tls1_3 |
| 5204 | requires_gnutls_record_size_limit |
| 5205 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5206 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5207 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5208 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 2 fragments" \ |
| 5209 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5210 | "$P_CLI debug_level=4 force_version=tls13 request_size=6144" \ |
| 5211 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5212 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5213 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5214 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5215 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5216 | -c "Maximum outgoing record payload length is 4095" \ |
| 5217 | -c "6144 bytes written in 2 fragments" |
| 5218 | |
| 5219 | requires_gnutls_tls1_3 |
| 5220 | requires_gnutls_record_size_limit |
| 5221 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5222 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5223 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5224 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 3 fragments" \ |
| 5225 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5226 | "$P_CLI debug_level=4 force_version=tls13 request_size=10240" \ |
| 5227 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5228 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5229 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5230 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5231 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5232 | -c "Maximum outgoing record payload length is 4095" \ |
| 5233 | -c "10240 bytes written in 3 fragments" |
| 5234 | |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5235 | # TODO: For time being, we send fixed value of RecordSizeLimit defined by |
| 5236 | # MBEDTLS_SSL_IN_CONTENT_LEN. Once we support variable buffer length of |
| 5237 | # RecordSizeLimit, we need to modify value of RecordSizeLimit in below test. |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5238 | requires_config_value_equals "MBEDTLS_SSL_IN_CONTENT_LEN" 16384 |
| 5239 | 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] | 5240 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5241 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5242 | 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] | 5243 | "$P_SRV debug_level=4 force_version=tls13" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5244 | "$P_CLI debug_level=4" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5245 | 0 \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5246 | -c "Sent RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5247 | -c "RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5248 | -s "RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5249 | -s "Sent RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5250 | -s "Maximum outgoing record payload length is 16383" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5251 | -s "Maximum incoming record payload length is 16384" |
| 5252 | |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 5253 | # End of Record size limit tests |
| 5254 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5255 | # Tests for renegotiation |
| 5256 | |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5257 | # G_NEXT_SRV is used in renegotiation tests becuase of the increased |
| 5258 | # extensions limit since we exceed the limit in G_SRV when we send |
| 5259 | # TLS 1.3 extensions in the initial handshake. |
| 5260 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5261 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5262 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5263 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5264 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5265 | 0 \ |
| 5266 | -C "client hello, adding renegotiation extension" \ |
| 5267 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5268 | -S "found renegotiation extension" \ |
| 5269 | -s "server hello, secure renegotiation extension" \ |
| 5270 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5271 | -C "=> renegotiate" \ |
| 5272 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5273 | -S "write hello request" |
| 5274 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5275 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5276 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5277 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5278 | "$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] | 5279 | 0 \ |
| 5280 | -c "client hello, adding renegotiation extension" \ |
| 5281 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5282 | -s "found renegotiation extension" \ |
| 5283 | -s "server hello, secure renegotiation extension" \ |
| 5284 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5285 | -c "=> renegotiate" \ |
| 5286 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5287 | -S "write hello request" |
| 5288 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5289 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5290 | run_test "Renegotiation: server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5291 | "$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] | 5292 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5293 | 0 \ |
| 5294 | -c "client hello, adding renegotiation extension" \ |
| 5295 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5296 | -s "found renegotiation extension" \ |
| 5297 | -s "server hello, secure renegotiation extension" \ |
| 5298 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5299 | -c "=> renegotiate" \ |
| 5300 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5301 | -s "write hello request" |
| 5302 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5303 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 5304 | # 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] | 5305 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5306 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5307 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 5308 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5309 | "$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] | 5310 | 0 \ |
| 5311 | -c "client hello, adding renegotiation extension" \ |
| 5312 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5313 | -s "found renegotiation extension" \ |
| 5314 | -s "server hello, secure renegotiation extension" \ |
| 5315 | -c "found renegotiation extension" \ |
| 5316 | -c "=> renegotiate" \ |
| 5317 | -s "=> renegotiate" \ |
| 5318 | -S "write hello request" \ |
| 5319 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 5320 | |
| 5321 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 5322 | # 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] | 5323 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5324 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5325 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5326 | "$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] | 5327 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 5328 | 0 \ |
| 5329 | -c "client hello, adding renegotiation extension" \ |
| 5330 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5331 | -s "found renegotiation extension" \ |
| 5332 | -s "server hello, secure renegotiation extension" \ |
| 5333 | -c "found renegotiation extension" \ |
| 5334 | -c "=> renegotiate" \ |
| 5335 | -s "=> renegotiate" \ |
| 5336 | -s "write hello request" \ |
| 5337 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 5338 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5339 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5340 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5341 | "$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] | 5342 | "$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] | 5343 | 0 \ |
| 5344 | -c "client hello, adding renegotiation extension" \ |
| 5345 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5346 | -s "found renegotiation extension" \ |
| 5347 | -s "server hello, secure renegotiation extension" \ |
| 5348 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5349 | -c "=> renegotiate" \ |
| 5350 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5351 | -s "write hello request" |
| 5352 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5353 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5354 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 5355 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5356 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5357 | "$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] | 5358 | "$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" \ |
| 5359 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 5360 | -c "Maximum incoming record payload length is 2048" \ |
| 5361 | -c "Maximum outgoing record payload length is 2048" \ |
| 5362 | -s "Maximum incoming record payload length is 2048" \ |
| 5363 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5364 | -c "client hello, adding max_fragment_length extension" \ |
| 5365 | -s "found max fragment length extension" \ |
| 5366 | -s "server hello, max_fragment_length extension" \ |
| 5367 | -c "found max_fragment_length extension" \ |
| 5368 | -c "client hello, adding renegotiation extension" \ |
| 5369 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5370 | -s "found renegotiation extension" \ |
| 5371 | -s "server hello, secure renegotiation extension" \ |
| 5372 | -c "found renegotiation extension" \ |
| 5373 | -c "=> renegotiate" \ |
| 5374 | -s "=> renegotiate" \ |
| 5375 | -s "write hello request" |
| 5376 | |
| 5377 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5378 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5379 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5380 | "$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] | 5381 | 1 \ |
| 5382 | -c "client hello, adding renegotiation extension" \ |
| 5383 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5384 | -S "found renegotiation extension" \ |
| 5385 | -s "server hello, secure renegotiation extension" \ |
| 5386 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5387 | -c "=> renegotiate" \ |
| 5388 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5389 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 5390 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5391 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5392 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5393 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5394 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5395 | "$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] | 5396 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5397 | 0 \ |
| 5398 | -C "client hello, adding renegotiation extension" \ |
| 5399 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5400 | -S "found renegotiation extension" \ |
| 5401 | -s "server hello, secure renegotiation extension" \ |
| 5402 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5403 | -C "=> renegotiate" \ |
| 5404 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5405 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 5406 | -S "SSL - An unexpected message was received from our peer" \ |
| 5407 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5408 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5409 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5410 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5411 | "$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] | 5412 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5413 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5414 | 0 \ |
| 5415 | -C "client hello, adding renegotiation extension" \ |
| 5416 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5417 | -S "found renegotiation extension" \ |
| 5418 | -s "server hello, secure renegotiation extension" \ |
| 5419 | -c "found renegotiation extension" \ |
| 5420 | -C "=> renegotiate" \ |
| 5421 | -S "=> renegotiate" \ |
| 5422 | -s "write hello request" \ |
| 5423 | -S "SSL - An unexpected message was received from our peer" \ |
| 5424 | -S "failed" |
| 5425 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5426 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5427 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5428 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5429 | "$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] | 5430 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5431 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5432 | 0 \ |
| 5433 | -C "client hello, adding renegotiation extension" \ |
| 5434 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5435 | -S "found renegotiation extension" \ |
| 5436 | -s "server hello, secure renegotiation extension" \ |
| 5437 | -c "found renegotiation extension" \ |
| 5438 | -C "=> renegotiate" \ |
| 5439 | -S "=> renegotiate" \ |
| 5440 | -s "write hello request" \ |
| 5441 | -S "SSL - An unexpected message was received from our peer" \ |
| 5442 | -S "failed" |
| 5443 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5444 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5445 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5446 | "$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] | 5447 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5448 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5449 | 0 \ |
| 5450 | -C "client hello, adding renegotiation extension" \ |
| 5451 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5452 | -S "found renegotiation extension" \ |
| 5453 | -s "server hello, secure renegotiation extension" \ |
| 5454 | -c "found renegotiation extension" \ |
| 5455 | -C "=> renegotiate" \ |
| 5456 | -S "=> renegotiate" \ |
| 5457 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5458 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5459 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5460 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5461 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5462 | "$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] | 5463 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5464 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5465 | 0 \ |
| 5466 | -c "client hello, adding renegotiation extension" \ |
| 5467 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5468 | -s "found renegotiation extension" \ |
| 5469 | -s "server hello, secure renegotiation extension" \ |
| 5470 | -c "found renegotiation extension" \ |
| 5471 | -c "=> renegotiate" \ |
| 5472 | -s "=> renegotiate" \ |
| 5473 | -s "write hello request" \ |
| 5474 | -S "SSL - An unexpected message was received from our peer" \ |
| 5475 | -S "failed" |
| 5476 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5477 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5478 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5479 | "$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] | 5480 | "$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] | 5481 | 0 \ |
| 5482 | -C "client hello, adding renegotiation extension" \ |
| 5483 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5484 | -S "found renegotiation extension" \ |
| 5485 | -s "server hello, secure renegotiation extension" \ |
| 5486 | -c "found renegotiation extension" \ |
| 5487 | -S "record counter limit reached: renegotiate" \ |
| 5488 | -C "=> renegotiate" \ |
| 5489 | -S "=> renegotiate" \ |
| 5490 | -S "write hello request" \ |
| 5491 | -S "SSL - An unexpected message was received from our peer" \ |
| 5492 | -S "failed" |
| 5493 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 5494 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5495 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5496 | run_test "Renegotiation: periodic, just above period" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5497 | "$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] | 5498 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5499 | 0 \ |
| 5500 | -c "client hello, adding renegotiation extension" \ |
| 5501 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5502 | -s "found renegotiation extension" \ |
| 5503 | -s "server hello, secure renegotiation extension" \ |
| 5504 | -c "found renegotiation extension" \ |
| 5505 | -s "record counter limit reached: renegotiate" \ |
| 5506 | -c "=> renegotiate" \ |
| 5507 | -s "=> renegotiate" \ |
| 5508 | -s "write hello request" \ |
| 5509 | -S "SSL - An unexpected message was received from our peer" \ |
| 5510 | -S "failed" |
| 5511 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5512 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5513 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5514 | "$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] | 5515 | "$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] | 5516 | 0 \ |
| 5517 | -c "client hello, adding renegotiation extension" \ |
| 5518 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5519 | -s "found renegotiation extension" \ |
| 5520 | -s "server hello, secure renegotiation extension" \ |
| 5521 | -c "found renegotiation extension" \ |
| 5522 | -s "record counter limit reached: renegotiate" \ |
| 5523 | -c "=> renegotiate" \ |
| 5524 | -s "=> renegotiate" \ |
| 5525 | -s "write hello request" \ |
| 5526 | -S "SSL - An unexpected message was received from our peer" \ |
| 5527 | -S "failed" |
| 5528 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5529 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5530 | run_test "Renegotiation: periodic, above period, disabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5531 | "$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] | 5532 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 5533 | 0 \ |
| 5534 | -C "client hello, adding renegotiation extension" \ |
| 5535 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5536 | -S "found renegotiation extension" \ |
| 5537 | -s "server hello, secure renegotiation extension" \ |
| 5538 | -c "found renegotiation extension" \ |
| 5539 | -S "record counter limit reached: renegotiate" \ |
| 5540 | -C "=> renegotiate" \ |
| 5541 | -S "=> renegotiate" \ |
| 5542 | -S "write hello request" \ |
| 5543 | -S "SSL - An unexpected message was received from our peer" \ |
| 5544 | -S "failed" |
| 5545 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5546 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5547 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5548 | "$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] | 5549 | "$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] | 5550 | 0 \ |
| 5551 | -c "client hello, adding renegotiation extension" \ |
| 5552 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5553 | -s "found renegotiation extension" \ |
| 5554 | -s "server hello, secure renegotiation extension" \ |
| 5555 | -c "found renegotiation extension" \ |
| 5556 | -c "=> renegotiate" \ |
| 5557 | -s "=> renegotiate" \ |
| 5558 | -S "write hello request" |
| 5559 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5560 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5561 | run_test "Renegotiation: nbio, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5562 | "$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] | 5563 | "$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] | 5564 | 0 \ |
| 5565 | -c "client hello, adding renegotiation extension" \ |
| 5566 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5567 | -s "found renegotiation extension" \ |
| 5568 | -s "server hello, secure renegotiation extension" \ |
| 5569 | -c "found renegotiation extension" \ |
| 5570 | -c "=> renegotiate" \ |
| 5571 | -s "=> renegotiate" \ |
| 5572 | -s "write hello request" |
| 5573 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5574 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5575 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5576 | run_test "Renegotiation: openssl server, client-initiated" \ |
Gilles Peskine | ed8cc46 | 2024-09-06 13:52:14 +0200 | [diff] [blame] | 5577 | "$O_SRV -www $OPENSSL_S_SERVER_CLIENT_RENEGOTIATION -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5578 | "$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] | 5579 | 0 \ |
| 5580 | -c "client hello, adding renegotiation extension" \ |
| 5581 | -c "found renegotiation extension" \ |
| 5582 | -c "=> renegotiate" \ |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5583 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5584 | -C "error" \ |
| 5585 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5586 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5587 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5588 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5589 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5590 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5591 | "$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] | 5592 | "$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] | 5593 | 0 \ |
| 5594 | -c "client hello, adding renegotiation extension" \ |
| 5595 | -c "found renegotiation extension" \ |
| 5596 | -c "=> renegotiate" \ |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5597 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5598 | -C "error" \ |
| 5599 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5600 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5601 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5602 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5603 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5604 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5605 | "$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] | 5606 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5607 | 1 \ |
| 5608 | -c "client hello, adding renegotiation extension" \ |
| 5609 | -C "found renegotiation extension" \ |
| 5610 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5611 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5612 | -c "error" \ |
| 5613 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5614 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5615 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5616 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5617 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5618 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5619 | "$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] | 5620 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5621 | allow_legacy=0" \ |
| 5622 | 1 \ |
| 5623 | -c "client hello, adding renegotiation extension" \ |
| 5624 | -C "found renegotiation extension" \ |
| 5625 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5626 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5627 | -c "error" \ |
| 5628 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5629 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5630 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5631 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5632 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5633 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5634 | "$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] | 5635 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5636 | allow_legacy=1" \ |
| 5637 | 0 \ |
| 5638 | -c "client hello, adding renegotiation extension" \ |
| 5639 | -C "found renegotiation extension" \ |
| 5640 | -c "=> renegotiate" \ |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5641 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5642 | -C "error" \ |
| 5643 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5644 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5645 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5646 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 5647 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 5648 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 5649 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5650 | 0 \ |
| 5651 | -c "client hello, adding renegotiation extension" \ |
| 5652 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5653 | -s "found renegotiation extension" \ |
| 5654 | -s "server hello, secure renegotiation extension" \ |
| 5655 | -c "found renegotiation extension" \ |
| 5656 | -c "=> renegotiate" \ |
| 5657 | -s "=> renegotiate" \ |
| 5658 | -S "write hello request" |
| 5659 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5660 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5661 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5662 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 5663 | "$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] | 5664 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 5665 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5666 | 0 \ |
| 5667 | -c "client hello, adding renegotiation extension" \ |
| 5668 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5669 | -s "found renegotiation extension" \ |
| 5670 | -s "server hello, secure renegotiation extension" \ |
| 5671 | -c "found renegotiation extension" \ |
| 5672 | -c "=> renegotiate" \ |
| 5673 | -s "=> renegotiate" \ |
| 5674 | -s "write hello request" |
| 5675 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5676 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5677 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5678 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 5679 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 5680 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 5681 | 0 \ |
| 5682 | -c "client hello, adding renegotiation extension" \ |
| 5683 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5684 | -s "found renegotiation extension" \ |
| 5685 | -s "server hello, secure renegotiation extension" \ |
| 5686 | -s "record counter limit reached: renegotiate" \ |
| 5687 | -c "=> renegotiate" \ |
| 5688 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5689 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5690 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5691 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5692 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5693 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5694 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5695 | "$G_NEXT_SRV -u --mtu 4096" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5696 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5697 | 0 \ |
| 5698 | -c "client hello, adding renegotiation extension" \ |
| 5699 | -c "found renegotiation extension" \ |
| 5700 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5701 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5702 | -C "error" \ |
| 5703 | -s "Extra-header:" |
| 5704 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5705 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5706 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5707 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5708 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5710 | run_test "Renego ext: gnutls server strict, client default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5711 | "$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] | 5712 | "$P_CLI debug_level=3" \ |
| 5713 | 0 \ |
| 5714 | -c "found renegotiation extension" \ |
| 5715 | -C "error" \ |
| 5716 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5717 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5718 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5719 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5720 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5721 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5722 | "$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] | 5723 | "$P_CLI debug_level=3" \ |
| 5724 | 0 \ |
| 5725 | -C "found renegotiation extension" \ |
| 5726 | -C "error" \ |
| 5727 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5728 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5729 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5730 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5731 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5732 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5733 | "$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] | 5734 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 5735 | 1 \ |
| 5736 | -C "found renegotiation extension" \ |
| 5737 | -c "error" \ |
| 5738 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5739 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5740 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5741 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5742 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5743 | run_test "Renego ext: gnutls client strict, server default" \ |
| 5744 | "$P_SRV debug_level=3" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5745 | "$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] | 5746 | 0 \ |
| 5747 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5748 | -s "server hello, secure renegotiation extension" |
| 5749 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5750 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5751 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5752 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5753 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 5754 | "$P_SRV debug_level=3" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5755 | "$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] | 5756 | 0 \ |
| 5757 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5758 | -S "server hello, secure renegotiation extension" |
| 5759 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5760 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5761 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5762 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5763 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 5764 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5765 | "$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] | 5766 | 1 \ |
| 5767 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5768 | -S "server hello, secure renegotiation extension" |
| 5769 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5770 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 5771 | |
| 5772 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5773 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5774 | run_test "DER format: no trailing bytes" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5775 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der0.crt \ |
| 5776 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5777 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5778 | 0 \ |
| 5779 | -c "Handshake was completed" \ |
| 5780 | |
| 5781 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5782 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5783 | run_test "DER format: with a trailing zero byte" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5784 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der1a.crt \ |
| 5785 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5786 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5787 | 0 \ |
| 5788 | -c "Handshake was completed" \ |
| 5789 | |
| 5790 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5791 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5792 | run_test "DER format: with a trailing random byte" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5793 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der1b.crt \ |
| 5794 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5795 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5796 | 0 \ |
| 5797 | -c "Handshake was completed" \ |
| 5798 | |
| 5799 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5800 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5801 | run_test "DER format: with 2 trailing random bytes" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5802 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der2.crt \ |
| 5803 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5804 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5805 | 0 \ |
| 5806 | -c "Handshake was completed" \ |
| 5807 | |
| 5808 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5809 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5810 | run_test "DER format: with 4 trailing random bytes" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5811 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der4.crt \ |
| 5812 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5813 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5814 | 0 \ |
| 5815 | -c "Handshake was completed" \ |
| 5816 | |
| 5817 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5818 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5819 | run_test "DER format: with 8 trailing random bytes" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5820 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der8.crt \ |
| 5821 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5822 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5823 | 0 \ |
| 5824 | -c "Handshake was completed" \ |
| 5825 | |
| 5826 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5827 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5828 | run_test "DER format: with 9 trailing random bytes" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5829 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der9.crt \ |
| 5830 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5831 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5832 | 0 \ |
| 5833 | -c "Handshake was completed" \ |
| 5834 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5835 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 5836 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5837 | |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5838 | # The next 4 cases test the 3 auth modes with a badly signed server cert. |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5839 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5840 | run_test "Authentication: server badcert, client required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5841 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5842 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5843 | "$P_CLI debug_level=3 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5844 | 1 \ |
| 5845 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5846 | -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] | 5847 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5848 | -c "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5849 | -c "X509 - Certificate verification failed" |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5850 | # MBEDTLS_X509_BADCERT_NOT_TRUSTED -> MBEDTLS_SSL_ALERT_MSG_UNKNOWN_CA |
| 5851 | # We don't check that the server receives the alert because it might |
| 5852 | # detect that its write end of the connection is closed and abort |
| 5853 | # before reading the alert message. |
| 5854 | |
| 5855 | run_test "Authentication: server badcert, client required (1.2)" \ |
| 5856 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5857 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 5858 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=required" \ |
| 5859 | 1 \ |
| 5860 | -c "x509_verify_cert() returned" \ |
| 5861 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5862 | -c "! mbedtls_ssl_handshake returned" \ |
| 5863 | -c "send alert level=2 message=48" \ |
| 5864 | -c "X509 - Certificate verification failed" |
| 5865 | # MBEDTLS_X509_BADCERT_NOT_TRUSTED -> MBEDTLS_SSL_ALERT_MSG_UNKNOWN_CA |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5866 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5867 | run_test "Authentication: server badcert, client optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5868 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5869 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | e1cc926 | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 5870 | "$P_CLI force_version=tls13 debug_level=3 auth_mode=optional" \ |
| 5871 | 0 \ |
| 5872 | -c "x509_verify_cert() returned" \ |
| 5873 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5874 | -C "! mbedtls_ssl_handshake returned" \ |
| 5875 | -C "send alert level=2 message=48" \ |
| 5876 | -C "X509 - Certificate verification failed" |
| 5877 | |
| 5878 | run_test "Authentication: server badcert, client optional (1.2)" \ |
| 5879 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5880 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5881 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5882 | 0 \ |
| 5883 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5884 | -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] | 5885 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5886 | -C "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5887 | -C "X509 - Certificate verification failed" |
| 5888 | |
Manuel Pégourié-Gonnard | a3cf1a5 | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 5889 | run_test "Authentication: server badcert, client none" \ |
| 5890 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5891 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 2b98a4e | 2024-08-14 10:44:02 +0200 | [diff] [blame] | 5892 | "$P_CLI debug_level=3 auth_mode=none" \ |
| 5893 | 0 \ |
| 5894 | -C "x509_verify_cert() returned" \ |
| 5895 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5896 | -C "! mbedtls_ssl_handshake returned" \ |
| 5897 | -C "send alert level=2 message=48" \ |
| 5898 | -C "X509 - Certificate verification failed" |
| 5899 | |
| 5900 | run_test "Authentication: server badcert, client none (1.2)" \ |
| 5901 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5902 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5903 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=none" \ |
Manuel Pégourié-Gonnard | a3cf1a5 | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 5904 | 0 \ |
| 5905 | -C "x509_verify_cert() returned" \ |
| 5906 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5907 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5908 | -C "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | a3cf1a5 | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 5909 | -C "X509 - Certificate verification failed" |
| 5910 | |
Manuel Pégourié-Gonnard | a0a781e | 2024-08-14 10:34:53 +0200 | [diff] [blame] | 5911 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
| 5912 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 5913 | "$P_SRV" \ |
| 5914 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5915 | 1 \ |
| 5916 | -c "x509_verify_cert() returned" \ |
| 5917 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5918 | -c "! Certificate verification flags"\ |
| 5919 | -c "! mbedtls_ssl_handshake returned" \ |
| 5920 | -c "SSL - No CA Chain is set, but required to operate" |
| 5921 | |
| 5922 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 5923 | run_test "Authentication: server goodcert, client required, no trusted CA (1.2)" \ |
| 5924 | "$P_SRV force_version=tls12" \ |
| 5925 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5926 | 1 \ |
| 5927 | -c "x509_verify_cert() returned" \ |
| 5928 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5929 | -c "! Certificate verification flags"\ |
| 5930 | -c "! mbedtls_ssl_handshake returned" \ |
| 5931 | -c "SSL - No CA Chain is set, but required to operate" |
Manuel Pégourié-Gonnard | e1cc926 | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 5932 | |
| 5933 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5934 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 5935 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | e1cc926 | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 5936 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 5937 | 0 \ |
| 5938 | -c "x509_verify_cert() returned" \ |
| 5939 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5940 | -c "! Certificate verification flags"\ |
| 5941 | -C "! mbedtls_ssl_handshake returned" \ |
| 5942 | -C "X509 - Certificate verification failed" \ |
| 5943 | -C "SSL - No CA Chain is set, but required to operate" |
| 5944 | |
| 5945 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 5946 | run_test "Authentication: server goodcert, client optional, no trusted CA (1.2)" \ |
| 5947 | "$P_SRV" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5948 | "$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] | 5949 | 0 \ |
| 5950 | -c "x509_verify_cert() returned" \ |
| 5951 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5952 | -c "! Certificate verification flags"\ |
| 5953 | -C "! mbedtls_ssl_handshake returned" \ |
| 5954 | -C "X509 - Certificate verification failed" \ |
| 5955 | -C "SSL - No CA Chain is set, but required to operate" |
| 5956 | |
Manuel Pégourié-Gonnard | 2b98a4e | 2024-08-14 10:44:02 +0200 | [diff] [blame] | 5957 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
| 5958 | run_test "Authentication: server goodcert, client none, no trusted CA" \ |
| 5959 | "$P_SRV" \ |
| 5960 | "$P_CLI debug_level=3 auth_mode=none ca_file=none ca_path=none" \ |
| 5961 | 0 \ |
| 5962 | -C "x509_verify_cert() returned" \ |
| 5963 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5964 | -C "! Certificate verification flags"\ |
| 5965 | -C "! mbedtls_ssl_handshake returned" \ |
| 5966 | -C "X509 - Certificate verification failed" \ |
| 5967 | -C "SSL - No CA Chain is set, but required to operate" |
| 5968 | |
| 5969 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 5970 | run_test "Authentication: server goodcert, client none, no trusted CA (1.2)" \ |
| 5971 | "$P_SRV" \ |
| 5972 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=none ca_file=none ca_path=none" \ |
| 5973 | 0 \ |
| 5974 | -C "x509_verify_cert() returned" \ |
| 5975 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5976 | -C "! Certificate verification flags"\ |
| 5977 | -C "! mbedtls_ssl_handshake returned" \ |
| 5978 | -C "X509 - Certificate verification failed" \ |
| 5979 | -C "SSL - No CA Chain is set, but required to operate" |
Manuel Pégourié-Gonnard | 060e284 | 2024-08-05 11:10:47 +0200 | [diff] [blame] | 5980 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5981 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5982 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5983 | # the client informs the server about the supported curves - it does, though, in the |
| 5984 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5985 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5986 | # different means to have the server ignoring the client's supported curve list. |
| 5987 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5988 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5989 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 5990 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 5991 | "$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] | 5992 | 1 \ |
| 5993 | -c "bad certificate (EC key curve)"\ |
| 5994 | -c "! Certificate verification flags"\ |
| 5995 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5996 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5997 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5998 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 5999 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6000 | "$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] | 6001 | 1 \ |
| 6002 | -c "bad certificate (EC key curve)"\ |
| 6003 | -c "! Certificate verification flags"\ |
| 6004 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 6005 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6006 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6007 | run_test "Authentication: client SHA256, server required" \ |
| 6008 | "$P_SRV auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6009 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6010 | key_file=$DATA_FILES_PATH/server6.key \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6011 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 6012 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6013 | -c "Supported Signature Algorithm found: 04 " \ |
| 6014 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6015 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6016 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6017 | run_test "Authentication: client SHA384, server required" \ |
| 6018 | "$P_SRV auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6019 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6020 | key_file=$DATA_FILES_PATH/server6.key \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6021 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 6022 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6023 | -c "Supported Signature Algorithm found: 04 " \ |
| 6024 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6025 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6026 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6027 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 6028 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 6029 | "$P_CLI debug_level=3 crt_file=none \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6030 | key_file=$DATA_FILES_PATH/server5.key" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6031 | 1 \ |
| 6032 | -S "skip write certificate request" \ |
| 6033 | -C "skip parse certificate request" \ |
| 6034 | -c "got a certificate request" \ |
| 6035 | -c "= write certificate$" \ |
| 6036 | -C "skip write certificate$" \ |
| 6037 | -S "x509_verify_cert() returned" \ |
Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 6038 | -s "peer has no certificate" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6039 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6040 | -s "No client certification received from the client, but required by the authentication mode" |
| 6041 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6042 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6043 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6044 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6045 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6046 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6047 | 1 \ |
| 6048 | -S "skip write certificate request" \ |
| 6049 | -C "skip parse certificate request" \ |
| 6050 | -c "got a certificate request" \ |
| 6051 | -C "skip write certificate" \ |
| 6052 | -C "skip write certificate verify" \ |
| 6053 | -S "skip parse certificate verify" \ |
| 6054 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6055 | -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] | 6056 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 6057 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6058 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 6059 | # We don't check that the client receives the alert because it might |
| 6060 | # detect that its write end of the connection is closed and abort |
| 6061 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6062 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6063 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 6064 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6065 | "$P_SRV debug_level=3 auth_mode=required ca_file=$DATA_FILES_PATH/server5-selfsigned.crt" \ |
| 6066 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6067 | key_file=$DATA_FILES_PATH/server5.key" \ |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 6068 | 0 \ |
| 6069 | -S "skip write certificate request" \ |
| 6070 | -C "skip parse certificate request" \ |
| 6071 | -c "got a certificate request" \ |
| 6072 | -C "skip write certificate" \ |
| 6073 | -C "skip write certificate verify" \ |
| 6074 | -S "skip parse certificate verify" \ |
| 6075 | -S "x509_verify_cert() returned" \ |
| 6076 | -S "! The certificate is not correctly signed" \ |
| 6077 | -S "X509 - Certificate verification failed" |
| 6078 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6079 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6080 | run_test "Authentication: client cert not trusted, server required" \ |
| 6081 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6082 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6083 | key_file=$DATA_FILES_PATH/server5.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6084 | 1 \ |
| 6085 | -S "skip write certificate request" \ |
| 6086 | -C "skip parse certificate request" \ |
| 6087 | -c "got a certificate request" \ |
| 6088 | -C "skip write certificate" \ |
| 6089 | -C "skip write certificate verify" \ |
| 6090 | -S "skip parse certificate verify" \ |
| 6091 | -s "x509_verify_cert() returned" \ |
| 6092 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6093 | -s "! mbedtls_ssl_handshake returned" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6094 | -s "X509 - Certificate verification failed" |
| 6095 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6096 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6097 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6098 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6099 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6100 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6101 | 0 \ |
| 6102 | -S "skip write certificate request" \ |
| 6103 | -C "skip parse certificate request" \ |
| 6104 | -c "got a certificate request" \ |
| 6105 | -C "skip write certificate" \ |
| 6106 | -C "skip write certificate verify" \ |
| 6107 | -S "skip parse certificate verify" \ |
| 6108 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6109 | -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] | 6110 | -S "! mbedtls_ssl_handshake returned" \ |
| 6111 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6112 | -S "X509 - Certificate verification failed" |
| 6113 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6114 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6115 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6116 | "$P_SRV debug_level=3 auth_mode=none" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6117 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6118 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6119 | 0 \ |
| 6120 | -s "skip write certificate request" \ |
| 6121 | -C "skip parse certificate request" \ |
| 6122 | -c "got no certificate request" \ |
| 6123 | -c "skip write certificate" \ |
| 6124 | -c "skip write certificate verify" \ |
| 6125 | -s "skip parse certificate verify" \ |
| 6126 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6127 | -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] | 6128 | -S "! mbedtls_ssl_handshake returned" \ |
| 6129 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6130 | -S "X509 - Certificate verification failed" |
| 6131 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6132 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6133 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6134 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 6135 | "$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] | 6136 | 0 \ |
| 6137 | -S "skip write certificate request" \ |
| 6138 | -C "skip parse certificate request" \ |
| 6139 | -c "got a certificate request" \ |
| 6140 | -C "skip write certificate$" \ |
| 6141 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6142 | -c "skip write certificate verify" \ |
| 6143 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6144 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6145 | -S "! mbedtls_ssl_handshake returned" \ |
| 6146 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6147 | -S "X509 - Certificate verification failed" |
| 6148 | |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 6149 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6150 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6151 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6152 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6153 | "$O_NEXT_CLI_NO_CERT -no_middlebox" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6154 | 0 \ |
| 6155 | -S "skip write certificate request" \ |
| 6156 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6157 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6158 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6159 | -S "X509 - Certificate verification failed" |
| 6160 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6161 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6162 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6163 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6164 | "$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] | 6165 | 0 \ |
| 6166 | -C "skip parse certificate request" \ |
| 6167 | -c "got a certificate request" \ |
| 6168 | -C "skip write certificate$" \ |
| 6169 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6170 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6171 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6172 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6173 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6174 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6175 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 6176 | 1 \ |
| 6177 | -C "skip parse certificate request" \ |
| 6178 | -c "got a certificate request" \ |
| 6179 | -C "skip write certificate$" \ |
| 6180 | -c "skip write certificate verify" \ |
| 6181 | -c "! mbedtls_ssl_handshake returned" |
| 6182 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 6183 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 6184 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 6185 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 6186 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 6187 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 6188 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 6189 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 6190 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 6191 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 6192 | # 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] | 6193 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6194 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6195 | run_test "Authentication: server max_int chain, client default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6196 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6197 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
| 6198 | "$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] | 6199 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6200 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6201 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6202 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6203 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6204 | run_test "Authentication: server max_int+1 chain, client default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6205 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6206 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6207 | "$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] | 6208 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6209 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6210 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6211 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6212 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6213 | run_test "Authentication: server max_int+1 chain, client optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6214 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6215 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | e1cc926 | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 6216 | "$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] | 6217 | auth_mode=optional" \ |
| 6218 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6219 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6220 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6221 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6222 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6223 | run_test "Authentication: server max_int+1 chain, client none" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6224 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6225 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6226 | "$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] | 6227 | auth_mode=none" \ |
| 6228 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6229 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6230 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6231 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6232 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6233 | run_test "Authentication: client max_int+1 chain, server default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6234 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt" \ |
| 6235 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6236 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6237 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6238 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6239 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6240 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6241 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6242 | run_test "Authentication: client max_int+1 chain, server optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6243 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=optional" \ |
| 6244 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6245 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6246 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6247 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6248 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6249 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6250 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6251 | run_test "Authentication: client max_int+1 chain, server required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6252 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
| 6253 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6254 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6255 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6256 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6257 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6258 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6259 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6260 | run_test "Authentication: client max_int chain, server required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6261 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
| 6262 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6263 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6264 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6265 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6266 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6267 | # Tests for CA list in CertificateRequest messages |
| 6268 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6269 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6270 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 6271 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6272 | "$P_CLI force_version=tls12 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6273 | key_file=$DATA_FILES_PATH/server6.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6274 | 0 \ |
| 6275 | -s "requested DN" |
| 6276 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6277 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6278 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 6279 | "$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] | 6280 | "$P_CLI force_version=tls12 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6281 | key_file=$DATA_FILES_PATH/server6.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6282 | 0 \ |
| 6283 | -S "requested DN" |
| 6284 | |
| 6285 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6286 | "$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] | 6287 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6288 | key_file=$DATA_FILES_PATH/server5.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6289 | 1 \ |
| 6290 | -S "requested DN" \ |
| 6291 | -s "x509_verify_cert() returned" \ |
| 6292 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6293 | -s "! mbedtls_ssl_handshake returned" \ |
| 6294 | -c "! mbedtls_ssl_handshake returned" \ |
| 6295 | -s "X509 - Certificate verification failed" |
| 6296 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6297 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6298 | run_test "Authentication: send alt conf DN hints in CertificateRequest" \ |
| 6299 | "$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] | 6300 | crt_file2=$DATA_FILES_PATH/server1.crt \ |
| 6301 | key_file2=$DATA_FILES_PATH/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6302 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6303 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6304 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6305 | 0 \ |
| 6306 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 6307 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6308 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6309 | run_test "Authentication: send alt conf DN hints in CertificateRequest (2)" \ |
| 6310 | "$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] | 6311 | crt_file2=$DATA_FILES_PATH/server2.crt \ |
| 6312 | key_file2=$DATA_FILES_PATH/server2.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6313 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6314 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6315 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6316 | 0 \ |
| 6317 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" |
| 6318 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6319 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6320 | run_test "Authentication: send alt hs DN hints in CertificateRequest" \ |
| 6321 | "$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] | 6322 | crt_file2=$DATA_FILES_PATH/server1.crt \ |
| 6323 | key_file2=$DATA_FILES_PATH/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6324 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6325 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6326 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6327 | 0 \ |
| 6328 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 6329 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 6330 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 6331 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6332 | |
| 6333 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6334 | run_test "Authentication, CA callback: server badcert, client required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6335 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6336 | key_file=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6337 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6338 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6339 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6340 | -c "x509_verify_cert() returned" \ |
| 6341 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6342 | -c "! mbedtls_ssl_handshake returned" \ |
| 6343 | -c "X509 - Certificate verification failed" |
| 6344 | |
| 6345 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6346 | run_test "Authentication, CA callback: server badcert, client optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6347 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6348 | key_file=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6349 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6350 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6351 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6352 | -c "x509_verify_cert() returned" \ |
| 6353 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6354 | -C "! mbedtls_ssl_handshake returned" \ |
| 6355 | -C "X509 - Certificate verification failed" |
| 6356 | |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6357 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6358 | run_test "Authentication, CA callback: server badcert, client none" \ |
| 6359 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6360 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 6361 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=none" \ |
| 6362 | 0 \ |
| 6363 | -C "use CA callback for X.509 CRT verification" \ |
| 6364 | -C "x509_verify_cert() returned" \ |
| 6365 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6366 | -C "! mbedtls_ssl_handshake returned" \ |
| 6367 | -C "X509 - Certificate verification failed" |
| 6368 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6369 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 6370 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 6371 | # the client informs the server about the supported curves - it does, though, in the |
| 6372 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 6373 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 6374 | # different means to have the server ignoring the client's supported curve list. |
| 6375 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6376 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6377 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6378 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6379 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6380 | "$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] | 6381 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6382 | -c "use CA callback for X.509 CRT verification" \ |
| 6383 | -c "bad certificate (EC key curve)" \ |
| 6384 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6385 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 6386 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6387 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6388 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6389 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6390 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6391 | "$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] | 6392 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6393 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6394 | -c "bad certificate (EC key curve)"\ |
| 6395 | -c "! Certificate verification flags"\ |
| 6396 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 6397 | |
| 6398 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6399 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 84442a3 | 2024-04-03 08:57:09 +0200 | [diff] [blame] | 6400 | run_test "Authentication, CA callback: client SHA384, server required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6401 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6402 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6403 | key_file=$DATA_FILES_PATH/server6.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6404 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 6405 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6406 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6407 | -c "Supported Signature Algorithm found: 04 " \ |
| 6408 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6409 | |
| 6410 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6411 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 84442a3 | 2024-04-03 08:57:09 +0200 | [diff] [blame] | 6412 | run_test "Authentication, CA callback: client SHA256, server required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6413 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6414 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6415 | key_file=$DATA_FILES_PATH/server6.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6416 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 6417 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6418 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6419 | -c "Supported Signature Algorithm found: 04 " \ |
| 6420 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6421 | |
| 6422 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6423 | run_test "Authentication, CA callback: client badcert, server required" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6424 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6425 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6426 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6427 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6428 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6429 | -S "skip write certificate request" \ |
| 6430 | -C "skip parse certificate request" \ |
| 6431 | -c "got a certificate request" \ |
| 6432 | -C "skip write certificate" \ |
| 6433 | -C "skip write certificate verify" \ |
| 6434 | -S "skip parse certificate verify" \ |
| 6435 | -s "x509_verify_cert() returned" \ |
| 6436 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6437 | -s "! mbedtls_ssl_handshake returned" \ |
| 6438 | -s "send alert level=2 message=48" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6439 | -s "X509 - Certificate verification failed" |
| 6440 | # We don't check that the client receives the alert because it might |
| 6441 | # detect that its write end of the connection is closed and abort |
| 6442 | # before reading the alert message. |
| 6443 | |
| 6444 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6445 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6446 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6447 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6448 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6449 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6450 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6451 | -S "skip write certificate request" \ |
| 6452 | -C "skip parse certificate request" \ |
| 6453 | -c "got a certificate request" \ |
| 6454 | -C "skip write certificate" \ |
| 6455 | -C "skip write certificate verify" \ |
| 6456 | -S "skip parse certificate verify" \ |
| 6457 | -s "x509_verify_cert() returned" \ |
| 6458 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6459 | -s "! mbedtls_ssl_handshake returned" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6460 | -s "X509 - Certificate verification failed" |
| 6461 | |
| 6462 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6463 | run_test "Authentication, CA callback: client badcert, server optional" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6464 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6465 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6466 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6467 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6468 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6469 | -S "skip write certificate request" \ |
| 6470 | -C "skip parse certificate request" \ |
| 6471 | -c "got a certificate request" \ |
| 6472 | -C "skip write certificate" \ |
| 6473 | -C "skip write certificate verify" \ |
| 6474 | -S "skip parse certificate verify" \ |
| 6475 | -s "x509_verify_cert() returned" \ |
| 6476 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6477 | -S "! mbedtls_ssl_handshake returned" \ |
| 6478 | -C "! mbedtls_ssl_handshake returned" \ |
| 6479 | -S "X509 - Certificate verification failed" |
| 6480 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6481 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6482 | requires_full_size_output_buffer |
| 6483 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6484 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6485 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6486 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6487 | "$P_CLI 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] | 6488 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6489 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6490 | -C "X509 - A fatal error occurred" |
| 6491 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6492 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6493 | requires_full_size_output_buffer |
| 6494 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6495 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6496 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6497 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6498 | "$P_CLI 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] | 6499 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6500 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6501 | -c "X509 - A fatal error occurred" |
| 6502 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6503 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6504 | requires_full_size_output_buffer |
| 6505 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6506 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6507 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6508 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6509 | "$P_CLI 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] | 6510 | debug_level=3 auth_mode=optional" \ |
| 6511 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6512 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6513 | -c "X509 - A fatal error occurred" |
| 6514 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6515 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6516 | requires_full_size_output_buffer |
| 6517 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6518 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6519 | "$P_SRV ca_callback=1 debug_level=3 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6520 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6521 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6522 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6523 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6524 | -s "X509 - A fatal error occurred" |
| 6525 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6526 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6527 | requires_full_size_output_buffer |
| 6528 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6529 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6530 | "$P_SRV ca_callback=1 debug_level=3 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6531 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6532 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6533 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6534 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6535 | -s "X509 - A fatal error occurred" |
| 6536 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6537 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6538 | requires_full_size_output_buffer |
| 6539 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6540 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6541 | "$P_SRV ca_callback=1 debug_level=3 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6542 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6543 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6544 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6545 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6546 | -S "X509 - A fatal error occurred" |
| 6547 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 6548 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6549 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6550 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6551 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6552 | "$P_SRV force_version=tls12 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 6553 | key_file=$DATA_FILES_PATH/server5.key \ |
| 6554 | crt_file2=$DATA_FILES_PATH/server5-sha1.crt \ |
| 6555 | key_file2=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6556 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6557 | 0 \ |
| 6558 | -c "signed using.*ECDSA with SHA256" \ |
| 6559 | -C "signed using.*ECDSA with SHA1" |
| 6560 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6561 | # tests for SNI |
| 6562 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6563 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6564 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6565 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6566 | "$P_SRV debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6567 | 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] | 6568 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6569 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6570 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6571 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6572 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6573 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6574 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6575 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6576 | "$P_SRV debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6577 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6578 | 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] | 6579 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6580 | 0 \ |
| 6581 | -s "parse ServerName extension" \ |
| 6582 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6583 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6584 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6585 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6586 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6587 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6588 | "$P_SRV debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6589 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6590 | 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] | 6591 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6592 | 0 \ |
| 6593 | -s "parse ServerName extension" \ |
| 6594 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6595 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6596 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6597 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6598 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6599 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6600 | "$P_SRV debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6601 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6602 | 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] | 6603 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6604 | 1 \ |
| 6605 | -s "parse ServerName extension" \ |
| 6606 | -s "ssl_sni_wrapper() returned" \ |
| 6607 | -s "mbedtls_ssl_handshake returned" \ |
| 6608 | -c "mbedtls_ssl_handshake returned" \ |
| 6609 | -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] | 6610 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6611 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6612 | run_test "SNI: client auth no override: optional" \ |
| 6613 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6614 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6615 | 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] | 6616 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6617 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6618 | -S "skip write certificate request" \ |
| 6619 | -C "skip parse certificate request" \ |
| 6620 | -c "got a certificate request" \ |
| 6621 | -C "skip write certificate" \ |
| 6622 | -C "skip write certificate verify" \ |
| 6623 | -S "skip parse certificate verify" |
| 6624 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6625 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6626 | run_test "SNI: client auth override: none -> optional" \ |
| 6627 | "$P_SRV debug_level=3 auth_mode=none \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6628 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6629 | 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] | 6630 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6631 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6632 | -S "skip write certificate request" \ |
| 6633 | -C "skip parse certificate request" \ |
| 6634 | -c "got a certificate request" \ |
| 6635 | -C "skip write certificate" \ |
| 6636 | -C "skip write certificate verify" \ |
| 6637 | -S "skip parse certificate verify" |
| 6638 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6639 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6640 | run_test "SNI: client auth override: optional -> none" \ |
| 6641 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6642 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6643 | 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] | 6644 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6645 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6646 | -s "skip write certificate request" \ |
| 6647 | -C "skip parse certificate request" \ |
| 6648 | -c "got no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 6649 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6650 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6651 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6652 | run_test "SNI: CA no override" \ |
| 6653 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6654 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6655 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6656 | 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] | 6657 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6658 | 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] | 6659 | 1 \ |
| 6660 | -S "skip write certificate request" \ |
| 6661 | -C "skip parse certificate request" \ |
| 6662 | -c "got a certificate request" \ |
| 6663 | -C "skip write certificate" \ |
| 6664 | -C "skip write certificate verify" \ |
| 6665 | -S "skip parse certificate verify" \ |
| 6666 | -s "x509_verify_cert() returned" \ |
| 6667 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6668 | -S "The certificate has been revoked (is on a CRL)" |
| 6669 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6670 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6671 | run_test "SNI: CA override" \ |
| 6672 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6673 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6674 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6675 | 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] | 6676 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6677 | 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] | 6678 | 0 \ |
| 6679 | -S "skip write certificate request" \ |
| 6680 | -C "skip parse certificate request" \ |
| 6681 | -c "got a certificate request" \ |
| 6682 | -C "skip write certificate" \ |
| 6683 | -C "skip write certificate verify" \ |
| 6684 | -S "skip parse certificate verify" \ |
| 6685 | -S "x509_verify_cert() returned" \ |
| 6686 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6687 | -S "The certificate has been revoked (is on a CRL)" |
| 6688 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6689 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6690 | run_test "SNI: CA override with CRL" \ |
| 6691 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6692 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6693 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6694 | 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] | 6695 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6696 | 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] | 6697 | 1 \ |
| 6698 | -S "skip write certificate request" \ |
| 6699 | -C "skip parse certificate request" \ |
| 6700 | -c "got a certificate request" \ |
| 6701 | -C "skip write certificate" \ |
| 6702 | -C "skip write certificate verify" \ |
| 6703 | -S "skip parse certificate verify" \ |
| 6704 | -s "x509_verify_cert() returned" \ |
| 6705 | -S "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 4192bba | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6706 | -s "send alert level=2 message=44" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6707 | -s "The certificate has been revoked (is on a CRL)" |
Manuel Pégourié-Gonnard | 4192bba | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6708 | # MBEDTLS_X509_BADCERT_REVOKED -> MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6709 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6710 | # Tests for SNI and DTLS |
| 6711 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6712 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6714 | run_test "SNI: DTLS, no SNI callback" \ |
| 6715 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6716 | 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] | 6717 | "$P_CLI server_name=localhost dtls=1" \ |
| 6718 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6719 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6720 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6721 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6722 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
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, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6725 | "$P_SRV debug_level=3 dtls=1 \ |
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 \ |
| 6727 | 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] | 6728 | "$P_CLI server_name=localhost dtls=1" \ |
| 6729 | 0 \ |
| 6730 | -s "parse ServerName extension" \ |
| 6731 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6732 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6733 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6734 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6735 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6736 | run_test "SNI: DTLS, matching cert 2" \ |
| 6737 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6738 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6739 | 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] | 6740 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 6741 | 0 \ |
| 6742 | -s "parse ServerName extension" \ |
| 6743 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6744 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6745 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6746 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6747 | run_test "SNI: DTLS, no matching cert" \ |
| 6748 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6749 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6750 | 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] | 6751 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 6752 | 1 \ |
| 6753 | -s "parse ServerName extension" \ |
| 6754 | -s "ssl_sni_wrapper() returned" \ |
| 6755 | -s "mbedtls_ssl_handshake returned" \ |
| 6756 | -c "mbedtls_ssl_handshake returned" \ |
| 6757 | -c "SSL - A fatal alert message was received from our peer" |
| 6758 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6759 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6760 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 6761 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6762 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6763 | 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] | 6764 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6765 | 0 \ |
| 6766 | -S "skip write certificate request" \ |
| 6767 | -C "skip parse certificate request" \ |
| 6768 | -c "got a certificate request" \ |
| 6769 | -C "skip write certificate" \ |
| 6770 | -C "skip write certificate verify" \ |
| 6771 | -S "skip parse certificate verify" |
| 6772 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6773 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6774 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 6775 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6776 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6777 | 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] | 6778 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6779 | 0 \ |
| 6780 | -S "skip write certificate request" \ |
| 6781 | -C "skip parse certificate request" \ |
| 6782 | -c "got a certificate request" \ |
| 6783 | -C "skip write certificate" \ |
| 6784 | -C "skip write certificate verify" \ |
| 6785 | -S "skip parse certificate verify" |
| 6786 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6787 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6788 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 6789 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6790 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6791 | 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] | 6792 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6793 | 0 \ |
| 6794 | -s "skip write certificate request" \ |
| 6795 | -C "skip parse certificate request" \ |
| 6796 | -c "got no certificate request" \ |
| 6797 | -c "skip write certificate" \ |
| 6798 | -c "skip write certificate verify" \ |
| 6799 | -s "skip parse certificate verify" |
| 6800 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6801 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6802 | run_test "SNI: DTLS, CA no override" \ |
| 6803 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6804 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6805 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6806 | 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] | 6807 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6808 | 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] | 6809 | 1 \ |
| 6810 | -S "skip write certificate request" \ |
| 6811 | -C "skip parse certificate request" \ |
| 6812 | -c "got a certificate request" \ |
| 6813 | -C "skip write certificate" \ |
| 6814 | -C "skip write certificate verify" \ |
| 6815 | -S "skip parse certificate verify" \ |
| 6816 | -s "x509_verify_cert() returned" \ |
| 6817 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6818 | -S "The certificate has been revoked (is on a CRL)" |
| 6819 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6821 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6822 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6823 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6824 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6825 | 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] | 6826 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6827 | 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] | 6828 | 0 \ |
| 6829 | -S "skip write certificate request" \ |
| 6830 | -C "skip parse certificate request" \ |
| 6831 | -c "got a certificate request" \ |
| 6832 | -C "skip write certificate" \ |
| 6833 | -C "skip write certificate verify" \ |
| 6834 | -S "skip parse certificate verify" \ |
| 6835 | -S "x509_verify_cert() returned" \ |
| 6836 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6837 | -S "The certificate has been revoked (is on a CRL)" |
| 6838 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6839 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6840 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6841 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6842 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key dtls=1 \ |
| 6843 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6844 | 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] | 6845 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6846 | 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] | 6847 | 1 \ |
| 6848 | -S "skip write certificate request" \ |
| 6849 | -C "skip parse certificate request" \ |
| 6850 | -c "got a certificate request" \ |
| 6851 | -C "skip write certificate" \ |
| 6852 | -C "skip write certificate verify" \ |
| 6853 | -S "skip parse certificate verify" \ |
| 6854 | -s "x509_verify_cert() returned" \ |
| 6855 | -S "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 4192bba | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6856 | -s "send alert level=2 message=44" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6857 | -s "The certificate has been revoked (is on a CRL)" |
Manuel Pégourié-Gonnard | 4192bba | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6858 | # MBEDTLS_X509_BADCERT_REVOKED -> MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6859 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6860 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 6861 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6862 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6863 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6864 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6865 | "$P_CLI nbio=2 tickets=0" \ |
| 6866 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6867 | -S "mbedtls_ssl_handshake returned" \ |
| 6868 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6869 | -c "Read from server: .* bytes read" |
| 6870 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6871 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6872 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6873 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 6874 | "$P_CLI nbio=2 tickets=0" \ |
| 6875 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6876 | -S "mbedtls_ssl_handshake returned" \ |
| 6877 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6878 | -c "Read from server: .* bytes read" |
| 6879 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6880 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6881 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6882 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6883 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 6884 | "$P_CLI nbio=2 tickets=1 new_session_tickets=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6885 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6886 | -S "mbedtls_ssl_handshake returned" \ |
| 6887 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6888 | -c "Read from server: .* bytes read" |
| 6889 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6890 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6891 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6892 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6893 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 6894 | "$P_CLI nbio=2 tickets=1 new_session_tickets=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6895 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6896 | -S "mbedtls_ssl_handshake returned" \ |
| 6897 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6898 | -c "Read from server: .* bytes read" |
| 6899 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6900 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6901 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6902 | 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] | 6903 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6904 | "$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] | 6905 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6906 | -S "mbedtls_ssl_handshake returned" \ |
| 6907 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6908 | -c "Read from server: .* bytes read" |
| 6909 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6910 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6911 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6912 | 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] | 6913 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6914 | run_test "Non-blocking I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 6915 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 6916 | "$P_CLI nbio=2 tickets=1 new_session_tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6917 | 0 \ |
| 6918 | -S "mbedtls_ssl_handshake returned" \ |
| 6919 | -C "mbedtls_ssl_handshake returned" \ |
| 6920 | -c "Read from server: .* bytes read" |
| 6921 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6922 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6923 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6924 | 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] | 6925 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6926 | "$P_CLI force_version=tls12 nbio=2 tickets=1 reconnect=1" \ |
| 6927 | 0 \ |
| 6928 | -S "mbedtls_ssl_handshake returned" \ |
| 6929 | -C "mbedtls_ssl_handshake returned" \ |
| 6930 | -c "Read from server: .* bytes read" |
| 6931 | |
| 6932 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6933 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6934 | 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] | 6935 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6936 | run_test "Non-blocking I/O: TLS 1.3 + ticket + resume" \ |
| 6937 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 6938 | "$P_CLI nbio=2 tickets=1 new_session_tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6939 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6940 | -S "mbedtls_ssl_handshake returned" \ |
| 6941 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6942 | -c "Read from server: .* bytes read" |
| 6943 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6944 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6945 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6946 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6947 | "$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] | 6948 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6949 | -S "mbedtls_ssl_handshake returned" \ |
| 6950 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6951 | -c "Read from server: .* bytes read" |
| 6952 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6953 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 6954 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6955 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6956 | run_test "Event-driven I/O: basic handshake" \ |
| 6957 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6958 | "$P_CLI event=1 tickets=0" \ |
| 6959 | 0 \ |
| 6960 | -S "mbedtls_ssl_handshake returned" \ |
| 6961 | -C "mbedtls_ssl_handshake returned" \ |
| 6962 | -c "Read from server: .* bytes read" |
| 6963 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6964 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6965 | run_test "Event-driven I/O: client auth" \ |
| 6966 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 6967 | "$P_CLI event=1 tickets=0" \ |
| 6968 | 0 \ |
| 6969 | -S "mbedtls_ssl_handshake returned" \ |
| 6970 | -C "mbedtls_ssl_handshake returned" \ |
| 6971 | -c "Read from server: .* bytes read" |
| 6972 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6973 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6974 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6975 | run_test "Event-driven I/O: ticket" \ |
| 6976 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 6977 | "$P_CLI event=1 tickets=1 new_session_tickets=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6978 | 0 \ |
| 6979 | -S "mbedtls_ssl_handshake returned" \ |
| 6980 | -C "mbedtls_ssl_handshake returned" \ |
| 6981 | -c "Read from server: .* bytes read" |
| 6982 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6983 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6984 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6985 | run_test "Event-driven I/O: ticket + client auth" \ |
| 6986 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 6987 | "$P_CLI event=1 tickets=1 new_session_tickets=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6988 | 0 \ |
| 6989 | -S "mbedtls_ssl_handshake returned" \ |
| 6990 | -C "mbedtls_ssl_handshake returned" \ |
| 6991 | -c "Read from server: .* bytes read" |
| 6992 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6993 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6994 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6995 | 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] | 6996 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6997 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6998 | 0 \ |
| 6999 | -S "mbedtls_ssl_handshake returned" \ |
| 7000 | -C "mbedtls_ssl_handshake returned" \ |
| 7001 | -c "Read from server: .* bytes read" |
| 7002 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7003 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7004 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 7005 | 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] | 7006 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7007 | run_test "Event-driven I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 7008 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 7009 | "$P_CLI event=1 tickets=1 new_session_tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7010 | 0 \ |
| 7011 | -S "mbedtls_ssl_handshake returned" \ |
| 7012 | -C "mbedtls_ssl_handshake returned" \ |
| 7013 | -c "Read from server: .* bytes read" |
| 7014 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7015 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7016 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7017 | run_test "Event-driven I/O: TLS 1.2 + ticket + resume" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7018 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7019 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
| 7020 | 0 \ |
| 7021 | -S "mbedtls_ssl_handshake returned" \ |
| 7022 | -C "mbedtls_ssl_handshake returned" \ |
| 7023 | -c "Read from server: .* bytes read" |
| 7024 | |
| 7025 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7026 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 7027 | 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] | 7028 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7029 | run_test "Event-driven I/O: TLS 1.3 + ticket + resume" \ |
| 7030 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 7031 | "$P_CLI event=1 tickets=1 new_session_tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7032 | 0 \ |
| 7033 | -S "mbedtls_ssl_handshake returned" \ |
| 7034 | -C "mbedtls_ssl_handshake returned" \ |
| 7035 | -c "Read from server: .* bytes read" |
| 7036 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7037 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7038 | run_test "Event-driven I/O: session-id resume" \ |
| 7039 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 7040 | "$P_CLI force_version=tls12 event=1 tickets=0 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7041 | 0 \ |
| 7042 | -S "mbedtls_ssl_handshake returned" \ |
| 7043 | -C "mbedtls_ssl_handshake returned" \ |
| 7044 | -c "Read from server: .* bytes read" |
| 7045 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7046 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7047 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 7048 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 7049 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 7050 | 0 \ |
| 7051 | -c "Read from server: .* bytes read" |
| 7052 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7053 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7054 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 7055 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 7056 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 7057 | 0 \ |
| 7058 | -c "Read from server: .* bytes read" |
| 7059 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7060 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7061 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7062 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 7063 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 7064 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 7065 | 0 \ |
| 7066 | -c "Read from server: .* bytes read" |
| 7067 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7068 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7069 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7070 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 7071 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 7072 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 7073 | 0 \ |
| 7074 | -c "Read from server: .* bytes read" |
| 7075 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7076 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7077 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7078 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 7079 | "$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] | 7080 | "$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] | 7081 | 0 \ |
| 7082 | -c "Read from server: .* bytes read" |
| 7083 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7084 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7085 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7086 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 7087 | "$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] | 7088 | "$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] | 7089 | 0 \ |
| 7090 | -c "Read from server: .* bytes read" |
| 7091 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7092 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7093 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 7094 | "$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] | 7095 | "$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] | 7096 | 0 \ |
| 7097 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7098 | |
| 7099 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 7100 | # During session resumption, the client will send its ApplicationData record |
| 7101 | # within the same datagram as the Finished messages. In this situation, the |
| 7102 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 7103 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7104 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7105 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7106 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7107 | "$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] | 7108 | "$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] | 7109 | 0 \ |
| 7110 | -c "Read from server: .* bytes read" |
| 7111 | |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7112 | # Tests for version negotiation. Some information to ease the understanding |
| 7113 | # of the version negotiation test titles below: |
| 7114 | # . 1.2/1.3 means that only TLS 1.2/TLS 1.3 is enabled. |
| 7115 | # . 1.2+1.3 means that both TLS 1.2 and TLS 1.3 are enabled. |
| 7116 | # . 1.2+(1.3)/(1.2)+1.3 means that TLS 1.2/1.3 is enabled and that |
| 7117 | # TLS 1.3/1.2 may be enabled or not. |
| 7118 | # . max=1.2 means that both TLS 1.2 and TLS 1.3 are enabled at build time but |
| 7119 | # TLS 1.3 is disabled at runtime (maximum negotiable version is TLS 1.2). |
| 7120 | # . min=1.3 means that both TLS 1.2 and TLS 1.3 are enabled at build time but |
| 7121 | # TLS 1.2 is disabled at runtime (minimum negotiable version is TLS 1.3). |
| 7122 | |
Ronald Cron | fe18d8d | 2024-03-06 15:19:55 +0100 | [diff] [blame] | 7123 | # Tests for version negotiation, MbedTLS client and server |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7124 | |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7125 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C |
| 7126 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7127 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7128 | 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] | 7129 | "$P_SRV" \ |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7130 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7131 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7132 | -S "mbedtls_ssl_handshake returned" \ |
| 7133 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7134 | -s "Protocol is TLSv1.2" \ |
| 7135 | -c "Protocol is TLSv1.2" |
| 7136 | |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7137 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7138 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7139 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7140 | 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] | 7141 | "$P_SRV max_version=tls12" \ |
| 7142 | "$P_CLI max_version=tls12" \ |
| 7143 | 0 \ |
| 7144 | -S "mbedtls_ssl_handshake returned" \ |
| 7145 | -C "mbedtls_ssl_handshake returned" \ |
| 7146 | -s "Protocol is TLSv1.2" \ |
| 7147 | -c "Protocol is TLSv1.2" |
| 7148 | |
| 7149 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7150 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 7151 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7152 | 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] | 7153 | "$P_SRV" \ |
| 7154 | "$P_CLI" \ |
| 7155 | 0 \ |
| 7156 | -S "mbedtls_ssl_handshake returned" \ |
| 7157 | -C "mbedtls_ssl_handshake returned" \ |
| 7158 | -s "Protocol is TLSv1.3" \ |
| 7159 | -c "Protocol is TLSv1.3" |
| 7160 | |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7161 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7162 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7163 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7164 | 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] | 7165 | "$P_SRV min_version=tls13" \ |
| 7166 | "$P_CLI min_version=tls13" \ |
| 7167 | 0 \ |
| 7168 | -S "mbedtls_ssl_handshake returned" \ |
| 7169 | -C "mbedtls_ssl_handshake returned" \ |
| 7170 | -s "Protocol is TLSv1.3" \ |
| 7171 | -c "Protocol is TLSv1.3" |
| 7172 | |
| 7173 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7174 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7175 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7176 | 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] | 7177 | "$P_SRV" \ |
| 7178 | "$P_CLI" \ |
| 7179 | 0 \ |
| 7180 | -S "mbedtls_ssl_handshake returned" \ |
| 7181 | -C "mbedtls_ssl_handshake returned" \ |
| 7182 | -s "Protocol is TLSv1.3" \ |
| 7183 | -c "Protocol is TLSv1.3" |
| 7184 | |
| 7185 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7186 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7187 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7188 | 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] | 7189 | "$P_SRV min_version=tls13" \ |
| 7190 | "$P_CLI" \ |
| 7191 | 0 \ |
| 7192 | -S "mbedtls_ssl_handshake returned" \ |
| 7193 | -C "mbedtls_ssl_handshake returned" \ |
| 7194 | -s "Protocol is TLSv1.3" \ |
| 7195 | -c "Protocol is TLSv1.3" |
| 7196 | |
| 7197 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7198 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7199 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7200 | 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] | 7201 | "$P_SRV max_version=tls12" \ |
| 7202 | "$P_CLI" \ |
| 7203 | 0 \ |
| 7204 | -S "mbedtls_ssl_handshake returned" \ |
| 7205 | -C "mbedtls_ssl_handshake returned" \ |
| 7206 | -s "Protocol is TLSv1.2" \ |
| 7207 | -c "Protocol is TLSv1.2" |
| 7208 | |
| 7209 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7210 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7211 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7212 | 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] | 7213 | "$P_SRV" \ |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7214 | "$P_CLI max_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7215 | 0 \ |
| 7216 | -S "mbedtls_ssl_handshake returned" \ |
| 7217 | -C "mbedtls_ssl_handshake returned" \ |
| 7218 | -s "Protocol is TLSv1.2" \ |
| 7219 | -c "Protocol is TLSv1.2" |
| 7220 | |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7221 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7222 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7223 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7224 | 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] | 7225 | "$P_SRV" \ |
| 7226 | "$P_CLI min_version=tls13" \ |
| 7227 | 0 \ |
| 7228 | -S "mbedtls_ssl_handshake returned" \ |
| 7229 | -C "mbedtls_ssl_handshake returned" \ |
| 7230 | -s "Protocol is TLSv1.3" \ |
| 7231 | -c "Protocol is TLSv1.3" |
| 7232 | |
| 7233 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7234 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7235 | 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] | 7236 | "$P_SRV min_version=tls13" \ |
| 7237 | "$P_CLI max_version=tls12" \ |
| 7238 | 1 \ |
| 7239 | -s "Handshake protocol not within min/max boundaries" \ |
| 7240 | -S "Protocol is TLSv1.2" \ |
| 7241 | -C "Protocol is TLSv1.2" \ |
| 7242 | -S "Protocol is TLSv1.3" \ |
| 7243 | -C "Protocol is TLSv1.3" |
Ronald Cron | fe18d8d | 2024-03-06 15:19:55 +0100 | [diff] [blame] | 7244 | |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7245 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7246 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7247 | 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] | 7248 | "$P_SRV max_version=tls12" \ |
| 7249 | "$P_CLI min_version=tls13" \ |
| 7250 | 1 \ |
| 7251 | -s "The handshake negotiation failed" \ |
| 7252 | -S "Protocol is TLSv1.2" \ |
| 7253 | -C "Protocol is TLSv1.2" \ |
| 7254 | -S "Protocol is TLSv1.3" \ |
| 7255 | -C "Protocol is TLSv1.3" |
| 7256 | |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7257 | # Tests of version negotiation on server side against GnuTLS client |
| 7258 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7259 | 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] | 7260 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7261 | 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] | 7262 | "$P_SRV" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7263 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7264 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7265 | -S "mbedtls_ssl_handshake returned" \ |
| 7266 | -s "Protocol is TLSv1.2" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7267 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7268 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7269 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7270 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7271 | 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] | 7272 | "$P_SRV max_version=tls12" \ |
| 7273 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7274 | 0 \ |
| 7275 | -S "mbedtls_ssl_handshake returned" \ |
| 7276 | -s "Protocol is TLSv1.2" |
| 7277 | |
| 7278 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7279 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7280 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7281 | 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] | 7282 | "$P_SRV" \ |
| 7283 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7284 | 0 \ |
| 7285 | -S "mbedtls_ssl_handshake returned" \ |
| 7286 | -s "Protocol is TLSv1.3" |
| 7287 | |
| 7288 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7289 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7290 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7291 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7292 | 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] | 7293 | "$P_SRV min_version=tls13" \ |
| 7294 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7295 | 0 \ |
| 7296 | -S "mbedtls_ssl_handshake returned" \ |
| 7297 | -s "Protocol is TLSv1.3" |
| 7298 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7299 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7300 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7301 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7302 | 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] | 7303 | "$P_SRV" \ |
| 7304 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7305 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7306 | -S "mbedtls_ssl_handshake returned" \ |
| 7307 | -s "Protocol is TLSv1.3" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7308 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7309 | requires_gnutls_next_disable_tls13_compat |
| 7310 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7311 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7312 | 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] | 7313 | "$P_SRV" \ |
| 7314 | "$G_NEXT_CLI localhost --priority=NORMAL:%DISABLE_TLS13_COMPAT_MODE" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7315 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7316 | -S "mbedtls_ssl_handshake returned" \ |
| 7317 | -s "Protocol is TLSv1.3" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7318 | |
| 7319 | # GnuTLS can be setup to send a ClientHello containing a supported versions |
| 7320 | # extension proposing TLS 1.2 (preferred) and then TLS 1.3. In that case, |
| 7321 | # a TLS 1.3 and TLS 1.2 capable server is supposed to negotiate TLS 1.2 and |
| 7322 | # to indicate in the ServerHello that it downgrades from TLS 1.3. The GnuTLS |
| 7323 | # client then detects the downgrade indication and aborts the handshake even |
| 7324 | # if TLS 1.2 was its preferred version. Keeping the test even if the |
| 7325 | # handshake fails eventually as it exercices parts of the Mbed TLS |
| 7326 | # implementation that are otherwise not exercised. |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7327 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7328 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7329 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7330 | 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] | 7331 | "$P_SRV" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7332 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3" \ |
| 7333 | 1 \ |
| 7334 | -c "Detected downgrade to TLS 1.2 from TLS 1.3" |
| 7335 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 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 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] | 7341 | "$P_SRV min_version=tls13" \ |
| 7342 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7343 | 0 \ |
| 7344 | -S "mbedtls_ssl_handshake returned" \ |
| 7345 | -s "Protocol is TLSv1.3" |
| 7346 | |
| 7347 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7348 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7349 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7350 | 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] | 7351 | "$P_SRV" \ |
| 7352 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7353 | 0 \ |
| 7354 | -S "mbedtls_ssl_handshake returned" \ |
| 7355 | -s "Protocol is TLSv1.2" |
| 7356 | |
| 7357 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7358 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7359 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7360 | 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] | 7361 | "$P_SRV max_version=tls12" \ |
| 7362 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7363 | 0 \ |
| 7364 | -S "mbedtls_ssl_handshake returned" \ |
| 7365 | -s "Protocol is TLSv1.2" |
| 7366 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7367 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7368 | 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] | 7369 | "$P_SRV" \ |
| 7370 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 7371 | 1 \ |
| 7372 | -s "Handshake protocol not within min/max boundaries" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7373 | -S "Protocol is TLSv1.0" |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7374 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7375 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7376 | 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] | 7377 | "$P_SRV" \ |
| 7378 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 7379 | 1 \ |
| 7380 | -s "Handshake protocol not within min/max boundaries" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7381 | -S "Protocol is TLSv1.1" |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7382 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7383 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7384 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7385 | 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] | 7386 | "$P_SRV" \ |
| 7387 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7388 | 1 \ |
| 7389 | -s "Handshake protocol not within min/max boundaries" \ |
| 7390 | -S "Protocol is TLSv1.2" |
| 7391 | |
| 7392 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7393 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7394 | 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] | 7395 | "$P_SRV" \ |
| 7396 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7397 | 1 \ |
| 7398 | -S "Handshake protocol not within min/max boundaries" \ |
| 7399 | -s "The handshake negotiation failed" \ |
| 7400 | -S "Protocol is TLSv1.3" |
| 7401 | |
| 7402 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7403 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7404 | 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] | 7405 | "$P_SRV min_version=tls13" \ |
| 7406 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7407 | 1 \ |
| 7408 | -s "Handshake protocol not within min/max boundaries" \ |
| 7409 | -S "Protocol is TLSv1.2" |
| 7410 | |
| 7411 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7412 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7413 | 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] | 7414 | "$P_SRV max_version=tls12" \ |
| 7415 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7416 | 1 \ |
| 7417 | -S "Handshake protocol not within min/max boundaries" \ |
| 7418 | -s "The handshake negotiation failed" \ |
| 7419 | -S "Protocol is TLSv1.3" |
| 7420 | |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7421 | # Tests of version negotiation on server side against OpenSSL client |
| 7422 | |
| 7423 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_2 |
| 7424 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7425 | 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] | 7426 | "$P_SRV" \ |
| 7427 | "$O_NEXT_CLI -tls1_2" \ |
| 7428 | 0 \ |
| 7429 | -S "mbedtls_ssl_handshake returned" \ |
| 7430 | -s "Protocol is TLSv1.2" |
| 7431 | |
| 7432 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7433 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7434 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7435 | 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] | 7436 | "$P_SRV max_version=tls12" \ |
| 7437 | "$O_NEXT_CLI -tls1_2" \ |
| 7438 | 0 \ |
| 7439 | -S "mbedtls_ssl_handshake returned" \ |
| 7440 | -s "Protocol is TLSv1.2" |
| 7441 | |
| 7442 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7443 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7444 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7445 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7446 | 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] | 7447 | "$P_SRV" \ |
| 7448 | "$O_NEXT_CLI -tls1_3" \ |
| 7449 | 0 \ |
| 7450 | -S "mbedtls_ssl_handshake returned" \ |
| 7451 | -s "Protocol is TLSv1.3" |
| 7452 | |
| 7453 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7454 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7455 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7456 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7457 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7458 | 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] | 7459 | "$P_SRV min_version=tls13" \ |
| 7460 | "$O_NEXT_CLI -tls1_3" \ |
| 7461 | 0 \ |
| 7462 | -S "mbedtls_ssl_handshake returned" \ |
| 7463 | -s "Protocol is TLSv1.3" |
| 7464 | |
| 7465 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7466 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7467 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7468 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7469 | 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] | 7470 | "$P_SRV" \ |
| 7471 | "$O_NEXT_CLI" \ |
| 7472 | 0 \ |
| 7473 | -S "mbedtls_ssl_handshake returned" \ |
| 7474 | -s "Protocol is TLSv1.3" |
| 7475 | |
| 7476 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7477 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7478 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7479 | 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] | 7480 | "$P_SRV" \ |
| 7481 | "$O_NEXT_CLI -no_middlebox" \ |
| 7482 | 0 \ |
| 7483 | -S "mbedtls_ssl_handshake returned" \ |
| 7484 | -s "Protocol is TLSv1.3" |
| 7485 | |
| 7486 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7487 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7488 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7489 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7490 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7491 | 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] | 7492 | "$P_SRV min_version=tls13" \ |
| 7493 | "$O_NEXT_CLI" \ |
| 7494 | 0 \ |
| 7495 | -S "mbedtls_ssl_handshake returned" \ |
| 7496 | -s "Protocol is TLSv1.3" |
| 7497 | |
| 7498 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7499 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7500 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7501 | 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] | 7502 | "$P_SRV" \ |
| 7503 | "$O_NEXT_CLI" \ |
| 7504 | 0 \ |
| 7505 | -S "mbedtls_ssl_handshake returned" \ |
| 7506 | -s "Protocol is TLSv1.2" |
| 7507 | |
| 7508 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7509 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7510 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7511 | 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] | 7512 | "$P_SRV max_version=tls12" \ |
| 7513 | "$O_NEXT_CLI" \ |
| 7514 | 0 \ |
| 7515 | -S "mbedtls_ssl_handshake returned" \ |
| 7516 | -s "Protocol is TLSv1.2" |
| 7517 | |
| 7518 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7519 | 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] | 7520 | "$P_SRV" \ |
| 7521 | "$O_CLI -tls1" \ |
| 7522 | 1 \ |
| 7523 | -s "Handshake protocol not within min/max boundaries" \ |
| 7524 | -S "Protocol is TLSv1.0" |
| 7525 | |
| 7526 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7527 | 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] | 7528 | "$P_SRV" \ |
| 7529 | "$O_CLI -tls1_1" \ |
| 7530 | 1 \ |
| 7531 | -s "Handshake protocol not within min/max boundaries" \ |
| 7532 | -S "Protocol is TLSv1.1" |
| 7533 | |
| 7534 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7535 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7536 | 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] | 7537 | "$P_SRV" \ |
| 7538 | "$O_NEXT_CLI -tls1_2" \ |
| 7539 | 1 \ |
| 7540 | -s "Handshake protocol not within min/max boundaries" \ |
| 7541 | -S "Protocol is TLSv1.2" |
| 7542 | |
| 7543 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7544 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7545 | 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] | 7546 | "$P_SRV" \ |
| 7547 | "$O_NEXT_CLI -tls1_3" \ |
| 7548 | 1 \ |
| 7549 | -S "Handshake protocol not within min/max boundaries" \ |
| 7550 | -s "The handshake negotiation failed" \ |
| 7551 | -S "Protocol is TLSv1.3" |
| 7552 | |
| 7553 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7554 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7555 | 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] | 7556 | "$P_SRV min_version=tls13" \ |
| 7557 | "$O_NEXT_CLI -tls1_2" \ |
| 7558 | 1 \ |
| 7559 | -s "Handshake protocol not within min/max boundaries" \ |
| 7560 | -S "Protocol is TLSv1.2" |
| 7561 | |
| 7562 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7563 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7564 | 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] | 7565 | "$P_SRV max_version=tls12" \ |
| 7566 | "$O_NEXT_CLI -tls1_3" \ |
| 7567 | 1 \ |
| 7568 | -S "Handshake protocol not within min/max boundaries" \ |
| 7569 | -s "The handshake negotiation failed" \ |
| 7570 | -S "Protocol is TLSv1.3" |
| 7571 | |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7572 | # Tests of version negotiation on client side against GnuTLS and OpenSSL server |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7573 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7574 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7575 | run_test "Not supported version: srv max TLS 1.0" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7576 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 7577 | "$P_CLI" \ |
| 7578 | 1 \ |
| 7579 | -s "Error in protocol version" \ |
| 7580 | -c "Handshake protocol not within min/max boundaries" \ |
| 7581 | -S "Version: TLS1.0" \ |
| 7582 | -C "Protocol is TLSv1.0" |
| 7583 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7584 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7585 | run_test "Not supported version: srv max TLS 1.1" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7586 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 7587 | "$P_CLI" \ |
| 7588 | 1 \ |
| 7589 | -s "Error in protocol version" \ |
| 7590 | -c "Handshake protocol not within min/max boundaries" \ |
| 7591 | -S "Version: TLS1.1" \ |
| 7592 | -C "Protocol is TLSv1.1" |
| 7593 | |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7594 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7595 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7596 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7597 | skip_handshake_stage_check |
| 7598 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7599 | 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] | 7600 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \ |
| 7601 | "$P_CLI debug_level=4" \ |
| 7602 | 1 \ |
| 7603 | -s "Client's version: 3.3" \ |
| 7604 | -S "Version: TLS1.0" \ |
| 7605 | -C "Protocol is TLSv1.0" |
| 7606 | |
| 7607 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7608 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7609 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7610 | skip_handshake_stage_check |
| 7611 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7612 | 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] | 7613 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \ |
| 7614 | "$P_CLI debug_level=4" \ |
| 7615 | 1 \ |
| 7616 | -s "Client's version: 3.3" \ |
| 7617 | -S "Version: TLS1.1" \ |
| 7618 | -C "Protocol is TLSv1.1" |
| 7619 | |
| 7620 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7621 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7622 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7623 | skip_handshake_stage_check |
| 7624 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7625 | 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] | 7626 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \ |
| 7627 | "$P_CLI force_version=tls13 debug_level=4" \ |
| 7628 | 1 \ |
| 7629 | -s "Client's version: 3.3" \ |
| 7630 | -c "is a fatal alert message (msg 40)" \ |
| 7631 | -S "Version: TLS1.2" \ |
| 7632 | -C "Protocol is TLSv1.2" |
| 7633 | |
| 7634 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7635 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7636 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7637 | skip_handshake_stage_check |
| 7638 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7639 | 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] | 7640 | "$O_NEXT_SRV -msg -tls1" \ |
| 7641 | "$P_CLI debug_level=4" \ |
| 7642 | 1 \ |
| 7643 | -s "fatal protocol_version" \ |
| 7644 | -c "is a fatal alert message (msg 70)" \ |
| 7645 | -S "Version: TLS1.0" \ |
| 7646 | -C "Protocol : TLSv1.0" |
| 7647 | |
| 7648 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7649 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7650 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7651 | skip_handshake_stage_check |
| 7652 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7653 | 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] | 7654 | "$O_NEXT_SRV -msg -tls1_1" \ |
| 7655 | "$P_CLI debug_level=4" \ |
| 7656 | 1 \ |
| 7657 | -s "fatal protocol_version" \ |
| 7658 | -c "is a fatal alert message (msg 70)" \ |
| 7659 | -S "Version: TLS1.1" \ |
| 7660 | -C "Protocol : TLSv1.1" |
| 7661 | |
| 7662 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7663 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7664 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7665 | skip_handshake_stage_check |
| 7666 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7667 | 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] | 7668 | "$O_NEXT_SRV -msg -tls1_2" \ |
| 7669 | "$P_CLI force_version=tls13 debug_level=4" \ |
| 7670 | 1 \ |
| 7671 | -s "fatal protocol_version" \ |
| 7672 | -c "is a fatal alert message (msg 70)" \ |
| 7673 | -S "Version: TLS1.2" \ |
| 7674 | -C "Protocol : TLSv1.2" |
| 7675 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7676 | # Tests for ALPN extension |
| 7677 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7678 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7679 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7680 | "$P_SRV debug_level=3" \ |
| 7681 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7682 | 0 \ |
| 7683 | -C "client hello, adding alpn extension" \ |
| 7684 | -S "found alpn extension" \ |
| 7685 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7686 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7687 | -C "found alpn extension " \ |
| 7688 | -C "Application Layer Protocol is" \ |
| 7689 | -S "Application Layer Protocol is" |
| 7690 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7691 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7692 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7693 | "$P_SRV debug_level=3" \ |
| 7694 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7695 | 0 \ |
| 7696 | -c "client hello, adding alpn extension" \ |
| 7697 | -s "found alpn extension" \ |
| 7698 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7699 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7700 | -C "found alpn extension " \ |
| 7701 | -c "Application Layer Protocol is (none)" \ |
| 7702 | -S "Application Layer Protocol is" |
| 7703 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7704 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7705 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7706 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7707 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7708 | 0 \ |
| 7709 | -C "client hello, adding alpn extension" \ |
| 7710 | -S "found alpn extension" \ |
| 7711 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7712 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7713 | -C "found alpn extension " \ |
| 7714 | -C "Application Layer Protocol is" \ |
| 7715 | -s "Application Layer Protocol is (none)" |
| 7716 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7717 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7718 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7719 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7720 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7721 | 0 \ |
| 7722 | -c "client hello, adding alpn extension" \ |
| 7723 | -s "found alpn extension" \ |
| 7724 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7725 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7726 | -c "found alpn extension" \ |
| 7727 | -c "Application Layer Protocol is abc" \ |
| 7728 | -s "Application Layer Protocol is abc" |
| 7729 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7730 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7731 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7732 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7733 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7734 | 0 \ |
| 7735 | -c "client hello, adding alpn extension" \ |
| 7736 | -s "found alpn extension" \ |
| 7737 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7738 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7739 | -c "found alpn extension" \ |
| 7740 | -c "Application Layer Protocol is abc" \ |
| 7741 | -s "Application Layer Protocol is abc" |
| 7742 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7743 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7744 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7745 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7746 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7747 | 0 \ |
| 7748 | -c "client hello, adding alpn extension" \ |
| 7749 | -s "found alpn extension" \ |
| 7750 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7751 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7752 | -c "found alpn extension" \ |
| 7753 | -c "Application Layer Protocol is 1234" \ |
| 7754 | -s "Application Layer Protocol is 1234" |
| 7755 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7756 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7757 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7758 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 7759 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7760 | 1 \ |
| 7761 | -c "client hello, adding alpn extension" \ |
| 7762 | -s "found alpn extension" \ |
| 7763 | -c "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7764 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7765 | -C "found alpn extension" \ |
| 7766 | -C "Application Layer Protocol is 1234" \ |
| 7767 | -S "Application Layer Protocol is 1234" |
| 7768 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 7769 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7770 | # Tests for keyUsage in leaf certificates, part 1: |
| 7771 | # server-side certificate/suite selection |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7772 | # |
| 7773 | # This is only about 1.2 (for 1.3, all key exchanges use signatures). |
| 7774 | # In 4.0 this will probably go away as all TLS 1.2 key exchanges will use |
| 7775 | # 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] | 7776 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7777 | run_test "keyUsage srv 1.2: RSA, digitalSignature -> (EC)DHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7778 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7779 | crt_file=$DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7780 | "$P_CLI" \ |
| 7781 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 7782 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7783 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7784 | run_test "keyUsage srv 1.2: RSA, keyEncipherment -> RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7785 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7786 | crt_file=$DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7787 | "$P_CLI" \ |
| 7788 | 0 \ |
| 7789 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 7790 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7791 | run_test "keyUsage srv 1.2: RSA, keyAgreement -> fail" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7792 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7793 | crt_file=$DATA_FILES_PATH/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 7794 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7795 | 1 \ |
| 7796 | -C "Ciphersuite is " |
| 7797 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 7798 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7799 | run_test "keyUsage srv 1.2: ECC, digitalSignature -> ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7800 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7801 | crt_file=$DATA_FILES_PATH/server5.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7802 | "$P_CLI" \ |
| 7803 | 0 \ |
| 7804 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 7805 | |
| 7806 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7807 | run_test "keyUsage srv 1.2: ECC, keyAgreement -> ECDH-" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7808 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7809 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7810 | "$P_CLI" \ |
| 7811 | 0 \ |
| 7812 | -c "Ciphersuite is TLS-ECDH-" |
| 7813 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7814 | run_test "keyUsage srv 1.2: ECC, keyEncipherment -> fail" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7815 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7816 | crt_file=$DATA_FILES_PATH/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 7817 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7818 | 1 \ |
| 7819 | -C "Ciphersuite is " |
| 7820 | |
| 7821 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7822 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7823 | # |
| 7824 | # TLS 1.3 uses only signature, but for 1.2 it depends on the key exchange. |
| 7825 | # In 4.0 this will probably change as all TLS 1.2 key exchanges will use |
| 7826 | # 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] | 7827 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7828 | run_test "keyUsage cli 1.2: DigitalSignature+KeyEncipherment, RSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7829 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7830 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7831 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7832 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7833 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7834 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7835 | -C "Processing of the Certificate handshake message failed" \ |
| 7836 | -c "Ciphersuite is TLS-" |
| 7837 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7838 | run_test "keyUsage cli 1.2: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7839 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7840 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7841 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7842 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7843 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7844 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7845 | -C "Processing of the Certificate handshake message failed" \ |
| 7846 | -c "Ciphersuite is TLS-" |
| 7847 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7848 | run_test "keyUsage cli 1.2: KeyEncipherment, RSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7849 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7850 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7851 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7852 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7853 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7854 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7855 | -C "Processing of the Certificate handshake message failed" \ |
| 7856 | -c "Ciphersuite is TLS-" |
| 7857 | |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7858 | run_test "keyUsage cli 1.2: KeyEncipherment, DHE-RSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7859 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7860 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7861 | "$P_CLI debug_level=3 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7862 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7863 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7864 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7865 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7866 | -C "Ciphersuite is TLS-" \ |
| 7867 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7868 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7869 | # 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] | 7870 | |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7871 | run_test "keyUsage cli 1.2: KeyEncipherment, DHE-RSA: fail (soft)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7872 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7873 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7874 | "$P_CLI debug_level=3 auth_mode=optional \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7875 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7876 | 0 \ |
| 7877 | -c "bad certificate (usage extensions)" \ |
| 7878 | -C "Processing of the Certificate handshake message failed" \ |
| 7879 | -c "Ciphersuite is TLS-" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7880 | -C "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7881 | -c "! Usage does not match the keyUsage extension" |
| 7882 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7883 | run_test "keyUsage cli 1.2: DigitalSignature, DHE-RSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7884 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7885 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7886 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7887 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7888 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7889 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7890 | -C "Processing of the Certificate handshake message failed" \ |
| 7891 | -c "Ciphersuite is TLS-" |
| 7892 | |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7893 | run_test "keyUsage cli 1.2: DigitalSignature, RSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7894 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7895 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7896 | "$P_CLI debug_level=3 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7897 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7898 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7899 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7900 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7901 | -C "Ciphersuite is TLS-" \ |
| 7902 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7903 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7904 | # 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] | 7905 | |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7906 | run_test "keyUsage cli 1.2: DigitalSignature, RSA: fail (soft)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7907 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7908 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7909 | "$P_CLI debug_level=3 auth_mode=optional \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7910 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7911 | 0 \ |
| 7912 | -c "bad certificate (usage extensions)" \ |
| 7913 | -C "Processing of the Certificate handshake message failed" \ |
| 7914 | -c "Ciphersuite is TLS-" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7915 | -C "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7916 | -c "! Usage does not match the keyUsage extension" |
| 7917 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7918 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7919 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7920 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7921 | run_test "keyUsage cli 1.3: DigitalSignature, RSA: OK" \ |
| 7922 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7923 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds.crt" \ |
| 7924 | "$P_CLI debug_level=3" \ |
| 7925 | 0 \ |
| 7926 | -C "bad certificate (usage extensions)" \ |
| 7927 | -C "Processing of the Certificate handshake message failed" \ |
| 7928 | -c "Ciphersuite is" |
| 7929 | |
| 7930 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7931 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7932 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7933 | run_test "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7934 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7935 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds_ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7936 | "$P_CLI debug_level=3" \ |
| 7937 | 0 \ |
| 7938 | -C "bad certificate (usage extensions)" \ |
| 7939 | -C "Processing of the Certificate handshake message failed" \ |
| 7940 | -c "Ciphersuite is" |
| 7941 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7942 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7943 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7944 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7945 | run_test "keyUsage cli 1.3: KeyEncipherment, RSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7946 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7947 | -cert $DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7948 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7949 | 1 \ |
| 7950 | -c "bad certificate (usage extensions)" \ |
| 7951 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7952 | -C "Ciphersuite is" \ |
| 7953 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7954 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7955 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7956 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7957 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7958 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7959 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7960 | run_test "keyUsage cli 1.3: KeyAgreement, RSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7961 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7962 | -cert $DATA_FILES_PATH/server2-sha256.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7963 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7964 | 1 \ |
| 7965 | -c "bad certificate (usage extensions)" \ |
| 7966 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7967 | -C "Ciphersuite is" \ |
| 7968 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7969 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7970 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7971 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7972 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7973 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7974 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7975 | run_test "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7976 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 7977 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7978 | "$P_CLI debug_level=3" \ |
| 7979 | 0 \ |
| 7980 | -C "bad certificate (usage extensions)" \ |
| 7981 | -C "Processing of the Certificate handshake message failed" \ |
| 7982 | -c "Ciphersuite is" |
| 7983 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7984 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7985 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7986 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7987 | run_test "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7988 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 7989 | -cert $DATA_FILES_PATH/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7990 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7991 | 1 \ |
| 7992 | -c "bad certificate (usage extensions)" \ |
| 7993 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7994 | -C "Ciphersuite is" \ |
| 7995 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7996 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7997 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7998 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7999 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8000 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8001 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8002 | run_test "keyUsage cli 1.3: KeyAgreement, ECDSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8003 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8004 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8005 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8006 | 1 \ |
| 8007 | -c "bad certificate (usage extensions)" \ |
| 8008 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8009 | -C "Ciphersuite is" \ |
| 8010 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8011 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8012 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8013 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8014 | # Tests for keyUsage in leaf certificates, part 3: |
| 8015 | # server-side checking of client cert |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8016 | # |
| 8017 | # Here, both 1.2 and 1.3 only use signatures. |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8018 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8019 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8020 | run_test "keyUsage cli-auth 1.2: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8021 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8022 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8023 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8024 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8025 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8026 | -S "bad certificate (usage extensions)" \ |
| 8027 | -S "Processing of the Certificate handshake message failed" |
| 8028 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8029 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8030 | run_test "keyUsage cli-auth 1.2: RSA, DigitalSignature+KeyEncipherment: OK" \ |
| 8031 | "$P_SRV debug_level=1 auth_mode=optional" \ |
| 8032 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8033 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
| 8034 | 0 \ |
| 8035 | -s "Verifying peer X.509 certificate... ok" \ |
| 8036 | -S "bad certificate (usage extensions)" \ |
| 8037 | -S "Processing of the Certificate handshake message failed" |
| 8038 | |
| 8039 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8040 | run_test "keyUsage cli-auth 1.2: RSA, KeyEncipherment: fail (soft)" \ |
| 8041 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8042 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8043 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8044 | 0 \ |
| 8045 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8046 | -S "send alert level=2 message=43" \ |
| 8047 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8048 | -S "Processing of the Certificate handshake message failed" |
| 8049 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8050 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8051 | run_test "keyUsage cli-auth 1.2: RSA, KeyEncipherment: fail (hard)" \ |
| 8052 | "$P_SRV debug_level=3 force_version=tls12 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8053 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8054 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8055 | 1 \ |
| 8056 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8057 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8058 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8059 | -s "Processing of the Certificate handshake message failed" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8060 | # 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] | 8061 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8062 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8063 | run_test "keyUsage cli-auth 1.2: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8064 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8065 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8066 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8067 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8068 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8069 | -S "bad certificate (usage extensions)" \ |
| 8070 | -S "Processing of the Certificate handshake message failed" |
| 8071 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8073 | run_test "keyUsage cli-auth 1.2: ECDSA, KeyAgreement: fail (soft)" \ |
| 8074 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8075 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8076 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8077 | 0 \ |
| 8078 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8079 | -S "send alert level=2 message=43" \ |
| 8080 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8081 | -S "Processing of the Certificate handshake message failed" |
| 8082 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8083 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8084 | run_test "keyUsage cli-auth 1.2: ECDSA, KeyAgreement: fail (hard)" \ |
| 8085 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 8086 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8087 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
| 8088 | 1 \ |
| 8089 | -s "bad certificate (usage extensions)" \ |
| 8090 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8091 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8092 | -s "Processing of the Certificate handshake message failed" |
| 8093 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8094 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8095 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8096 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8097 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8098 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8099 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8100 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
| 8101 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8102 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8103 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8104 | -S "bad certificate (usage extensions)" \ |
| 8105 | -S "Processing of the Certificate handshake message failed" |
| 8106 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8107 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8108 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8109 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8110 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature+KeyEncipherment: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8111 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8112 | "$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] | 8113 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds_ke.crt" \ |
| 8114 | 0 \ |
| 8115 | -s "Verifying peer X.509 certificate... ok" \ |
| 8116 | -S "bad certificate (usage extensions)" \ |
| 8117 | -S "Processing of the Certificate handshake message failed" |
| 8118 | |
| 8119 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 8120 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8121 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 8122 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ |
| 8123 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
| 8124 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8125 | -cert $DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8126 | 0 \ |
| 8127 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8128 | -S "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8129 | -s "! Usage does not match the keyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8130 | -S "Processing of the Certificate handshake message failed" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8131 | |
| 8132 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 8133 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8134 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 8135 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (hard)" \ |
| 8136 | "$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] | 8137 | "$P_CLI key_file=$DATA_FILES_PATH/server2.key \ |
| 8138 | crt_file=$DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
| 8139 | 1 \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8140 | -s "bad certificate (usage extensions)" \ |
| 8141 | -s "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8142 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8143 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8144 | -s "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8145 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8146 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8147 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8148 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8149 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8150 | run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8151 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8152 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8153 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8154 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8155 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8156 | -S "bad certificate (usage extensions)" \ |
| 8157 | -S "Processing of the Certificate handshake message failed" |
| 8158 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8159 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8160 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8161 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8162 | 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] | 8163 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8164 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8165 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8166 | 0 \ |
| 8167 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8168 | -s "! Usage does not match the keyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8169 | -S "Processing of the Certificate handshake message failed" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8170 | |
| 8171 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 8172 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8173 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 8174 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (hard)" \ |
| 8175 | "$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] | 8176 | "$P_CLI key_file=$DATA_FILES_PATH/server5.key \ |
| 8177 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
| 8178 | 1 \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8179 | -s "bad certificate (usage extensions)" \ |
| 8180 | -s "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8181 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8182 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8183 | -s "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8184 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8185 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8186 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 8187 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 8188 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8189 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8190 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8191 | crt_file=$DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8192 | "$P_CLI" \ |
| 8193 | 0 |
| 8194 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 8195 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8196 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8197 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8198 | crt_file=$DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8199 | "$P_CLI" \ |
| 8200 | 0 |
| 8201 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 8202 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8203 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8204 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8205 | crt_file=$DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8206 | "$P_CLI" \ |
| 8207 | 0 |
| 8208 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 8209 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8210 | run_test "extKeyUsage srv: codeSign -> fail" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8211 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8212 | crt_file=$DATA_FILES_PATH/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 8213 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8214 | 1 |
| 8215 | |
| 8216 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 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 1.2: serverAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8220 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8221 | -cert $DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8222 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8223 | 0 \ |
| 8224 | -C "bad certificate (usage extensions)" \ |
| 8225 | -C "Processing of the Certificate handshake message failed" \ |
| 8226 | -c "Ciphersuite is TLS-" |
| 8227 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8228 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8229 | run_test "extKeyUsage cli 1.2: serverAuth,clientAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8230 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8231 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8232 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8233 | 0 \ |
| 8234 | -C "bad certificate (usage extensions)" \ |
| 8235 | -C "Processing of the Certificate handshake message failed" \ |
| 8236 | -c "Ciphersuite is TLS-" |
| 8237 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8238 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8239 | run_test "extKeyUsage cli 1.2: codeSign,anyEKU -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8240 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8241 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8242 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8243 | 0 \ |
| 8244 | -C "bad certificate (usage extensions)" \ |
| 8245 | -C "Processing of the Certificate handshake message failed" \ |
| 8246 | -c "Ciphersuite is TLS-" |
| 8247 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8248 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 04db1fb | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8249 | run_test "extKeyUsage cli 1.2: codeSign -> fail (soft)" \ |
| 8250 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8251 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
| 8252 | "$P_CLI debug_level=3 auth_mode=optional" \ |
| 8253 | 0 \ |
| 8254 | -c "bad certificate (usage extensions)" \ |
| 8255 | -C "Processing of the Certificate handshake message failed" \ |
| 8256 | -c "Ciphersuite is TLS-" \ |
| 8257 | -C "send alert level=2 message=43" \ |
| 8258 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8259 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8260 | |
| 8261 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8262 | run_test "extKeyUsage cli 1.2: codeSign -> fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8263 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8264 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8265 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8266 | 1 \ |
| 8267 | -c "bad certificate (usage extensions)" \ |
| 8268 | -c "Processing of the Certificate handshake message failed" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8269 | -C "Ciphersuite is TLS-" \ |
| 8270 | -c "send alert level=2 message=43" \ |
| 8271 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8272 | # 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] | 8273 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8274 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8275 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8276 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8277 | run_test "extKeyUsage cli 1.3: serverAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8278 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8279 | -cert $DATA_FILES_PATH/server5.eku-srv.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8280 | "$P_CLI debug_level=1" \ |
| 8281 | 0 \ |
| 8282 | -C "bad certificate (usage extensions)" \ |
| 8283 | -C "Processing of the Certificate handshake message failed" \ |
| 8284 | -c "Ciphersuite is" |
| 8285 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8286 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8287 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8288 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8289 | run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8290 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8291 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8292 | "$P_CLI debug_level=1" \ |
| 8293 | 0 \ |
| 8294 | -C "bad certificate (usage extensions)" \ |
| 8295 | -C "Processing of the Certificate handshake message failed" \ |
| 8296 | -c "Ciphersuite is" |
| 8297 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8298 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8299 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8300 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8301 | run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8302 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8303 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8304 | "$P_CLI debug_level=1" \ |
| 8305 | 0 \ |
| 8306 | -C "bad certificate (usage extensions)" \ |
| 8307 | -C "Processing of the Certificate handshake message failed" \ |
| 8308 | -c "Ciphersuite is" |
| 8309 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8310 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8311 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8312 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8313 | run_test "extKeyUsage cli 1.3: codeSign -> fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8314 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8315 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8316 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8317 | 1 \ |
| 8318 | -c "bad certificate (usage extensions)" \ |
| 8319 | -c "Processing of the Certificate handshake message failed" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8320 | -C "Ciphersuite is" \ |
| 8321 | -c "send alert level=2 message=43" \ |
| 8322 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8323 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8324 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8325 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 8326 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8327 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8328 | run_test "extKeyUsage cli-auth 1.2: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8329 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8330 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8331 | -cert $DATA_FILES_PATH/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8332 | 0 \ |
| 8333 | -S "bad certificate (usage extensions)" \ |
| 8334 | -S "Processing of the Certificate handshake message failed" |
| 8335 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8336 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8337 | run_test "extKeyUsage cli-auth 1.2: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8338 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8339 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8340 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8341 | 0 \ |
| 8342 | -S "bad certificate (usage extensions)" \ |
| 8343 | -S "Processing of the Certificate handshake message failed" |
| 8344 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8345 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8346 | run_test "extKeyUsage cli-auth 1.2: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8347 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8348 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8349 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8350 | 0 \ |
| 8351 | -S "bad certificate (usage extensions)" \ |
| 8352 | -S "Processing of the Certificate handshake message failed" |
| 8353 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8354 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8355 | run_test "extKeyUsage cli-auth 1.2: codeSign -> fail (soft)" \ |
| 8356 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8357 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8358 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8359 | 0 \ |
| 8360 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8361 | -S "send alert level=2 message=43" \ |
| 8362 | -s "! Usage does not match the extendedKeyUsage extension" \ |
| 8363 | -S "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8364 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8365 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8366 | run_test "extKeyUsage cli-auth 1.2: codeSign -> fail (hard)" \ |
| 8367 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8368 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8369 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8370 | 1 \ |
| 8371 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8372 | -s "send alert level=2 message=43" \ |
| 8373 | -s "! Usage does not match the extendedKeyUsage extension" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8374 | -s "Processing of the Certificate handshake message failed" |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8375 | # 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] | 8376 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8377 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8378 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8379 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8380 | run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8381 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8382 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8383 | -cert $DATA_FILES_PATH/server5.eku-cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8384 | 0 \ |
| 8385 | -S "bad certificate (usage extensions)" \ |
| 8386 | -S "Processing of the Certificate handshake message failed" |
| 8387 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8388 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8389 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8390 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8391 | run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8392 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8393 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8394 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8395 | 0 \ |
| 8396 | -S "bad certificate (usage extensions)" \ |
| 8397 | -S "Processing of the Certificate handshake message failed" |
| 8398 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8399 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8400 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8401 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8402 | run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8403 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8404 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8405 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8406 | 0 \ |
| 8407 | -S "bad certificate (usage extensions)" \ |
| 8408 | -S "Processing of the Certificate handshake message failed" |
| 8409 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8410 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8411 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8412 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8413 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8414 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8415 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8416 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8417 | 0 \ |
| 8418 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8419 | -S "send alert level=2 message=43" \ |
| 8420 | -s "! Usage does not match the extendedKeyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8421 | -S "Processing of the Certificate handshake message failed" |
| 8422 | |
Elena Uziunaite | 04db1fb | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8423 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 8424 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8425 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 8426 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (hard)" \ |
| 8427 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=required" \ |
| 8428 | "$P_CLI key_file=$DATA_FILES_PATH/server5.key \ |
| 8429 | crt_file=$DATA_FILES_PATH/server5.eku-cs.crt" \ |
| 8430 | 1 \ |
| 8431 | -s "bad certificate (usage extensions)" \ |
| 8432 | -s "send alert level=2 message=43" \ |
| 8433 | -s "! Usage does not match the extendedKeyUsage extension" \ |
| 8434 | -s "Processing of the Certificate handshake message failed" |
| 8435 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8436 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8437 | # Tests for DHM parameters loading |
| 8438 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8439 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8440 | "$P_SRV" \ |
| 8441 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8442 | debug_level=3" \ |
| 8443 | 0 \ |
| 8444 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 8445 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8446 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8447 | run_test "DHM parameters: other parameters" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8448 | "$P_SRV dhm_file=$DATA_FILES_PATH/dhparams.pem" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8449 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8450 | debug_level=3" \ |
| 8451 | 0 \ |
| 8452 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 8453 | -c "value of 'DHM: G ' (2 bits)" |
| 8454 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8455 | # Tests for DHM client-side size checking |
| 8456 | |
| 8457 | run_test "DHM size: server default, client default, OK" \ |
| 8458 | "$P_SRV" \ |
| 8459 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8460 | debug_level=1" \ |
| 8461 | 0 \ |
| 8462 | -C "DHM prime too short:" |
| 8463 | |
| 8464 | run_test "DHM size: server default, client 2048, OK" \ |
| 8465 | "$P_SRV" \ |
| 8466 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8467 | debug_level=1 dhmlen=2048" \ |
| 8468 | 0 \ |
| 8469 | -C "DHM prime too short:" |
| 8470 | |
| 8471 | run_test "DHM size: server 1024, client default, OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8472 | "$P_SRV dhm_file=$DATA_FILES_PATH/dhparams.pem" \ |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8473 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8474 | debug_level=1" \ |
| 8475 | 0 \ |
| 8476 | -C "DHM prime too short:" |
| 8477 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8478 | run_test "DHM size: server 999, client 999, OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8479 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.999.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8480 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8481 | debug_level=1 dhmlen=999" \ |
| 8482 | 0 \ |
| 8483 | -C "DHM prime too short:" |
| 8484 | |
| 8485 | run_test "DHM size: server 1000, client 1000, OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8486 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8487 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8488 | debug_level=1 dhmlen=1000" \ |
| 8489 | 0 \ |
| 8490 | -C "DHM prime too short:" |
| 8491 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8492 | run_test "DHM size: server 1000, client default, rejected" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8493 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8494 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8495 | debug_level=1" \ |
| 8496 | 1 \ |
| 8497 | -c "DHM prime too short:" |
| 8498 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8499 | run_test "DHM size: server 1000, client 1001, rejected" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8500 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8501 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8502 | debug_level=1 dhmlen=1001" \ |
| 8503 | 1 \ |
| 8504 | -c "DHM prime too short:" |
| 8505 | |
| 8506 | run_test "DHM size: server 999, client 1000, rejected" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8507 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.999.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8508 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8509 | debug_level=1 dhmlen=1000" \ |
| 8510 | 1 \ |
| 8511 | -c "DHM prime too short:" |
| 8512 | |
| 8513 | run_test "DHM size: server 998, client 999, rejected" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8514 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.998.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8515 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8516 | debug_level=1 dhmlen=999" \ |
| 8517 | 1 \ |
| 8518 | -c "DHM prime too short:" |
| 8519 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8520 | run_test "DHM size: server default, client 2049, rejected" \ |
| 8521 | "$P_SRV" \ |
| 8522 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8523 | debug_level=1 dhmlen=2049" \ |
| 8524 | 1 \ |
| 8525 | -c "DHM prime too short:" |
| 8526 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8527 | # Tests for PSK callback |
| 8528 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8529 | run_test "PSK callback: psk, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8530 | "$P_SRV psk=73776f726466697368 psk_identity=foo" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8531 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8532 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8533 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8534 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 8535 | -S "SSL - Unknown identity received" \ |
| 8536 | -S "SSL - Verification of the message MAC failed" |
| 8537 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8538 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8539 | run_test "PSK callback: opaque psk on client, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8540 | "$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] | 8541 | "$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] | 8542 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8543 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8544 | -C "session hash for extended master secret"\ |
| 8545 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8546 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8547 | -S "SSL - Unknown identity received" \ |
| 8548 | -S "SSL - Verification of the message MAC failed" |
| 8549 | |
| 8550 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8551 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8552 | "$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] | 8553 | "$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] | 8554 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8555 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8556 | -C "session hash for extended master secret"\ |
| 8557 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8558 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8559 | -S "SSL - Unknown identity received" \ |
| 8560 | -S "SSL - Verification of the message MAC failed" |
| 8561 | |
| 8562 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8563 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8564 | "$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] | 8565 | "$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] | 8566 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8567 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8568 | -c "session hash for extended master secret"\ |
| 8569 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8570 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8571 | -S "SSL - Unknown identity received" \ |
| 8572 | -S "SSL - Verification of the message MAC failed" |
| 8573 | |
| 8574 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8575 | 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] | 8576 | "$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] | 8577 | "$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] | 8578 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8579 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8580 | -c "session hash for extended master secret"\ |
| 8581 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8582 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8583 | -S "SSL - Unknown identity received" \ |
| 8584 | -S "SSL - Verification of the message MAC failed" |
| 8585 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8586 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8587 | run_test "PSK callback: opaque rsa-psk on client, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8588 | "$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] | 8589 | "$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] | 8590 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8591 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8592 | -C "session hash for extended master secret"\ |
| 8593 | -S "session hash for extended master secret"\ |
| 8594 | -S "SSL - The handshake negotiation failed" \ |
| 8595 | -S "SSL - Unknown identity received" \ |
| 8596 | -S "SSL - Verification of the message MAC failed" |
| 8597 | |
| 8598 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8599 | 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] | 8600 | "$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] | 8601 | "$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] | 8602 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8603 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8604 | -C "session hash for extended master secret"\ |
| 8605 | -S "session hash for extended master secret"\ |
| 8606 | -S "SSL - The handshake negotiation failed" \ |
| 8607 | -S "SSL - Unknown identity received" \ |
| 8608 | -S "SSL - Verification of the message MAC failed" |
| 8609 | |
| 8610 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8611 | run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8612 | "$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] | 8613 | "$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] | 8614 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8615 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8616 | -c "session hash for extended master secret"\ |
| 8617 | -s "session hash for extended master secret"\ |
| 8618 | -S "SSL - The handshake negotiation failed" \ |
| 8619 | -S "SSL - Unknown identity received" \ |
| 8620 | -S "SSL - Verification of the message MAC failed" |
| 8621 | |
| 8622 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8623 | 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] | 8624 | "$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] | 8625 | "$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] | 8626 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8627 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8628 | -c "session hash for extended master secret"\ |
| 8629 | -s "session hash for extended master secret"\ |
| 8630 | -S "SSL - The handshake negotiation failed" \ |
| 8631 | -S "SSL - Unknown identity received" \ |
| 8632 | -S "SSL - Verification of the message MAC failed" |
| 8633 | |
| 8634 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8635 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8636 | "$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] | 8637 | "$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] | 8638 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8639 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8640 | -C "session hash for extended master secret"\ |
| 8641 | -S "session hash for extended master secret"\ |
| 8642 | -S "SSL - The handshake negotiation failed" \ |
| 8643 | -S "SSL - Unknown identity received" \ |
| 8644 | -S "SSL - Verification of the message MAC failed" |
| 8645 | |
| 8646 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8647 | 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] | 8648 | "$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] | 8649 | "$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] | 8650 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8651 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8652 | -C "session hash for extended master secret"\ |
| 8653 | -S "session hash for extended master secret"\ |
| 8654 | -S "SSL - The handshake negotiation failed" \ |
| 8655 | -S "SSL - Unknown identity received" \ |
| 8656 | -S "SSL - Verification of the message MAC failed" |
| 8657 | |
| 8658 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8659 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8660 | "$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] | 8661 | "$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] | 8662 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8663 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8664 | -c "session hash for extended master secret"\ |
| 8665 | -s "session hash for extended master secret"\ |
| 8666 | -S "SSL - The handshake negotiation failed" \ |
| 8667 | -S "SSL - Unknown identity received" \ |
| 8668 | -S "SSL - Verification of the message MAC failed" |
| 8669 | |
| 8670 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8671 | 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] | 8672 | "$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] | 8673 | "$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] | 8674 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8675 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8676 | -c "session hash for extended master secret"\ |
| 8677 | -s "session hash for extended master secret"\ |
| 8678 | -S "SSL - The handshake negotiation failed" \ |
| 8679 | -S "SSL - Unknown identity received" \ |
| 8680 | -S "SSL - Verification of the message MAC failed" |
| 8681 | |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8682 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8683 | run_test "PSK callback: opaque dhe-psk on client, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8684 | "$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] | 8685 | "$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] | 8686 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8687 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8688 | -C "session hash for extended master secret"\ |
| 8689 | -S "session hash for extended master secret"\ |
| 8690 | -S "SSL - The handshake negotiation failed" \ |
| 8691 | -S "SSL - Unknown identity received" \ |
| 8692 | -S "SSL - Verification of the message MAC failed" |
| 8693 | |
| 8694 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8695 | 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] | 8696 | "$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] | 8697 | "$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] | 8698 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8699 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8700 | -C "session hash for extended master secret"\ |
| 8701 | -S "session hash for extended master secret"\ |
| 8702 | -S "SSL - The handshake negotiation failed" \ |
| 8703 | -S "SSL - Unknown identity received" \ |
| 8704 | -S "SSL - Verification of the message MAC failed" |
| 8705 | |
| 8706 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8707 | run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8708 | "$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] | 8709 | "$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] | 8710 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8711 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8712 | -c "session hash for extended master secret"\ |
| 8713 | -s "session hash for extended master secret"\ |
| 8714 | -S "SSL - The handshake negotiation failed" \ |
| 8715 | -S "SSL - Unknown identity received" \ |
| 8716 | -S "SSL - Verification of the message MAC failed" |
| 8717 | |
| 8718 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8719 | 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] | 8720 | "$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] | 8721 | "$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] | 8722 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8723 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8724 | -c "session hash for extended master secret"\ |
| 8725 | -s "session hash for extended master secret"\ |
| 8726 | -S "SSL - The handshake negotiation failed" \ |
| 8727 | -S "SSL - Unknown identity received" \ |
| 8728 | -S "SSL - Verification of the message MAC failed" |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8729 | |
| 8730 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8731 | 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] | 8732 | "$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] | 8733 | "$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] | 8734 | psk_identity=foo psk=73776f726466697368" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8735 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8736 | -C "session hash for extended master secret"\ |
| 8737 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8738 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8739 | -S "SSL - Unknown identity received" \ |
| 8740 | -S "SSL - Verification of the message MAC failed" |
| 8741 | |
| 8742 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8743 | 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] | 8744 | "$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] | 8745 | "$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] | 8746 | psk_identity=foo psk=73776f726466697368" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8747 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8748 | -C "session hash for extended master secret"\ |
| 8749 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8750 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8751 | -S "SSL - Unknown identity received" \ |
| 8752 | -S "SSL - Verification of the message MAC failed" |
| 8753 | |
| 8754 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8755 | 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] | 8756 | "$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] | 8757 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8758 | "$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] | 8759 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8760 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8761 | -c "session hash for extended master secret"\ |
| 8762 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8763 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8764 | -S "SSL - Unknown identity received" \ |
| 8765 | -S "SSL - Verification of the message MAC failed" |
| 8766 | |
| 8767 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8768 | 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] | 8769 | "$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] | 8770 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8771 | "$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] | 8772 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8773 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8774 | -c "session hash for extended master secret"\ |
| 8775 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8776 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8777 | -S "SSL - Unknown identity received" \ |
| 8778 | -S "SSL - Verification of the message MAC failed" |
| 8779 | |
| 8780 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8781 | 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] | 8782 | "$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] | 8783 | "$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] | 8784 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8785 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8786 | -C "session hash for extended master secret"\ |
| 8787 | -S "session hash for extended master secret"\ |
| 8788 | -S "SSL - The handshake negotiation failed" \ |
| 8789 | -S "SSL - Unknown identity received" \ |
| 8790 | -S "SSL - Verification of the message MAC failed" |
| 8791 | |
| 8792 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8793 | 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] | 8794 | "$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] | 8795 | "$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] | 8796 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8797 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8798 | -C "session hash for extended master secret"\ |
| 8799 | -S "session hash for extended master secret"\ |
| 8800 | -S "SSL - The handshake negotiation failed" \ |
| 8801 | -S "SSL - Unknown identity received" \ |
| 8802 | -S "SSL - Verification of the message MAC failed" |
| 8803 | |
| 8804 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8805 | 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] | 8806 | "$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] | 8807 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8808 | "$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] | 8809 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8810 | 0 \ |
| 8811 | -c "session hash for extended master secret"\ |
| 8812 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8813 | -S "SSL - The handshake negotiation failed" \ |
| 8814 | -S "SSL - Unknown identity received" \ |
| 8815 | -S "SSL - Verification of the message MAC failed" |
| 8816 | |
| 8817 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8818 | 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] | 8819 | "$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] | 8820 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8821 | "$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] | 8822 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8823 | 0 \ |
| 8824 | -c "session hash for extended master secret"\ |
| 8825 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8826 | -S "SSL - The handshake negotiation failed" \ |
| 8827 | -S "SSL - Unknown identity received" \ |
| 8828 | -S "SSL - Verification of the message MAC failed" |
| 8829 | |
| 8830 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8831 | 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] | 8832 | "$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] | 8833 | "$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] | 8834 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8835 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8836 | -C "session hash for extended master secret"\ |
| 8837 | -S "session hash for extended master secret"\ |
| 8838 | -S "SSL - The handshake negotiation failed" \ |
| 8839 | -S "SSL - Unknown identity received" \ |
| 8840 | -S "SSL - Verification of the message MAC failed" |
| 8841 | |
| 8842 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8843 | 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] | 8844 | "$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] | 8845 | "$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] | 8846 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8847 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8848 | -C "session hash for extended master secret"\ |
| 8849 | -S "session hash for extended master secret"\ |
| 8850 | -S "SSL - The handshake negotiation failed" \ |
| 8851 | -S "SSL - Unknown identity received" \ |
| 8852 | -S "SSL - Verification of the message MAC failed" |
| 8853 | |
| 8854 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8855 | 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] | 8856 | "$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] | 8857 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8858 | "$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] | 8859 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8860 | 0 \ |
| 8861 | -c "session hash for extended master secret"\ |
| 8862 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8863 | -S "SSL - The handshake negotiation failed" \ |
| 8864 | -S "SSL - Unknown identity received" \ |
| 8865 | -S "SSL - Verification of the message MAC failed" |
| 8866 | |
| 8867 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8868 | 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] | 8869 | "$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] | 8870 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8871 | "$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] | 8872 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8873 | 0 \ |
| 8874 | -c "session hash for extended master secret"\ |
| 8875 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8876 | -S "SSL - The handshake negotiation failed" \ |
| 8877 | -S "SSL - Unknown identity received" \ |
| 8878 | -S "SSL - Verification of the message MAC failed" |
| 8879 | |
| 8880 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8881 | 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] | 8882 | "$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] | 8883 | "$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] | 8884 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8885 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8886 | -C "session hash for extended master secret"\ |
| 8887 | -S "session hash for extended master secret"\ |
| 8888 | -S "SSL - The handshake negotiation failed" \ |
| 8889 | -S "SSL - Unknown identity received" \ |
| 8890 | -S "SSL - Verification of the message MAC failed" |
| 8891 | |
| 8892 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8893 | 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] | 8894 | "$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] | 8895 | "$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] | 8896 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8897 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8898 | -C "session hash for extended master secret"\ |
| 8899 | -S "session hash for extended master secret"\ |
| 8900 | -S "SSL - The handshake negotiation failed" \ |
| 8901 | -S "SSL - Unknown identity received" \ |
| 8902 | -S "SSL - Verification of the message MAC failed" |
| 8903 | |
| 8904 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8905 | 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] | 8906 | "$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] | 8907 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8908 | "$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] | 8909 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8910 | 0 \ |
| 8911 | -c "session hash for extended master secret"\ |
| 8912 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8913 | -S "SSL - The handshake negotiation failed" \ |
| 8914 | -S "SSL - Unknown identity received" \ |
| 8915 | -S "SSL - Verification of the message MAC failed" |
| 8916 | |
| 8917 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8918 | 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] | 8919 | "$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] | 8920 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8921 | "$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] | 8922 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8923 | 0 \ |
| 8924 | -c "session hash for extended master secret"\ |
| 8925 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8926 | -S "SSL - The handshake negotiation failed" \ |
| 8927 | -S "SSL - Unknown identity received" \ |
| 8928 | -S "SSL - Verification of the message MAC failed" |
| 8929 | |
| 8930 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8931 | 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] | 8932 | "$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" \ |
| 8933 | "$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] | 8934 | psk_identity=def psk=beef" \ |
| 8935 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8936 | -C "session hash for extended master secret"\ |
| 8937 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8938 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8939 | -S "SSL - Unknown identity received" \ |
| 8940 | -S "SSL - Verification of the message MAC failed" |
| 8941 | |
| 8942 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8943 | 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] | 8944 | "$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" \ |
| 8945 | "$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] | 8946 | psk_identity=def psk=beef" \ |
| 8947 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8948 | -C "session hash for extended master secret"\ |
| 8949 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8950 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8951 | -S "SSL - Unknown identity received" \ |
| 8952 | -S "SSL - Verification of the message MAC failed" |
| 8953 | |
| 8954 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8955 | 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] | 8956 | "$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] | 8957 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8958 | "$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] | 8959 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8960 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8961 | -c "session hash for extended master secret"\ |
| 8962 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8963 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8964 | -S "SSL - Unknown identity received" \ |
| 8965 | -S "SSL - Verification of the message MAC failed" |
| 8966 | |
| 8967 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8968 | 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] | 8969 | "$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] | 8970 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8971 | "$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] | 8972 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8973 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8974 | -c "session hash for extended master secret"\ |
| 8975 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8976 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8977 | -S "SSL - Unknown identity received" \ |
| 8978 | -S "SSL - Verification of the message MAC failed" |
| 8979 | |
| 8980 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8981 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ |
| 8982 | "$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" \ |
| 8983 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 8984 | psk_identity=def psk=beef" \ |
| 8985 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8986 | -C "session hash for extended master secret"\ |
| 8987 | -S "session hash for extended master secret"\ |
| 8988 | -S "SSL - The handshake negotiation failed" \ |
| 8989 | -S "SSL - Unknown identity received" \ |
| 8990 | -S "SSL - Verification of the message MAC failed" |
| 8991 | |
| 8992 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8993 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ |
| 8994 | "$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" \ |
| 8995 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 8996 | psk_identity=def psk=beef" \ |
| 8997 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8998 | -C "session hash for extended master secret"\ |
| 8999 | -S "session hash for extended master secret"\ |
| 9000 | -S "SSL - The handshake negotiation failed" \ |
| 9001 | -S "SSL - Unknown identity received" \ |
| 9002 | -S "SSL - Verification of the message MAC failed" |
| 9003 | |
| 9004 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9005 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ |
| 9006 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9007 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 9008 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 9009 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9010 | 0 \ |
| 9011 | -c "session hash for extended master secret"\ |
| 9012 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9013 | -S "SSL - The handshake negotiation failed" \ |
| 9014 | -S "SSL - Unknown identity received" \ |
| 9015 | -S "SSL - Verification of the message MAC failed" |
| 9016 | |
| 9017 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9018 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \ |
| 9019 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9020 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 9021 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9022 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9023 | 0 \ |
| 9024 | -c "session hash for extended master secret"\ |
| 9025 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9026 | -S "SSL - The handshake negotiation failed" \ |
| 9027 | -S "SSL - Unknown identity received" \ |
| 9028 | -S "SSL - Verification of the message MAC failed" |
| 9029 | |
| 9030 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9031 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 9032 | "$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" \ |
| 9033 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9034 | psk_identity=def psk=beef" \ |
| 9035 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9036 | -C "session hash for extended master secret"\ |
| 9037 | -S "session hash for extended master secret"\ |
| 9038 | -S "SSL - The handshake negotiation failed" \ |
| 9039 | -S "SSL - Unknown identity received" \ |
| 9040 | -S "SSL - Verification of the message MAC failed" |
| 9041 | |
| 9042 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9043 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 9044 | "$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" \ |
| 9045 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9046 | psk_identity=def psk=beef" \ |
| 9047 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9048 | -C "session hash for extended master secret"\ |
| 9049 | -S "session hash for extended master secret"\ |
| 9050 | -S "SSL - The handshake negotiation failed" \ |
| 9051 | -S "SSL - Unknown identity received" \ |
| 9052 | -S "SSL - Verification of the message MAC failed" |
| 9053 | |
| 9054 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9055 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 9056 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9057 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 9058 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9059 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9060 | 0 \ |
| 9061 | -c "session hash for extended master secret"\ |
| 9062 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9063 | -S "SSL - The handshake negotiation failed" \ |
| 9064 | -S "SSL - Unknown identity received" \ |
| 9065 | -S "SSL - Verification of the message MAC failed" |
| 9066 | |
| 9067 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9068 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 9069 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9070 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 9071 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9072 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9073 | 0 \ |
| 9074 | -c "session hash for extended master secret"\ |
| 9075 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9076 | -S "SSL - The handshake negotiation failed" \ |
| 9077 | -S "SSL - Unknown identity received" \ |
| 9078 | -S "SSL - Verification of the message MAC failed" |
| 9079 | |
| 9080 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9081 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ |
| 9082 | "$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" \ |
| 9083 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9084 | psk_identity=def psk=beef" \ |
| 9085 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9086 | -C "session hash for extended master secret"\ |
| 9087 | -S "session hash for extended master secret"\ |
| 9088 | -S "SSL - The handshake negotiation failed" \ |
| 9089 | -S "SSL - Unknown identity received" \ |
| 9090 | -S "SSL - Verification of the message MAC failed" |
| 9091 | |
| 9092 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9093 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ |
| 9094 | "$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" \ |
| 9095 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9096 | psk_identity=def psk=beef" \ |
| 9097 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9098 | -C "session hash for extended master secret"\ |
| 9099 | -S "session hash for extended master secret"\ |
| 9100 | -S "SSL - The handshake negotiation failed" \ |
| 9101 | -S "SSL - Unknown identity received" \ |
| 9102 | -S "SSL - Verification of the message MAC failed" |
| 9103 | |
| 9104 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9105 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \ |
| 9106 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9107 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 9108 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9109 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9110 | 0 \ |
| 9111 | -c "session hash for extended master secret"\ |
| 9112 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9113 | -S "SSL - The handshake negotiation failed" \ |
| 9114 | -S "SSL - Unknown identity received" \ |
| 9115 | -S "SSL - Verification of the message MAC failed" |
| 9116 | |
| 9117 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9118 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \ |
| 9119 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9120 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 9121 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9122 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9123 | 0 \ |
| 9124 | -c "session hash for extended master secret"\ |
| 9125 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9126 | -S "SSL - The handshake negotiation failed" \ |
| 9127 | -S "SSL - Unknown identity received" \ |
| 9128 | -S "SSL - Verification of the message MAC failed" |
| 9129 | |
| 9130 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9131 | 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] | 9132 | "$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] | 9133 | "$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] | 9134 | psk_identity=def psk=beef" \ |
| 9135 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9136 | -C "session hash for extended master secret"\ |
| 9137 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9138 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9139 | -S "SSL - Unknown identity received" \ |
| 9140 | -S "SSL - Verification of the message MAC failed" |
| 9141 | |
| 9142 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9143 | 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] | 9144 | "$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] | 9145 | "$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] | 9146 | psk_identity=def psk=beef" \ |
| 9147 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9148 | -C "session hash for extended master secret"\ |
| 9149 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9150 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9151 | -S "SSL - Unknown identity received" \ |
| 9152 | -S "SSL - Verification of the message MAC failed" |
| 9153 | |
| 9154 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9155 | 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] | 9156 | "$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] | 9157 | "$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] | 9158 | psk_identity=def psk=beef" \ |
| 9159 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9160 | -C "session hash for extended master secret"\ |
| 9161 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9162 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9163 | -S "SSL - Unknown identity received" \ |
| 9164 | -S "SSL - Verification of the message MAC failed" |
| 9165 | |
| 9166 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9167 | 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] | 9168 | "$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] | 9169 | "$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] | 9170 | psk_identity=def psk=beef" \ |
| 9171 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9172 | -C "session hash for extended master secret"\ |
| 9173 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9174 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9175 | -S "SSL - Unknown identity received" \ |
| 9176 | -S "SSL - Verification of the message MAC failed" |
| 9177 | |
| 9178 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9179 | 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] | 9180 | "$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] | 9181 | "$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] | 9182 | psk_identity=def psk=beef" \ |
| 9183 | 1 \ |
| 9184 | -s "SSL - Verification of the message MAC failed" |
| 9185 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9186 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 9187 | "$P_SRV" \ |
| 9188 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9189 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 9190 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 9191 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9192 | -S "SSL - Unknown identity received" \ |
| 9193 | -S "SSL - Verification of the message MAC failed" |
| 9194 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9195 | run_test "PSK callback: callback overrides other settings" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9196 | "$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] | 9197 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9198 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9199 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9200 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9201 | -s "SSL - Unknown identity received" \ |
| 9202 | -S "SSL - Verification of the message MAC failed" |
| 9203 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9204 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9205 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9206 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9207 | psk_identity=abc psk=dead" \ |
| 9208 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9209 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9210 | -S "SSL - Unknown identity received" \ |
| 9211 | -S "SSL - Verification of the message MAC failed" |
| 9212 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9213 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9214 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9215 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9216 | psk_identity=def psk=beef" \ |
| 9217 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9218 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9219 | -S "SSL - Unknown identity received" \ |
| 9220 | -S "SSL - Verification of the message MAC failed" |
| 9221 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9222 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9223 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9224 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9225 | psk_identity=ghi psk=beef" \ |
| 9226 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9227 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9228 | -s "SSL - Unknown identity received" \ |
| 9229 | -S "SSL - Verification of the message MAC failed" |
| 9230 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9231 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9232 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9233 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9234 | psk_identity=abc psk=beef" \ |
| 9235 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9236 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9237 | -S "SSL - Unknown identity received" \ |
| 9238 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 9239 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9240 | # Tests for EC J-PAKE |
| 9241 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9242 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9243 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9244 | run_test "ECJPAKE: client not configured" \ |
| 9245 | "$P_SRV debug_level=3" \ |
| 9246 | "$P_CLI debug_level=3" \ |
| 9247 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 9248 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9249 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9250 | -S "found ecjpake kkpp extension" \ |
| 9251 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9252 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9253 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9254 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9255 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9256 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9257 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9258 | run_test "ECJPAKE: server not configured" \ |
| 9259 | "$P_SRV debug_level=3" \ |
| 9260 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 9261 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9262 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 9263 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9264 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9265 | -s "found ecjpake kkpp extension" \ |
| 9266 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9267 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9268 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9269 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9270 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9271 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9272 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9273 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9274 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9275 | run_test "ECJPAKE: working, TLS" \ |
| 9276 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9277 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 9278 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 9279 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 9280 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9281 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9282 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9283 | -s "found ecjpake kkpp extension" \ |
| 9284 | -S "skip ecjpake kkpp extension" \ |
| 9285 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9286 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9287 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9288 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9289 | -S "SSL - Verification of the message MAC failed" |
| 9290 | |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9291 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | a6b69da | 2022-11-30 16:44:49 +0100 | [diff] [blame] | 9292 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9293 | run_test "ECJPAKE: opaque password client+server, working, TLS" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9294 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9295 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 9296 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9297 | 0 \ |
| 9298 | -c "add ciphersuite: c0ff" \ |
| 9299 | -c "adding ecjpake_kkpp extension" \ |
Valerio Setti | 661b9bc | 2022-11-29 17:19:25 +0100 | [diff] [blame] | 9300 | -c "using opaque password" \ |
| 9301 | -s "using opaque password" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9302 | -C "re-using cached ecjpake parameters" \ |
| 9303 | -s "found ecjpake kkpp extension" \ |
| 9304 | -S "skip ecjpake kkpp extension" \ |
| 9305 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9306 | -s "server hello, ecjpake kkpp extension" \ |
| 9307 | -c "found ecjpake_kkpp extension" \ |
| 9308 | -S "SSL - The handshake negotiation failed" \ |
| 9309 | -S "SSL - Verification of the message MAC failed" |
| 9310 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9311 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9312 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9313 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9314 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9315 | run_test "ECJPAKE: opaque password client only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9316 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9317 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 9318 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9319 | 0 \ |
| 9320 | -c "add ciphersuite: c0ff" \ |
| 9321 | -c "adding ecjpake_kkpp extension" \ |
| 9322 | -c "using opaque password" \ |
| 9323 | -S "using opaque password" \ |
| 9324 | -C "re-using cached ecjpake parameters" \ |
| 9325 | -s "found ecjpake kkpp extension" \ |
| 9326 | -S "skip ecjpake kkpp extension" \ |
| 9327 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9328 | -s "server hello, ecjpake kkpp extension" \ |
| 9329 | -c "found ecjpake_kkpp extension" \ |
| 9330 | -S "SSL - The handshake negotiation failed" \ |
| 9331 | -S "SSL - Verification of the message MAC failed" |
| 9332 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9333 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9334 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9335 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9336 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9337 | run_test "ECJPAKE: opaque password server only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9338 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9339 | "$P_CLI debug_level=3 ecjpake_pw=bla\ |
| 9340 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9341 | 0 \ |
| 9342 | -c "add ciphersuite: c0ff" \ |
| 9343 | -c "adding ecjpake_kkpp extension" \ |
| 9344 | -C "using opaque password" \ |
| 9345 | -s "using opaque password" \ |
| 9346 | -C "re-using cached ecjpake parameters" \ |
| 9347 | -s "found ecjpake kkpp extension" \ |
| 9348 | -S "skip ecjpake kkpp extension" \ |
| 9349 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9350 | -s "server hello, ecjpake kkpp extension" \ |
| 9351 | -c "found ecjpake_kkpp extension" \ |
| 9352 | -S "SSL - The handshake negotiation failed" \ |
| 9353 | -S "SSL - Verification of the message MAC failed" |
| 9354 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9355 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9356 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9357 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 9358 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9359 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 9360 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9361 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9362 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9363 | -s "SSL - Verification of the message MAC failed" |
| 9364 | |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9365 | server_needs_more_time 1 |
| 9366 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9367 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9368 | run_test "ECJPAKE_OPAQUE_PW: opaque password mismatch, TLS" \ |
| 9369 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9370 | "$P_CLI debug_level=3 ecjpake_pw=bad ecjpake_pw_opaque=1 \ |
| 9371 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9372 | 1 \ |
| 9373 | -c "using opaque password" \ |
| 9374 | -s "using opaque password" \ |
| 9375 | -C "re-using cached ecjpake parameters" \ |
| 9376 | -s "SSL - Verification of the message MAC failed" |
| 9377 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9378 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9379 | run_test "ECJPAKE: working, DTLS" \ |
| 9380 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 9381 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 9382 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9383 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9384 | -c "re-using cached ecjpake parameters" \ |
| 9385 | -S "SSL - Verification of the message MAC failed" |
| 9386 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9387 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9388 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 9389 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 9390 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 9391 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9392 | 0 \ |
| 9393 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9394 | -S "SSL - Verification of the message MAC failed" |
| 9395 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9396 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9397 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9398 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 9399 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 9400 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 9401 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9402 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9403 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9404 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9405 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 9406 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9407 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 9408 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 9409 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 9410 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 9411 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9412 | 0 |
| 9413 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 9414 | # Test for ClientHello without extensions |
| 9415 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9416 | # Without extensions, ECC is impossible (no curve negotiation). |
| 9417 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 9418 | requires_gnutls |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9419 | run_test "ClientHello without extensions: RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 9420 | "$P_SRV force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9421 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 9422 | 0 \ |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9423 | -s "Ciphersuite is .*-RSA-WITH-.*" \ |
| 9424 | -S "Ciphersuite is .*-EC.*" \ |
| 9425 | -s "dumping 'client hello extensions' (0 bytes)" |
| 9426 | |
Gilles Peskine | f287691 | 2024-05-13 21:18:41 +0200 | [diff] [blame] | 9427 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_PSK_ENABLED |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9428 | requires_gnutls |
| 9429 | run_test "ClientHello without extensions: PSK" \ |
| 9430 | "$P_SRV force_version=tls12 debug_level=3 psk=73776f726466697368" \ |
| 9431 | "$G_CLI --priority=NORMAL:+PSK:-RSA:-DHE-RSA:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION --pskusername=Client_identity --pskkey=73776f726466697368 localhost" \ |
| 9432 | 0 \ |
| 9433 | -s "Ciphersuite is .*-PSK-.*" \ |
| 9434 | -S "Ciphersuite is .*-EC.*" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 9435 | -s "dumping 'client hello extensions' (0 bytes)" |
| 9436 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9437 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9438 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9439 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9440 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9441 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9442 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9443 | "$P_CLI request_size=100" \ |
| 9444 | 0 \ |
| 9445 | -s "Read from client: 100 bytes read$" |
| 9446 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9447 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9448 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 9449 | "$P_SRV buffer_size=100" \ |
| 9450 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9451 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9452 | -s "Read from client: 101 bytes read (100 + 1)" |
| 9453 | |
| 9454 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9455 | requires_max_content_len 200 |
| 9456 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 9457 | "$P_SRV buffer_size=100" \ |
| 9458 | "$P_CLI request_size=200" \ |
| 9459 | 0 \ |
| 9460 | -s "Read from client: 200 bytes read (100 + 100)" |
| 9461 | |
| 9462 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9463 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
Waleed Elmelegy | bae705c | 2024-01-01 14:21:21 +0000 | [diff] [blame] | 9464 | "$P_SRV buffer_size=100 force_version=tls12" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9465 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 9466 | 0 \ |
| 9467 | -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] | 9468 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9469 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9470 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9471 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9472 | "$P_SRV force_version=tls12" \ |
| 9473 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9474 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9475 | 0 \ |
| 9476 | -s "Read from client: 1 bytes read" |
| 9477 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9478 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9479 | "$P_SRV force_version=tls12" \ |
| 9480 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 9481 | 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] | 9482 | 0 \ |
| 9483 | -s "Read from client: 1 bytes read" |
| 9484 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9485 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9486 | "$P_SRV force_version=tls12" \ |
| 9487 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 9488 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9489 | 0 \ |
| 9490 | -s "Read from client: 1 bytes read" |
| 9491 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9492 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9493 | "$P_SRV force_version=tls12" \ |
| 9494 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9495 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 9496 | 0 \ |
| 9497 | -s "Read from client: 1 bytes read" |
| 9498 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9499 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9500 | "$P_SRV force_version=tls12" \ |
| 9501 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9502 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 9503 | 0 \ |
| 9504 | -s "Read from client: 1 bytes read" |
| 9505 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9506 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9507 | run_test "Small client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9508 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9509 | "$P_CLI request_size=1 \ |
| 9510 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9511 | 0 \ |
| 9512 | -s "Read from client: 1 bytes read" |
| 9513 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9514 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9515 | run_test "Small client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9516 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9517 | "$P_CLI request_size=1 \ |
| 9518 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9519 | 0 \ |
| 9520 | -s "Read from client: 1 bytes read" |
| 9521 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9522 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9523 | |
| 9524 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9525 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9526 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9527 | "$P_CLI dtls=1 request_size=1 \ |
| 9528 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9529 | 0 \ |
| 9530 | -s "Read from client: 1 bytes read" |
| 9531 | |
| 9532 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9533 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9534 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9535 | "$P_CLI dtls=1 request_size=1 \ |
| 9536 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9537 | 0 \ |
| 9538 | -s "Read from client: 1 bytes read" |
| 9539 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9540 | # Tests for small server packets |
| 9541 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9542 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9543 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9544 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9545 | 0 \ |
| 9546 | -c "Read from server: 1 bytes read" |
| 9547 | |
| 9548 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9549 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9550 | "$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] | 9551 | 0 \ |
| 9552 | -c "Read from server: 1 bytes read" |
| 9553 | |
| 9554 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9555 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9556 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9557 | 0 \ |
| 9558 | -c "Read from server: 1 bytes read" |
| 9559 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9560 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9561 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9562 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9563 | 0 \ |
| 9564 | -c "Read from server: 1 bytes read" |
| 9565 | |
| 9566 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9567 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9568 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9569 | 0 \ |
| 9570 | -c "Read from server: 1 bytes read" |
| 9571 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9572 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9573 | run_test "Small server packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9574 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9575 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9576 | 0 \ |
| 9577 | -c "Read from server: 1 bytes read" |
| 9578 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9579 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9580 | run_test "Small server packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9581 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9582 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9583 | 0 \ |
| 9584 | -c "Read from server: 1 bytes read" |
| 9585 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9586 | # Tests for small server packets in DTLS |
| 9587 | |
| 9588 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9589 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9590 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9591 | "$P_CLI dtls=1 \ |
| 9592 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9593 | 0 \ |
| 9594 | -c "Read from server: 1 bytes read" |
| 9595 | |
| 9596 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9597 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9598 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9599 | "$P_CLI dtls=1 \ |
| 9600 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9601 | 0 \ |
| 9602 | -c "Read from server: 1 bytes read" |
| 9603 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9604 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9605 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9606 | # How many fragments do we expect to write $1 bytes? |
| 9607 | fragments_for_write() { |
| 9608 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 9609 | } |
| 9610 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9611 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9612 | "$P_SRV force_version=tls12" \ |
| 9613 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9614 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9615 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9616 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9617 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9618 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9619 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9620 | "$P_SRV force_version=tls12" \ |
| 9621 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 9622 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9623 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9624 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 9625 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9626 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9627 | "$P_SRV force_version=tls12" \ |
| 9628 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 9629 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9630 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9631 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9632 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9633 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9634 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9635 | "$P_SRV force_version=tls12" \ |
| 9636 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9637 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 9638 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9639 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9640 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9641 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9642 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9643 | "$P_SRV force_version=tls12" \ |
| 9644 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9645 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 9646 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9647 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9648 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9649 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9650 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9651 | run_test "Large client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9652 | "$P_SRV" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9653 | "$P_CLI request_size=16383 \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9654 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9655 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9656 | -c "16383 bytes written in $(fragments_for_write 16383) fragments" \ |
| 9657 | -s "Read from client: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9658 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9659 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9660 | run_test "Large client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9661 | "$P_SRV" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9662 | "$P_CLI request_size=16383 \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9663 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9664 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9665 | -c "16383 bytes written in $(fragments_for_write 16383) fragments" \ |
| 9666 | -s "Read from client: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9667 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9668 | # 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] | 9669 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9670 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9671 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9672 | 0 \ |
| 9673 | -c "Read from server: 16384 bytes read" |
| 9674 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9675 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9676 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9677 | "$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] | 9678 | 0 \ |
| 9679 | -s "16384 bytes written in 1 fragments" \ |
| 9680 | -c "Read from server: 16384 bytes read" |
| 9681 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9682 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9683 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9684 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9685 | 0 \ |
| 9686 | -c "Read from server: 16384 bytes read" |
| 9687 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9688 | 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] | 9689 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 9690 | "$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] | 9691 | 0 \ |
| 9692 | -s "16384 bytes written in 1 fragments" \ |
| 9693 | -c "Read from server: 16384 bytes read" |
| 9694 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9695 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9696 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9697 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9698 | 0 \ |
| 9699 | -c "Read from server: 16384 bytes read" |
| 9700 | |
| 9701 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9702 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9703 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9704 | 0 \ |
| 9705 | -c "Read from server: 16384 bytes read" |
| 9706 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9707 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9708 | run_test "Large server packet TLS 1.3 AEAD" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9709 | "$P_SRV response_size=16383" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9710 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9711 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9712 | -c "Read from server: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9713 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9714 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9715 | run_test "Large server packet TLS 1.3 AEAD shorter tag" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9716 | "$P_SRV response_size=16383" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9717 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9718 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9719 | -c "Read from server: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9720 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9721 | # Tests for restartable ECC |
| 9722 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9723 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 9724 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9725 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9726 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9727 | run_test "EC restart: TLS, default" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9728 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9729 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9730 | 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] | 9731 | debug_level=1" \ |
| 9732 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9733 | -C "x509_verify_cert.*4b00" \ |
| 9734 | -C "mbedtls_pk_verify.*4b00" \ |
| 9735 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9736 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9737 | |
| 9738 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9739 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9740 | run_test "EC restart: TLS, max_ops=0" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9741 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9742 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9743 | 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] | 9744 | debug_level=1 ec_max_ops=0" \ |
| 9745 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9746 | -C "x509_verify_cert.*4b00" \ |
| 9747 | -C "mbedtls_pk_verify.*4b00" \ |
| 9748 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9749 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9750 | |
| 9751 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9752 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9753 | run_test "EC restart: TLS, max_ops=65535" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9754 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9755 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9756 | 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] | 9757 | debug_level=1 ec_max_ops=65535" \ |
| 9758 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9759 | -C "x509_verify_cert.*4b00" \ |
| 9760 | -C "mbedtls_pk_verify.*4b00" \ |
| 9761 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9762 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9763 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9764 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9765 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9766 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9767 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9768 | run_test "EC restart: TLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9769 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9770 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9771 | 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] | 9772 | debug_level=1 ec_max_ops=1000" \ |
| 9773 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9774 | -c "x509_verify_cert.*4b00" \ |
| 9775 | -c "mbedtls_pk_verify.*4b00" \ |
| 9776 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9777 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9778 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9779 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9780 | # everything except ECDH (where TLS calls PSA directly). |
| 9781 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9782 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9783 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9784 | run_test "EC restart: TLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9785 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9786 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9787 | 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] | 9788 | debug_level=1 ec_max_ops=1000" \ |
| 9789 | 0 \ |
| 9790 | -c "x509_verify_cert.*4b00" \ |
| 9791 | -c "mbedtls_pk_verify.*4b00" \ |
| 9792 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9793 | -c "mbedtls_pk_sign.*4b00" |
| 9794 | |
| 9795 | # This works the same with & without USE_PSA as we never get to ECDH: |
| 9796 | # 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] | 9797 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9798 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9799 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9800 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9801 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9802 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9803 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9804 | 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] | 9805 | debug_level=1 ec_max_ops=1000" \ |
| 9806 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9807 | -c "x509_verify_cert.*4b00" \ |
| 9808 | -C "mbedtls_pk_verify.*4b00" \ |
| 9809 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9810 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9811 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9812 | -c "! mbedtls_ssl_handshake returned" \ |
| 9813 | -c "X509 - Certificate verification failed" |
| 9814 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9815 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9816 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9817 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9818 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9819 | 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] | 9820 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9821 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9822 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9823 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9824 | 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] | 9825 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 9826 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9827 | -c "x509_verify_cert.*4b00" \ |
| 9828 | -c "mbedtls_pk_verify.*4b00" \ |
| 9829 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9830 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9831 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9832 | -C "! mbedtls_ssl_handshake returned" \ |
| 9833 | -C "X509 - Certificate verification failed" |
| 9834 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9835 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9836 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9837 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9838 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9839 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9840 | 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] | 9841 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9842 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9843 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9844 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9845 | 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] | 9846 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 9847 | 0 \ |
| 9848 | -c "x509_verify_cert.*4b00" \ |
| 9849 | -c "mbedtls_pk_verify.*4b00" \ |
| 9850 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9851 | -c "mbedtls_pk_sign.*4b00" \ |
| 9852 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9853 | -C "! mbedtls_ssl_handshake returned" \ |
| 9854 | -C "X509 - Certificate verification failed" |
| 9855 | |
| 9856 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9857 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9858 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9859 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9860 | 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] | 9861 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9862 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9863 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9864 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9865 | 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] | 9866 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 9867 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9868 | -C "x509_verify_cert.*4b00" \ |
| 9869 | -c "mbedtls_pk_verify.*4b00" \ |
| 9870 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9871 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9872 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 9873 | -C "! mbedtls_ssl_handshake returned" \ |
| 9874 | -C "X509 - Certificate verification failed" |
| 9875 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9876 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9877 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9878 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9879 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9880 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9881 | 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] | 9882 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9883 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9884 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9885 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9886 | 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] | 9887 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 9888 | 0 \ |
| 9889 | -C "x509_verify_cert.*4b00" \ |
| 9890 | -c "mbedtls_pk_verify.*4b00" \ |
| 9891 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9892 | -c "mbedtls_pk_sign.*4b00" \ |
| 9893 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 9894 | -C "! mbedtls_ssl_handshake returned" \ |
| 9895 | -C "X509 - Certificate verification failed" |
| 9896 | |
| 9897 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9898 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9899 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9900 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9901 | run_test "EC restart: DTLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9902 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9903 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9904 | 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] | 9905 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 9906 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9907 | -c "x509_verify_cert.*4b00" \ |
| 9908 | -c "mbedtls_pk_verify.*4b00" \ |
| 9909 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9910 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9911 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9912 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9913 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9914 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9915 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9916 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9917 | run_test "EC restart: DTLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9918 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9919 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9920 | 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] | 9921 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 9922 | 0 \ |
| 9923 | -c "x509_verify_cert.*4b00" \ |
| 9924 | -c "mbedtls_pk_verify.*4b00" \ |
| 9925 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9926 | -c "mbedtls_pk_sign.*4b00" |
| 9927 | |
| 9928 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9929 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9930 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9931 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9932 | 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] | 9933 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9934 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9935 | debug_level=1 ec_max_ops=1000" \ |
| 9936 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9937 | -c "x509_verify_cert.*4b00" \ |
| 9938 | -c "mbedtls_pk_verify.*4b00" \ |
| 9939 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9940 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9941 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9942 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9943 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9944 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9945 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9946 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9947 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9948 | 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] | 9949 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9950 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9951 | debug_level=1 ec_max_ops=1000" \ |
| 9952 | 0 \ |
| 9953 | -c "x509_verify_cert.*4b00" \ |
| 9954 | -c "mbedtls_pk_verify.*4b00" \ |
| 9955 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9956 | -C "mbedtls_pk_sign.*4b00" |
| 9957 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9958 | # Restartable is only for ECDHE-ECDSA, with another ciphersuite we expect no |
| 9959 | # restartable behaviour at all (not even client auth). |
| 9960 | # This is the same as "EC restart: TLS, max_ops=1000" except with ECDHE-RSA, |
| 9961 | # and all 4 assertions negated. |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9962 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9963 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9964 | run_test "EC restart: TLS, max_ops=1000, ECDHE-RSA" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9965 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9966 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9967 | 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] | 9968 | debug_level=1 ec_max_ops=1000" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9969 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9970 | -C "x509_verify_cert.*4b00" \ |
| 9971 | -C "mbedtls_pk_verify.*4b00" \ |
| 9972 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9973 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9974 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9975 | # Tests of asynchronous private key support in SSL |
| 9976 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9977 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9978 | run_test "SSL async private: sign, delay=0" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9979 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9980 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9981 | "$P_CLI" \ |
| 9982 | 0 \ |
| 9983 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9984 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9985 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9986 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9987 | run_test "SSL async private: sign, delay=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9988 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9989 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9990 | "$P_CLI" \ |
| 9991 | 0 \ |
| 9992 | -s "Async sign callback: using key slot " \ |
| 9993 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9994 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 9995 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 9996 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 9997 | run_test "SSL async private: sign, delay=2" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9998 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 9999 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 10000 | "$P_CLI" \ |
| 10001 | 0 \ |
| 10002 | -s "Async sign callback: using key slot " \ |
| 10003 | -U "Async sign callback: using key slot " \ |
| 10004 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 10005 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 10006 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 10007 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10008 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 10009 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 10010 | run_test "SSL async private: sign, SNI" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10011 | "$P_SRV force_version=tls12 debug_level=3 \ |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 10012 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10013 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 10014 | 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] | 10015 | "$P_CLI server_name=polarssl.example" \ |
| 10016 | 0 \ |
| 10017 | -s "Async sign callback: using key slot " \ |
| 10018 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 10019 | -s "parse ServerName extension" \ |
| 10020 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 10021 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 10022 | |
| 10023 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10024 | run_test "SSL async private: decrypt, delay=0" \ |
| 10025 | "$P_SRV \ |
| 10026 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 10027 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10028 | 0 \ |
| 10029 | -s "Async decrypt callback: using key slot " \ |
| 10030 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10031 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10032 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10033 | run_test "SSL async private: decrypt, delay=1" \ |
| 10034 | "$P_SRV \ |
| 10035 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 10036 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10037 | 0 \ |
| 10038 | -s "Async decrypt callback: using key slot " \ |
| 10039 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 10040 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10041 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10042 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10043 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10044 | "$P_SRV psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10045 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10046 | "$P_CLI psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10047 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 10048 | 0 \ |
| 10049 | -s "Async decrypt callback: using key slot " \ |
| 10050 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10051 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10052 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10053 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10054 | "$P_SRV psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10055 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10056 | "$P_CLI psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10057 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 10058 | 0 \ |
| 10059 | -s "Async decrypt callback: using key slot " \ |
| 10060 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 10061 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10062 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10063 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10064 | run_test "SSL async private: sign callback not present" \ |
| 10065 | "$P_SRV \ |
| 10066 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10067 | "$P_CLI force_version=tls12; [ \$? -eq 1 ] && |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10068 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10069 | 0 \ |
| 10070 | -S "Async sign callback" \ |
| 10071 | -s "! mbedtls_ssl_handshake returned" \ |
| 10072 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 10073 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 10074 | -s "Successful connection" |
| 10075 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10076 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10077 | run_test "SSL async private: decrypt callback not present" \ |
| 10078 | "$P_SRV debug_level=1 \ |
| 10079 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 10080 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 10081 | [ \$? -eq 1 ] && $P_CLI force_version=tls12" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10082 | 0 \ |
| 10083 | -S "Async decrypt callback" \ |
| 10084 | -s "! mbedtls_ssl_handshake returned" \ |
| 10085 | -s "got no RSA private key" \ |
| 10086 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 10087 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10088 | |
| 10089 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10090 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10091 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10092 | "$P_SRV \ |
| 10093 | async_operations=s async_private_delay1=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10094 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10095 | 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] | 10096 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10097 | 0 \ |
| 10098 | -s "Async sign callback: using key slot 0," \ |
| 10099 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10100 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10101 | |
| 10102 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10103 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10104 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10105 | "$P_SRV \ |
| 10106 | async_operations=s async_private_delay2=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10107 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10108 | 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] | 10109 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10110 | 0 \ |
| 10111 | -s "Async sign callback: using key slot 0," \ |
| 10112 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10113 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10114 | |
| 10115 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10116 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 10117 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10118 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 10119 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10120 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10121 | 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] | 10122 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10123 | 0 \ |
| 10124 | -s "Async sign callback: using key slot 1," \ |
| 10125 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10126 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10127 | |
| 10128 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10129 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10130 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10131 | "$P_SRV \ |
| 10132 | async_operations=s async_private_delay1=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10133 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10134 | 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] | 10135 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10136 | 0 \ |
| 10137 | -s "Async sign callback: no key matches this certificate." |
| 10138 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10139 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10140 | run_test "SSL async private: sign, error in start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10141 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10142 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10143 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10144 | "$P_CLI" \ |
| 10145 | 1 \ |
| 10146 | -s "Async sign callback: injected error" \ |
| 10147 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 10148 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10149 | -s "! mbedtls_ssl_handshake returned" |
| 10150 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10151 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10152 | run_test "SSL async private: sign, cancel after start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10153 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10154 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10155 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10156 | "$P_CLI" \ |
| 10157 | 1 \ |
| 10158 | -s "Async sign callback: using key slot " \ |
| 10159 | -S "Async resume" \ |
| 10160 | -s "Async cancel" |
| 10161 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10162 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10163 | run_test "SSL async private: sign, error in resume" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10164 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10165 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10166 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10167 | "$P_CLI" \ |
| 10168 | 1 \ |
| 10169 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10170 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 10171 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10172 | -s "! mbedtls_ssl_handshake returned" |
| 10173 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10174 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10175 | run_test "SSL async private: decrypt, error in start" \ |
| 10176 | "$P_SRV \ |
| 10177 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10178 | async_private_error=1" \ |
| 10179 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10180 | 1 \ |
| 10181 | -s "Async decrypt callback: injected error" \ |
| 10182 | -S "Async resume" \ |
| 10183 | -S "Async cancel" \ |
| 10184 | -s "! mbedtls_ssl_handshake returned" |
| 10185 | |
| 10186 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 10187 | run_test "SSL async private: decrypt, cancel after start" \ |
| 10188 | "$P_SRV \ |
| 10189 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10190 | async_private_error=2" \ |
| 10191 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10192 | 1 \ |
| 10193 | -s "Async decrypt callback: using key slot " \ |
| 10194 | -S "Async resume" \ |
| 10195 | -s "Async cancel" |
| 10196 | |
| 10197 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 10198 | run_test "SSL async private: decrypt, error in resume" \ |
| 10199 | "$P_SRV \ |
| 10200 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10201 | async_private_error=3" \ |
| 10202 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10203 | 1 \ |
| 10204 | -s "Async decrypt callback: using key slot " \ |
| 10205 | -s "Async resume callback: decrypt done but injected error" \ |
| 10206 | -S "Async cancel" \ |
| 10207 | -s "! mbedtls_ssl_handshake returned" |
| 10208 | |
| 10209 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10210 | run_test "SSL async private: cancel after start then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10211 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10212 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10213 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10214 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 10215 | 0 \ |
| 10216 | -s "Async cancel" \ |
| 10217 | -s "! mbedtls_ssl_handshake returned" \ |
| 10218 | -s "Async resume" \ |
| 10219 | -s "Successful connection" |
| 10220 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10221 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10222 | run_test "SSL async private: error in resume then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10223 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10224 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10225 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10226 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 10227 | 0 \ |
| 10228 | -s "! mbedtls_ssl_handshake returned" \ |
| 10229 | -s "Async resume" \ |
| 10230 | -s "Successful connection" |
| 10231 | |
| 10232 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10233 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 10234 | # Note: the function "detect_required_features()" is not able to detect more than |
| 10235 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 10236 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 10237 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10238 | 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] | 10239 | "$P_SRV \ |
| 10240 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10241 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10242 | 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] | 10243 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 10244 | [ \$? -eq 1 ] && |
| 10245 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10246 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 10247 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10248 | -S "Async resume" \ |
| 10249 | -s "Async cancel" \ |
| 10250 | -s "! mbedtls_ssl_handshake returned" \ |
| 10251 | -s "Async sign callback: no key matches this certificate." \ |
| 10252 | -s "Successful connection" |
| 10253 | |
| 10254 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10255 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 10256 | # Note: the function "detect_required_features()" is not able to detect more than |
| 10257 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 10258 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 10259 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10260 | 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] | 10261 | "$P_SRV \ |
| 10262 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10263 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10264 | 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] | 10265 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 10266 | [ \$? -eq 1 ] && |
| 10267 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10268 | 0 \ |
| 10269 | -s "Async resume" \ |
| 10270 | -s "! mbedtls_ssl_handshake returned" \ |
| 10271 | -s "Async sign callback: no key matches this certificate." \ |
| 10272 | -s "Successful connection" |
| 10273 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10274 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10275 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10276 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10277 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10278 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10279 | exchanges=2 renegotiation=1" \ |
| 10280 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10281 | 0 \ |
| 10282 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10283 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10284 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10285 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10286 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10287 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10288 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10289 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10290 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10291 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 10292 | 0 \ |
| 10293 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10294 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 10295 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10296 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10297 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10298 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10299 | "$P_SRV \ |
| 10300 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10301 | exchanges=2 renegotiation=1" \ |
| 10302 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 10303 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10304 | 0 \ |
| 10305 | -s "Async decrypt callback: using key slot " \ |
| 10306 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10307 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10308 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10309 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10310 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10311 | "$P_SRV \ |
| 10312 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10313 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10314 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 10315 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10316 | 0 \ |
| 10317 | -s "Async decrypt callback: using key slot " \ |
| 10318 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10319 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10320 | # Tests for ECC extensions (rfc 4492) |
| 10321 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10322 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10323 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10324 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 10325 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10326 | "$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] | 10327 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 10328 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10329 | -C "client hello, adding supported_point_formats extension" \ |
| 10330 | -S "found supported elliptic curves extension" \ |
| 10331 | -S "found supported point formats extension" |
| 10332 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10333 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10334 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10335 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10336 | "$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] | 10337 | "$P_CLI debug_level=3" \ |
| 10338 | 0 \ |
| 10339 | -C "found supported_point_formats extension" \ |
| 10340 | -S "server hello, supported_point_formats extension" |
| 10341 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10342 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10343 | run_test "Force an ECC ciphersuite in the client side" \ |
| 10344 | "$P_SRV debug_level=3" \ |
| 10345 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10346 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 10347 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10348 | -c "client hello, adding supported_point_formats extension" \ |
| 10349 | -s "found supported elliptic curves extension" \ |
| 10350 | -s "found supported point formats extension" |
| 10351 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10352 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10353 | run_test "Force an ECC ciphersuite in the server side" \ |
| 10354 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10355 | "$P_CLI debug_level=3" \ |
| 10356 | 0 \ |
| 10357 | -c "found supported_point_formats extension" \ |
| 10358 | -s "server hello, supported_point_formats extension" |
| 10359 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10360 | # Tests for DTLS HelloVerifyRequest |
| 10361 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10362 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10363 | run_test "DTLS cookie: enabled" \ |
| 10364 | "$P_SRV dtls=1 debug_level=2" \ |
| 10365 | "$P_CLI dtls=1 debug_level=2" \ |
| 10366 | 0 \ |
| 10367 | -s "cookie verification failed" \ |
| 10368 | -s "cookie verification passed" \ |
| 10369 | -S "cookie verification skipped" \ |
| 10370 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10371 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10372 | -S "SSL - The requested feature is not available" |
| 10373 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10374 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10375 | run_test "DTLS cookie: disabled" \ |
| 10376 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 10377 | "$P_CLI dtls=1 debug_level=2" \ |
| 10378 | 0 \ |
| 10379 | -S "cookie verification failed" \ |
| 10380 | -S "cookie verification passed" \ |
| 10381 | -s "cookie verification skipped" \ |
| 10382 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10383 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10384 | -S "SSL - The requested feature is not available" |
| 10385 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10387 | run_test "DTLS cookie: default (failing)" \ |
| 10388 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 10389 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 10390 | 1 \ |
| 10391 | -s "cookie verification failed" \ |
| 10392 | -S "cookie verification passed" \ |
| 10393 | -S "cookie verification skipped" \ |
| 10394 | -C "received hello verify request" \ |
| 10395 | -S "hello verification requested" \ |
| 10396 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10397 | |
| 10398 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10399 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10400 | run_test "DTLS cookie: enabled, IPv6" \ |
| 10401 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 10402 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 10403 | 0 \ |
| 10404 | -s "cookie verification failed" \ |
| 10405 | -s "cookie verification passed" \ |
| 10406 | -S "cookie verification skipped" \ |
| 10407 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10408 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10409 | -S "SSL - The requested feature is not available" |
| 10410 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10411 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 10412 | run_test "DTLS cookie: enabled, nbio" \ |
| 10413 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 10414 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10415 | 0 \ |
| 10416 | -s "cookie verification failed" \ |
| 10417 | -s "cookie verification passed" \ |
| 10418 | -S "cookie verification skipped" \ |
| 10419 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10420 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 10421 | -S "SSL - The requested feature is not available" |
| 10422 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10423 | # Tests for client reconnecting from the same port with DTLS |
| 10424 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10425 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10426 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10427 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10428 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 10429 | "$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] | 10430 | 0 \ |
| 10431 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10432 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10433 | -S "Client initiated reconnection from same port" |
| 10434 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10435 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10436 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10437 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10438 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 10439 | "$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] | 10440 | 0 \ |
| 10441 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10442 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10443 | -s "Client initiated reconnection from same port" |
| 10444 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10445 | 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] | 10446 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10447 | 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] | 10448 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 10449 | "$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] | 10450 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10451 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10452 | -s "Client initiated reconnection from same port" |
| 10453 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10454 | 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] | 10455 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10456 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 10457 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 10458 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 10459 | 0 \ |
| 10460 | -S "The operation timed out" \ |
| 10461 | -s "Client initiated reconnection from same port" |
| 10462 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10463 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10464 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 10465 | "$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] | 10466 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 10467 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10468 | -s "The operation timed out" \ |
| 10469 | -S "Client initiated reconnection from same port" |
| 10470 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10471 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 10472 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 10473 | -p "$P_PXY inject_clihlo=1" \ |
| 10474 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 10475 | "$P_CLI dtls=1 exchanges=2" \ |
| 10476 | 0 \ |
| 10477 | -s "possible client reconnect from the same port" \ |
| 10478 | -S "Client initiated reconnection from same port" |
| 10479 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10480 | # Tests for various cases of client authentication with DTLS |
| 10481 | # (focused on handshake flows and message parsing) |
| 10482 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10483 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10484 | run_test "DTLS client auth: required" \ |
| 10485 | "$P_SRV dtls=1 auth_mode=required" \ |
| 10486 | "$P_CLI dtls=1" \ |
| 10487 | 0 \ |
| 10488 | -s "Verifying peer X.509 certificate... ok" |
| 10489 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10490 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10491 | run_test "DTLS client auth: optional, client has no cert" \ |
| 10492 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 10493 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 10494 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10495 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10496 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10497 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10498 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10499 | "$P_SRV dtls=1 auth_mode=none" \ |
| 10500 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 10501 | 0 \ |
| 10502 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10503 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10504 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 10505 | run_test "DTLS wrong PSK: badmac alert" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10506 | "$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] | 10507 | "$P_CLI dtls=1 psk=73776f726466697374" \ |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 10508 | 1 \ |
| 10509 | -s "SSL - Verification of the message MAC failed" \ |
| 10510 | -c "SSL - A fatal alert message was received from our peer" |
| 10511 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10512 | # Tests for receiving fragmented handshake messages with DTLS |
| 10513 | |
| 10514 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10516 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 10517 | "$G_SRV -u --mtu 2048 -a" \ |
| 10518 | "$P_CLI dtls=1 debug_level=2" \ |
| 10519 | 0 \ |
| 10520 | -C "found fragmented DTLS handshake message" \ |
| 10521 | -C "error" |
| 10522 | |
| 10523 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10524 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10525 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 10526 | "$G_SRV -u --mtu 512" \ |
| 10527 | "$P_CLI dtls=1 debug_level=2" \ |
| 10528 | 0 \ |
| 10529 | -c "found fragmented DTLS handshake message" \ |
| 10530 | -C "error" |
| 10531 | |
| 10532 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10533 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10534 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 10535 | "$G_SRV -u --mtu 128" \ |
| 10536 | "$P_CLI dtls=1 debug_level=2" \ |
| 10537 | 0 \ |
| 10538 | -c "found fragmented DTLS handshake message" \ |
| 10539 | -C "error" |
| 10540 | |
| 10541 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10542 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10543 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 10544 | "$G_SRV -u --mtu 128" \ |
| 10545 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10546 | 0 \ |
| 10547 | -c "found fragmented DTLS handshake message" \ |
| 10548 | -C "error" |
| 10549 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10550 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10551 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10552 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10553 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 10554 | "$G_SRV -u --mtu 256" \ |
| 10555 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 10556 | 0 \ |
| 10557 | -c "found fragmented DTLS handshake message" \ |
| 10558 | -c "client hello, adding renegotiation extension" \ |
| 10559 | -c "found renegotiation extension" \ |
| 10560 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 10561 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10562 | -C "error" \ |
| 10563 | -s "Extra-header:" |
| 10564 | |
| 10565 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10566 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10567 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10568 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 10569 | "$G_SRV -u --mtu 256" \ |
| 10570 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 10571 | 0 \ |
| 10572 | -c "found fragmented DTLS handshake message" \ |
| 10573 | -c "client hello, adding renegotiation extension" \ |
| 10574 | -c "found renegotiation extension" \ |
| 10575 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 10576 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10577 | -C "error" \ |
| 10578 | -s "Extra-header:" |
| 10579 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10580 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10581 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 10582 | "$O_SRV -dtls -mtu 2048" \ |
| 10583 | "$P_CLI dtls=1 debug_level=2" \ |
| 10584 | 0 \ |
| 10585 | -C "found fragmented DTLS handshake message" \ |
| 10586 | -C "error" |
| 10587 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10588 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10589 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 10590 | "$O_SRV -dtls -mtu 256" \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10591 | "$P_CLI dtls=1 debug_level=2" \ |
| 10592 | 0 \ |
| 10593 | -c "found fragmented DTLS handshake message" \ |
| 10594 | -C "error" |
| 10595 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10596 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10597 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 10598 | "$O_SRV -dtls -mtu 256" \ |
| 10599 | "$P_CLI dtls=1 debug_level=2" \ |
| 10600 | 0 \ |
| 10601 | -c "found fragmented DTLS handshake message" \ |
| 10602 | -C "error" |
| 10603 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10604 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10605 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 10606 | "$O_SRV -dtls -mtu 256" \ |
| 10607 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10608 | 0 \ |
| 10609 | -c "found fragmented DTLS handshake message" \ |
| 10610 | -C "error" |
| 10611 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10612 | # Tests for sending fragmented handshake messages with DTLS |
| 10613 | # |
| 10614 | # Use client auth when we need the client to send large messages, |
| 10615 | # and use large cert chains on both sides too (the long chains we have all use |
| 10616 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 10617 | # Sizes reached (UDP payload): |
| 10618 | # - 2037B for server certificate |
| 10619 | # - 1542B for client certificate |
| 10620 | # - 1013B for newsessionticket |
| 10621 | # - all others below 512B |
| 10622 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 10623 | |
| 10624 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10625 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10626 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10627 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10629 | run_test "DTLS fragmenting: none (for reference)" \ |
| 10630 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10631 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10632 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10633 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10634 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10635 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10636 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10637 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10638 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10639 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10640 | 0 \ |
| 10641 | -S "found fragmented DTLS handshake message" \ |
| 10642 | -C "found fragmented DTLS handshake message" \ |
| 10643 | -C "error" |
| 10644 | |
| 10645 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10646 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10647 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10648 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10649 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10650 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10651 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10652 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10653 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10654 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10655 | max_frag_len=1024" \ |
| 10656 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10657 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10658 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10659 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10660 | max_frag_len=2048" \ |
| 10661 | 0 \ |
| 10662 | -S "found fragmented DTLS handshake message" \ |
| 10663 | -c "found fragmented DTLS handshake message" \ |
| 10664 | -C "error" |
| 10665 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 10666 | # With the MFL extension, the server has no way of forcing |
| 10667 | # the client to not exceed a certain MTU; hence, the following |
| 10668 | # test can't be replicated with an MTU proxy such as the one |
| 10669 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10670 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10671 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10672 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10673 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10674 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10675 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10676 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10677 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10678 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10679 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10680 | max_frag_len=512" \ |
| 10681 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10682 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10683 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10684 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 10685 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10686 | 0 \ |
| 10687 | -S "found fragmented DTLS handshake message" \ |
| 10688 | -c "found fragmented DTLS handshake message" \ |
| 10689 | -C "error" |
| 10690 | |
| 10691 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10692 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10693 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10694 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10695 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10696 | 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] | 10697 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10698 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10699 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10700 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10701 | max_frag_len=2048" \ |
| 10702 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10703 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10704 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10705 | hs_timeout=2500-60000 \ |
| 10706 | max_frag_len=1024" \ |
| 10707 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10708 | -S "found fragmented DTLS handshake message" \ |
| 10709 | -c "found fragmented DTLS handshake message" \ |
| 10710 | -C "error" |
| 10711 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10712 | # While not required by the standard defining the MFL extension |
| 10713 | # (according to which it only applies to records, not to datagrams), |
| 10714 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 10715 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 10716 | # to the peer. |
| 10717 | # The next test checks that no datagrams significantly larger than the |
| 10718 | # negotiated MFL are sent. |
| 10719 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10720 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10721 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10722 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10723 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10724 | 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] | 10725 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10726 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10727 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10728 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10729 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10730 | max_frag_len=2048" \ |
| 10731 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10732 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10733 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10734 | hs_timeout=2500-60000 \ |
| 10735 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10736 | 0 \ |
| 10737 | -S "found fragmented DTLS handshake message" \ |
| 10738 | -c "found fragmented DTLS handshake message" \ |
| 10739 | -C "error" |
| 10740 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10741 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10742 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10743 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10744 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10745 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10746 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10747 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10748 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10749 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10750 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10751 | max_frag_len=2048" \ |
| 10752 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10753 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10754 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10755 | hs_timeout=2500-60000 \ |
| 10756 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10757 | 0 \ |
| 10758 | -s "found fragmented DTLS handshake message" \ |
| 10759 | -c "found fragmented DTLS handshake message" \ |
| 10760 | -C "error" |
| 10761 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10762 | # While not required by the standard defining the MFL extension |
| 10763 | # (according to which it only applies to records, not to datagrams), |
| 10764 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 10765 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 10766 | # to the peer. |
| 10767 | # The next test checks that no datagrams significantly larger than the |
| 10768 | # negotiated MFL are sent. |
| 10769 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10770 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10771 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10772 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10773 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10774 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 10775 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10776 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10777 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10778 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10779 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10780 | max_frag_len=2048" \ |
| 10781 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10782 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10783 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10784 | hs_timeout=2500-60000 \ |
| 10785 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10786 | 0 \ |
| 10787 | -s "found fragmented DTLS handshake message" \ |
| 10788 | -c "found fragmented DTLS handshake message" \ |
| 10789 | -C "error" |
| 10790 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10791 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10792 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10793 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10795 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 10796 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10797 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10798 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10799 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10800 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10801 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10802 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10803 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10804 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10805 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10806 | 0 \ |
| 10807 | -S "found fragmented DTLS handshake message" \ |
| 10808 | -C "found fragmented DTLS handshake message" \ |
| 10809 | -C "error" |
| 10810 | |
| 10811 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10812 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10813 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10814 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10815 | run_test "DTLS fragmenting: client (MTU)" \ |
| 10816 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10817 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10818 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10819 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10820 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10821 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10822 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10823 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10824 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10825 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10826 | 0 \ |
| 10827 | -s "found fragmented DTLS handshake message" \ |
| 10828 | -C "found fragmented DTLS handshake message" \ |
| 10829 | -C "error" |
| 10830 | |
| 10831 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10832 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10833 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10834 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10835 | run_test "DTLS fragmenting: server (MTU)" \ |
| 10836 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10837 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10838 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10839 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10840 | mtu=512" \ |
| 10841 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10842 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10843 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10844 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10845 | mtu=2048" \ |
| 10846 | 0 \ |
| 10847 | -S "found fragmented DTLS handshake message" \ |
| 10848 | -c "found fragmented DTLS handshake message" \ |
| 10849 | -C "error" |
| 10850 | |
| 10851 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10852 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10853 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10854 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10855 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10856 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10857 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10858 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10859 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10860 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 10861 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10862 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10863 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10864 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10865 | hs_timeout=2500-60000 \ |
| 10866 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10867 | 0 \ |
| 10868 | -s "found fragmented DTLS handshake message" \ |
| 10869 | -c "found fragmented DTLS handshake message" \ |
| 10870 | -C "error" |
| 10871 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10872 | # 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] | 10873 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10874 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10875 | requires_hash_alg SHA_256 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10876 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10877 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 10878 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 10879 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10880 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10881 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10882 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 10883 | mtu=512" \ |
| 10884 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10885 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10886 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10887 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10888 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10889 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10890 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10891 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10892 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10893 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10894 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10895 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10896 | # 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] | 10897 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 10898 | # retransmissions, but in some cases (like both the server and client using |
| 10899 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 10900 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 10901 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 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 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 10905 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10906 | -p "$P_PXY mtu=508" \ |
| 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=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10911 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10912 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10913 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10914 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10915 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10916 | 0 \ |
| 10917 | -s "found fragmented DTLS handshake message" \ |
| 10918 | -c "found fragmented DTLS handshake message" \ |
| 10919 | -C "error" |
| 10920 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10921 | # 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] | 10922 | only_with_valgrind |
| 10923 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10924 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10925 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 10926 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10927 | -p "$P_PXY mtu=508" \ |
| 10928 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10929 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10930 | key_file=$DATA_FILES_PATH/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10931 | hs_timeout=250-10000" \ |
| 10932 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10933 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10934 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10935 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10936 | hs_timeout=250-10000" \ |
| 10937 | 0 \ |
| 10938 | -s "found fragmented DTLS handshake message" \ |
| 10939 | -c "found fragmented DTLS handshake message" \ |
| 10940 | -C "error" |
| 10941 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10942 | # 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] | 10943 | # OTOH the client might resend if the server is to slow to reset after sending |
| 10944 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10945 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10946 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10947 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10948 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10950 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10951 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10952 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10953 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10954 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10955 | hs_timeout=10000-60000 \ |
| 10956 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10957 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10958 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10959 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10960 | hs_timeout=10000-60000 \ |
| 10961 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10962 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10963 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10964 | -s "found fragmented DTLS handshake message" \ |
| 10965 | -c "found fragmented DTLS handshake message" \ |
| 10966 | -C "error" |
| 10967 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10968 | # 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] | 10969 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 10970 | # OTOH the client might resend if the server is to slow to reset after sending |
| 10971 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10972 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10973 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10974 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10975 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10976 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10977 | -p "$P_PXY mtu=512" \ |
| 10978 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10979 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10980 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10981 | hs_timeout=10000-60000 \ |
| 10982 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10983 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10984 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10985 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10986 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10987 | hs_timeout=10000-60000 \ |
| 10988 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10989 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10990 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10991 | -s "found fragmented DTLS handshake message" \ |
| 10992 | -c "found fragmented DTLS handshake message" \ |
| 10993 | -C "error" |
| 10994 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10995 | not_with_valgrind # spurious autoreduction due to timeout |
| 10996 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10997 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10998 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10999 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11000 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11001 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11002 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11003 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11004 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11005 | hs_timeout=10000-60000 \ |
| 11006 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11007 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11008 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11009 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11010 | hs_timeout=10000-60000 \ |
| 11011 | mtu=1024 nbio=2" \ |
| 11012 | 0 \ |
| 11013 | -S "autoreduction" \ |
| 11014 | -s "found fragmented DTLS handshake message" \ |
| 11015 | -c "found fragmented DTLS handshake message" \ |
| 11016 | -C "error" |
| 11017 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11018 | # 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] | 11019 | not_with_valgrind # spurious autoreduction due to timeout |
| 11020 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11021 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11022 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11023 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 11024 | -p "$P_PXY mtu=512" \ |
| 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 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11028 | hs_timeout=10000-60000 \ |
| 11029 | mtu=512 nbio=2" \ |
| 11030 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11031 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11032 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11033 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 11034 | hs_timeout=10000-60000 \ |
| 11035 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11036 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11037 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11038 | -s "found fragmented DTLS handshake message" \ |
| 11039 | -c "found fragmented DTLS handshake message" \ |
| 11040 | -C "error" |
| 11041 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11042 | # 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] | 11043 | # This ensures things still work after session_reset(). |
| 11044 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11045 | # Since we don't support reading fragmented ClientHello yet, |
| 11046 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 11047 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11048 | # An autoreduction on the client-side might happen if the server is |
| 11049 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 11050 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11051 | # resumed listening, which would result in a spurious autoreduction. |
| 11052 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11053 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11054 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11055 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11056 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 11057 | -p "$P_PXY mtu=1450" \ |
| 11058 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11059 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11060 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11061 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11062 | mtu=1450" \ |
| 11063 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11064 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11065 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11066 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11067 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 11068 | 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] | 11069 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11070 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11071 | -s "found fragmented DTLS handshake message" \ |
| 11072 | -c "found fragmented DTLS handshake message" \ |
| 11073 | -C "error" |
| 11074 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11075 | # An autoreduction on the client-side might happen if the server is |
| 11076 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11077 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11078 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11079 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11080 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11081 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11082 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11083 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 11084 | -p "$P_PXY mtu=512" \ |
| 11085 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11086 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11087 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11088 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11089 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11090 | mtu=512" \ |
| 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 \ |
Ronald Cron | 60f7666 | 2023-11-28 17:52:42 +0100 | [diff] [blame] | 11095 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11096 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11097 | mtu=512" \ |
| 11098 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11099 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11100 | -s "found fragmented DTLS handshake message" \ |
| 11101 | -c "found fragmented DTLS handshake message" \ |
| 11102 | -C "error" |
| 11103 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11104 | # An autoreduction on the client-side might happen if the server is |
| 11105 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11106 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11107 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11108 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11109 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11110 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11111 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11112 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 11113 | -p "$P_PXY mtu=512" \ |
| 11114 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11115 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11116 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11117 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11118 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11119 | mtu=512" \ |
| 11120 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11121 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11122 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11123 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11124 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11125 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11126 | mtu=512" \ |
| 11127 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11128 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11129 | -s "found fragmented DTLS handshake message" \ |
| 11130 | -c "found fragmented DTLS handshake message" \ |
| 11131 | -C "error" |
| 11132 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11133 | # An autoreduction on the client-side might happen if the server is |
| 11134 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11135 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11136 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11137 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11138 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11139 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11140 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11141 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11142 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11143 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11144 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11145 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11146 | exchanges=2 renegotiation=1 \ |
| 11147 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11148 | hs_timeout=10000-60000 \ |
| 11149 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11150 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11151 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11152 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11153 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11154 | hs_timeout=10000-60000 \ |
| 11155 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11156 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11157 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11158 | -s "found fragmented DTLS handshake message" \ |
| 11159 | -c "found fragmented DTLS handshake message" \ |
| 11160 | -C "error" |
| 11161 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11162 | # An autoreduction on the client-side might happen if the server is |
| 11163 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11164 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11165 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11166 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11167 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11168 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11169 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11170 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11171 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11172 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11173 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11174 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11175 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11176 | exchanges=2 renegotiation=1 \ |
| 11177 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11178 | hs_timeout=10000-60000 \ |
| 11179 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11180 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11181 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11182 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11183 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11184 | hs_timeout=10000-60000 \ |
| 11185 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11186 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11187 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11188 | -s "found fragmented DTLS handshake message" \ |
| 11189 | -c "found fragmented DTLS handshake message" \ |
| 11190 | -C "error" |
| 11191 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11192 | # An autoreduction on the client-side might happen if the server is |
| 11193 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11194 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11195 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11196 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11197 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11198 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11199 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11200 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11201 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11202 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11203 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11204 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11205 | exchanges=2 renegotiation=1 \ |
| 11206 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11207 | hs_timeout=10000-60000 \ |
| 11208 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11209 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11210 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11211 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11212 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11213 | hs_timeout=10000-60000 \ |
| 11214 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11215 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11216 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11217 | -s "found fragmented DTLS handshake message" \ |
| 11218 | -c "found fragmented DTLS handshake message" \ |
| 11219 | -C "error" |
| 11220 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11221 | # 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] | 11222 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11223 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11224 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11225 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11226 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 11227 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11228 | "$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] | 11229 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11230 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11231 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11232 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11233 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11234 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11235 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11236 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11237 | 0 \ |
| 11238 | -s "found fragmented DTLS handshake message" \ |
| 11239 | -c "found fragmented DTLS handshake message" \ |
| 11240 | -C "error" |
| 11241 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11242 | # 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] | 11243 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11244 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11245 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11246 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11247 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 11248 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 11249 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11250 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11251 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11252 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 11253 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11254 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11255 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11256 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11257 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 11258 | 0 \ |
| 11259 | -s "found fragmented DTLS handshake message" \ |
| 11260 | -c "found fragmented DTLS handshake message" \ |
| 11261 | -C "error" |
| 11262 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11263 | # interop tests for DTLS fragmentating with reliable connection |
| 11264 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11265 | # here and below we just want to test that the we fragment in a way that |
| 11266 | # pleases other implementations, so we don't need the peer to fragment |
| 11267 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11268 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 11269 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11270 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11271 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 11272 | "$G_SRV -u" \ |
| 11273 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11274 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11275 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11276 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11277 | 0 \ |
| 11278 | -c "fragmenting handshake message" \ |
| 11279 | -C "error" |
| 11280 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 11281 | # We use --insecure for the GnuTLS client because it expects |
| 11282 | # the hostname / IP it connects to to be the name used in the |
| 11283 | # certificate obtained from the server. Here, however, it |
| 11284 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 11285 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 11286 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 11287 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11288 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11289 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 11290 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 11291 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11292 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11293 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Valerio Setti | 3b2c028 | 2023-03-08 10:22:29 +0100 | [diff] [blame] | 11294 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11295 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11296 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11297 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 11298 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11299 | 0 \ |
| 11300 | -s "fragmenting handshake message" |
| 11301 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11302 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11303 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11304 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11305 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 11306 | "$O_SRV -dtls1_2 -verify 10" \ |
| 11307 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11308 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11309 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11310 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11311 | 0 \ |
| 11312 | -c "fragmenting handshake message" \ |
| 11313 | -C "error" |
| 11314 | |
| 11315 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11316 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11317 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11318 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 11319 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11320 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11321 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11322 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11323 | "$O_CLI -dtls1_2" \ |
| 11324 | 0 \ |
| 11325 | -s "fragmenting handshake message" |
| 11326 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11327 | # interop tests for DTLS fragmentating with unreliable connection |
| 11328 | # |
| 11329 | # again we just want to test that the we fragment in a way that |
| 11330 | # pleases other implementations, so we don't need the peer to fragment |
| 11331 | requires_gnutls_next |
| 11332 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11333 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11334 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11335 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11336 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 11337 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11338 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11339 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11340 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11341 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11342 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11343 | 0 \ |
| 11344 | -c "fragmenting handshake message" \ |
| 11345 | -C "error" |
| 11346 | |
| 11347 | requires_gnutls_next |
| 11348 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11349 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11350 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11351 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11352 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 11353 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11354 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11355 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11356 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11357 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11358 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11359 | 0 \ |
| 11360 | -s "fragmenting handshake message" |
| 11361 | |
Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 11362 | ## The test below requires 1.1.1a or higher version of openssl, otherwise |
| 11363 | ## 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] | 11364 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11365 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11366 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11367 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11368 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11369 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 11370 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11371 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11372 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11373 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11374 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11375 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11376 | 0 \ |
| 11377 | -c "fragmenting handshake message" \ |
| 11378 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11379 | |
Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 11380 | ## the test below will time out with certain seed. |
Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 11381 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 11382 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11383 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11384 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11385 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11386 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11387 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 11388 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11389 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11390 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11391 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11392 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11393 | "$O_CLI -dtls1_2" \ |
| 11394 | 0 \ |
| 11395 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11396 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11397 | # Tests for DTLS-SRTP (RFC 5764) |
| 11398 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11399 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11400 | run_test "DTLS-SRTP all profiles supported" \ |
| 11401 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11402 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11403 | 0 \ |
| 11404 | -s "found use_srtp extension" \ |
| 11405 | -s "found srtp profile" \ |
| 11406 | -s "selected srtp profile" \ |
| 11407 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11408 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11409 | -c "client hello, adding use_srtp extension" \ |
| 11410 | -c "found use_srtp extension" \ |
| 11411 | -c "found srtp profile" \ |
| 11412 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11413 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11414 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11415 | -C "error" |
| 11416 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11417 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11418 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11419 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11420 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 11421 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11422 | "$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] | 11423 | 0 \ |
| 11424 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11425 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 11426 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11427 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11428 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11429 | -c "client hello, adding use_srtp extension" \ |
| 11430 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11431 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11432 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11433 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11434 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11435 | -C "error" |
| 11436 | |
| 11437 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11438 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11439 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11440 | "$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] | 11441 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11442 | 0 \ |
| 11443 | -s "found use_srtp extension" \ |
| 11444 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11445 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11446 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11447 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11448 | -c "client hello, adding use_srtp extension" \ |
| 11449 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11450 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11451 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11452 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11453 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11454 | -C "error" |
| 11455 | |
| 11456 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11457 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11458 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 11459 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11460 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11461 | 0 \ |
| 11462 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11463 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11464 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11465 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11466 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11467 | -c "client hello, adding use_srtp extension" \ |
| 11468 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11469 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11470 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11471 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11472 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11473 | -C "error" |
| 11474 | |
| 11475 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11476 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11477 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 11478 | "$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] | 11479 | "$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] | 11480 | 0 \ |
| 11481 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11482 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11483 | -S "selected srtp profile" \ |
| 11484 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11485 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11486 | -c "client hello, adding use_srtp extension" \ |
| 11487 | -C "found use_srtp extension" \ |
| 11488 | -C "found srtp profile" \ |
| 11489 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11490 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11491 | -C "error" |
| 11492 | |
| 11493 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11495 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 11496 | "$P_SRV dtls=1 debug_level=3" \ |
| 11497 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11498 | 0 \ |
| 11499 | -s "found use_srtp extension" \ |
| 11500 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11501 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11502 | -c "client hello, adding use_srtp extension" \ |
| 11503 | -C "found use_srtp extension" \ |
| 11504 | -C "found srtp profile" \ |
| 11505 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11506 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11507 | -C "error" |
| 11508 | |
| 11509 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11511 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 11512 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 11513 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11514 | 0 \ |
| 11515 | -s "found use_srtp extension" \ |
| 11516 | -s "found srtp profile" \ |
| 11517 | -s "selected srtp profile" \ |
| 11518 | -s "server hello, adding use_srtp extension" \ |
| 11519 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11520 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11521 | -c "client hello, adding use_srtp extension" \ |
| 11522 | -c "found use_srtp extension" \ |
| 11523 | -c "found srtp profile" \ |
| 11524 | -c "selected srtp profile" \ |
| 11525 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11526 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11527 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11528 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 11529 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11530 | -C "error" |
| 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 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11534 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 11535 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11536 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11537 | 0 \ |
| 11538 | -s "found use_srtp extension" \ |
| 11539 | -s "found srtp profile" \ |
| 11540 | -s "selected srtp profile" \ |
| 11541 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11542 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 11543 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11544 | -S "dumping 'using mki' (8 bytes)" \ |
| 11545 | -c "client hello, adding use_srtp extension" \ |
| 11546 | -c "found use_srtp extension" \ |
| 11547 | -c "found srtp profile" \ |
| 11548 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11549 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 11550 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11551 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11552 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11553 | -C "dumping 'received mki' (8 bytes)" \ |
| 11554 | -C "error" |
| 11555 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11556 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11557 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11558 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 11559 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11560 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11561 | 0 \ |
| 11562 | -s "found use_srtp extension" \ |
| 11563 | -s "found srtp profile" \ |
| 11564 | -s "selected srtp profile" \ |
| 11565 | -s "server hello, adding use_srtp extension" \ |
| 11566 | -s "DTLS-SRTP key material is"\ |
| 11567 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11568 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 11569 | |
| 11570 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11571 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11572 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 11573 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11574 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11575 | 0 \ |
| 11576 | -s "found use_srtp extension" \ |
| 11577 | -s "found srtp profile" \ |
| 11578 | -s "selected srtp profile" \ |
| 11579 | -s "server hello, adding use_srtp extension" \ |
| 11580 | -s "DTLS-SRTP key material is"\ |
| 11581 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11582 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 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 supports all profiles. Client supports one profile. openssl client." \ |
| 11587 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11588 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11589 | 0 \ |
| 11590 | -s "found use_srtp extension" \ |
| 11591 | -s "found srtp profile" \ |
| 11592 | -s "selected srtp profile" \ |
| 11593 | -s "server hello, adding use_srtp extension" \ |
| 11594 | -s "DTLS-SRTP key material is"\ |
| 11595 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11596 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11597 | |
| 11598 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11599 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11600 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 11601 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11602 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11603 | 0 \ |
| 11604 | -s "found use_srtp extension" \ |
| 11605 | -s "found srtp profile" \ |
| 11606 | -s "selected srtp profile" \ |
| 11607 | -s "server hello, adding use_srtp extension" \ |
| 11608 | -s "DTLS-SRTP key material is"\ |
| 11609 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11610 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11611 | |
| 11612 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11613 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11614 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 11615 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11616 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11617 | 0 \ |
| 11618 | -s "found use_srtp extension" \ |
| 11619 | -s "found srtp profile" \ |
| 11620 | -s "selected srtp profile" \ |
| 11621 | -s "server hello, adding use_srtp extension" \ |
| 11622 | -s "DTLS-SRTP key material is"\ |
| 11623 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11624 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11625 | |
| 11626 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11627 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11628 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 11629 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 11630 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11631 | 0 \ |
| 11632 | -s "found use_srtp extension" \ |
| 11633 | -s "found srtp profile" \ |
| 11634 | -S "selected srtp profile" \ |
| 11635 | -S "server hello, adding use_srtp extension" \ |
| 11636 | -S "DTLS-SRTP key material is"\ |
| 11637 | -C "SRTP Extension negotiated, profile" |
| 11638 | |
| 11639 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11640 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11641 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 11642 | "$P_SRV dtls=1 debug_level=3" \ |
| 11643 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11644 | 0 \ |
| 11645 | -s "found use_srtp extension" \ |
| 11646 | -S "server hello, adding use_srtp extension" \ |
| 11647 | -S "DTLS-SRTP key material is"\ |
| 11648 | -C "SRTP Extension negotiated, profile" |
| 11649 | |
| 11650 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11651 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11652 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 11653 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11654 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11655 | 0 \ |
| 11656 | -c "client hello, adding use_srtp extension" \ |
| 11657 | -c "found use_srtp extension" \ |
| 11658 | -c "found srtp profile" \ |
| 11659 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 11660 | -c "DTLS-SRTP key material is"\ |
| 11661 | -C "error" |
| 11662 | |
| 11663 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11665 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 11666 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11667 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11668 | 0 \ |
| 11669 | -c "client hello, adding use_srtp extension" \ |
| 11670 | -c "found use_srtp extension" \ |
| 11671 | -c "found srtp profile" \ |
| 11672 | -c "selected srtp profile" \ |
| 11673 | -c "DTLS-SRTP key material is"\ |
| 11674 | -C "error" |
| 11675 | |
| 11676 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11677 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11678 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 11679 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11680 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11681 | 0 \ |
| 11682 | -c "client hello, adding use_srtp extension" \ |
| 11683 | -c "found use_srtp extension" \ |
| 11684 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11685 | -c "selected srtp profile" \ |
| 11686 | -c "DTLS-SRTP key material is"\ |
| 11687 | -C "error" |
| 11688 | |
| 11689 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11691 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 11692 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11693 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11694 | 0 \ |
| 11695 | -c "client hello, adding use_srtp extension" \ |
| 11696 | -c "found use_srtp extension" \ |
| 11697 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11698 | -c "selected srtp profile" \ |
| 11699 | -c "DTLS-SRTP key material is"\ |
| 11700 | -C "error" |
| 11701 | |
| 11702 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11703 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11704 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 11705 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11706 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11707 | 0 \ |
| 11708 | -c "client hello, adding use_srtp extension" \ |
| 11709 | -c "found use_srtp extension" \ |
| 11710 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11711 | -c "selected srtp profile" \ |
| 11712 | -c "DTLS-SRTP key material is"\ |
| 11713 | -C "error" |
| 11714 | |
| 11715 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11716 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11717 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 11718 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11719 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 11720 | 0 \ |
| 11721 | -c "client hello, adding use_srtp extension" \ |
| 11722 | -C "found use_srtp extension" \ |
| 11723 | -C "found srtp profile" \ |
| 11724 | -C "selected srtp profile" \ |
| 11725 | -C "DTLS-SRTP key material is"\ |
| 11726 | -C "error" |
| 11727 | |
| 11728 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11729 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11730 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 11731 | "$O_SRV -dtls" \ |
| 11732 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11733 | 0 \ |
| 11734 | -c "client hello, adding use_srtp extension" \ |
| 11735 | -C "found use_srtp extension" \ |
| 11736 | -C "found srtp profile" \ |
| 11737 | -C "selected srtp profile" \ |
| 11738 | -C "DTLS-SRTP key material is"\ |
| 11739 | -C "error" |
| 11740 | |
| 11741 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11742 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11743 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 11744 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11745 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11746 | 0 \ |
| 11747 | -c "client hello, adding use_srtp extension" \ |
| 11748 | -c "found use_srtp extension" \ |
| 11749 | -c "found srtp profile" \ |
| 11750 | -c "selected srtp profile" \ |
| 11751 | -c "DTLS-SRTP key material is"\ |
| 11752 | -c "DTLS-SRTP no mki value negotiated"\ |
| 11753 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11754 | -C "dumping 'received mki' (8 bytes)" \ |
| 11755 | -C "error" |
| 11756 | |
| 11757 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11758 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11759 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11760 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11761 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11762 | "$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] | 11763 | 0 \ |
| 11764 | -s "found use_srtp extension" \ |
| 11765 | -s "found srtp profile" \ |
| 11766 | -s "selected srtp profile" \ |
| 11767 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11768 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11769 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 11770 | |
| 11771 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11772 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11773 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11774 | 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] | 11775 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11776 | "$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] | 11777 | 0 \ |
| 11778 | -s "found use_srtp extension" \ |
| 11779 | -s "found srtp profile" \ |
| 11780 | -s "selected srtp profile" \ |
| 11781 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11782 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11783 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 11784 | |
| 11785 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11786 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11787 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11788 | 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] | 11789 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11790 | "$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] | 11791 | 0 \ |
| 11792 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11793 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11794 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11795 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11796 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11797 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 11798 | |
| 11799 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11800 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11801 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11802 | 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] | 11803 | "$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] | 11804 | "$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] | 11805 | 0 \ |
| 11806 | -s "found use_srtp extension" \ |
| 11807 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11808 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11809 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11810 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11811 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 11812 | |
| 11813 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11814 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11815 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11816 | 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] | 11817 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11818 | "$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] | 11819 | 0 \ |
| 11820 | -s "found use_srtp extension" \ |
| 11821 | -s "found srtp profile" \ |
| 11822 | -s "selected srtp profile" \ |
| 11823 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11824 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11825 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 11826 | |
| 11827 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11828 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11829 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11830 | 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] | 11831 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 11832 | "$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] | 11833 | 0 \ |
| 11834 | -s "found use_srtp extension" \ |
| 11835 | -s "found srtp profile" \ |
| 11836 | -S "selected srtp profile" \ |
| 11837 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11838 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11839 | -C "SRTP profile:" |
| 11840 | |
| 11841 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11842 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11843 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11844 | 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] | 11845 | "$P_SRV dtls=1 debug_level=3" \ |
| 11846 | "$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] | 11847 | 0 \ |
| 11848 | -s "found use_srtp extension" \ |
| 11849 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11850 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11851 | -C "SRTP profile:" |
| 11852 | |
| 11853 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11854 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11855 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11856 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 11857 | "$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" \ |
| 11858 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11859 | 0 \ |
| 11860 | -c "client hello, adding use_srtp extension" \ |
| 11861 | -c "found use_srtp extension" \ |
| 11862 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11863 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11864 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11865 | -C "error" |
| 11866 | |
| 11867 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11868 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11869 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11870 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 11871 | "$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" \ |
| 11872 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11873 | 0 \ |
| 11874 | -c "client hello, adding use_srtp extension" \ |
| 11875 | -c "found use_srtp extension" \ |
| 11876 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11877 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11878 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11879 | -C "error" |
| 11880 | |
| 11881 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11882 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11883 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11884 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 11885 | "$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" \ |
| 11886 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11887 | 0 \ |
| 11888 | -c "client hello, adding use_srtp extension" \ |
| 11889 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11890 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11891 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11892 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11893 | -C "error" |
| 11894 | |
| 11895 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11896 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11897 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11898 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 11899 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11900 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11901 | 0 \ |
| 11902 | -c "client hello, adding use_srtp extension" \ |
| 11903 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11904 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11905 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11906 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11907 | -C "error" |
| 11908 | |
| 11909 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11910 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11911 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11912 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 11913 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11914 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11915 | 0 \ |
| 11916 | -c "client hello, adding use_srtp extension" \ |
| 11917 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11918 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11919 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11920 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11921 | -C "error" |
| 11922 | |
| 11923 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11924 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11925 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11926 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 11927 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11928 | "$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] | 11929 | 0 \ |
| 11930 | -c "client hello, adding use_srtp extension" \ |
| 11931 | -C "found use_srtp extension" \ |
| 11932 | -C "found srtp profile" \ |
| 11933 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11934 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11935 | -C "error" |
| 11936 | |
| 11937 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11938 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11939 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11940 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 11941 | "$G_SRV -u" \ |
| 11942 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11943 | 0 \ |
| 11944 | -c "client hello, adding use_srtp extension" \ |
| 11945 | -C "found use_srtp extension" \ |
| 11946 | -C "found srtp profile" \ |
| 11947 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11948 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11949 | -C "error" |
| 11950 | |
| 11951 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11952 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11953 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11954 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 11955 | "$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" \ |
| 11956 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11957 | 0 \ |
| 11958 | -c "client hello, adding use_srtp extension" \ |
| 11959 | -c "found use_srtp extension" \ |
| 11960 | -c "found srtp profile" \ |
| 11961 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11962 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 11963 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11964 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11965 | -c "dumping 'received mki' (8 bytes)" \ |
| 11966 | -C "error" |
| 11967 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 11968 | # Tests for specific things with "unreliable" UDP connection |
| 11969 | |
| 11970 | not_with_valgrind # spurious resend due to timeout |
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 | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 11972 | run_test "DTLS proxy: reference" \ |
| 11973 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 11974 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 11975 | "$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] | 11976 | 0 \ |
| 11977 | -C "replayed record" \ |
| 11978 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 11979 | -C "Buffer record from epoch" \ |
| 11980 | -S "Buffer record from epoch" \ |
| 11981 | -C "ssl_buffer_message" \ |
| 11982 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 11983 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11984 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 11985 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11986 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 11987 | -c "HTTP/1.0 200 OK" |
| 11988 | |
| 11989 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11990 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11991 | run_test "DTLS proxy: duplicate every packet" \ |
| 11992 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 11993 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 11994 | "$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] | 11995 | 0 \ |
| 11996 | -c "replayed record" \ |
| 11997 | -s "replayed record" \ |
| 11998 | -c "record from another epoch" \ |
| 11999 | -s "record from another epoch" \ |
| 12000 | -S "resend" \ |
| 12001 | -s "Extra-header:" \ |
| 12002 | -c "HTTP/1.0 200 OK" |
| 12003 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12004 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 12005 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 12006 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12007 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 12008 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 12009 | 0 \ |
| 12010 | -c "replayed record" \ |
| 12011 | -S "replayed record" \ |
| 12012 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12013 | -s "record from another epoch" \ |
| 12014 | -c "resend" \ |
| 12015 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 12016 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12017 | -c "HTTP/1.0 200 OK" |
| 12018 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12019 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 12020 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 12021 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12022 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 12023 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 12024 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12025 | -c "next record in same datagram" \ |
| 12026 | -s "next record in same datagram" |
| 12027 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12028 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12029 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 12030 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12031 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 12032 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 12033 | 0 \ |
| 12034 | -c "next record in same datagram" \ |
| 12035 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12036 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12037 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 12038 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 12039 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12040 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 12041 | "$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] | 12042 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12043 | -c "discarding invalid record (mac)" \ |
| 12044 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12045 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12046 | -c "HTTP/1.0 200 OK" \ |
| 12047 | -S "too many records with bad MAC" \ |
| 12048 | -S "Verification of the message MAC failed" |
| 12049 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12050 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12051 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 12052 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12053 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 12054 | "$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] | 12055 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12056 | -C "discarding invalid record (mac)" \ |
| 12057 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12058 | -S "Extra-header:" \ |
| 12059 | -C "HTTP/1.0 200 OK" \ |
| 12060 | -s "too many records with bad MAC" \ |
| 12061 | -s "Verification of the message MAC failed" |
| 12062 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12063 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12064 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 12065 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12066 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 12067 | "$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] | 12068 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12069 | -c "discarding invalid record (mac)" \ |
| 12070 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12071 | -s "Extra-header:" \ |
| 12072 | -c "HTTP/1.0 200 OK" \ |
| 12073 | -S "too many records with bad MAC" \ |
| 12074 | -S "Verification of the message MAC failed" |
| 12075 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12076 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12077 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 12078 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12079 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 12080 | "$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] | 12081 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12082 | -c "discarding invalid record (mac)" \ |
| 12083 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12084 | -s "Extra-header:" \ |
| 12085 | -c "HTTP/1.0 200 OK" \ |
| 12086 | -s "too many records with bad MAC" \ |
| 12087 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12088 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12089 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12090 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 12091 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 12092 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 12093 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12094 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 12095 | -c "record from another epoch" \ |
| 12096 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12097 | -s "Extra-header:" \ |
| 12098 | -c "HTTP/1.0 200 OK" |
| 12099 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 12100 | # Tests for reordering support with DTLS |
| 12101 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12102 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12103 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12104 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 12105 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12106 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12107 | hs_timeout=2500-60000" \ |
| 12108 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12109 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 12110 | 0 \ |
| 12111 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12112 | -c "Next handshake message has been buffered - load"\ |
| 12113 | -S "Buffering HS message" \ |
| 12114 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12115 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12116 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12117 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12118 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 12119 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12120 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12121 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12122 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 12123 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12124 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12125 | hs_timeout=2500-60000" \ |
| 12126 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12127 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12128 | 0 \ |
| 12129 | -c "Buffering HS message" \ |
| 12130 | -c "found fragmented DTLS handshake message"\ |
| 12131 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 12132 | -c "Next handshake message has been buffered - load"\ |
| 12133 | -S "Buffering HS message" \ |
| 12134 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12135 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12136 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12137 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 12138 | -S "Remember CCS message" |
| 12139 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12140 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 12141 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 12142 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 12143 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12144 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12145 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12147 | 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] | 12148 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12149 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12150 | hs_timeout=2500-60000" \ |
| 12151 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12152 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12153 | 0 \ |
| 12154 | -c "Buffering HS message" \ |
| 12155 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12156 | -C "attempt to make space by freeing buffered messages" \ |
| 12157 | -S "Buffering HS message" \ |
| 12158 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12159 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12160 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12161 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12162 | -S "Remember CCS message" |
| 12163 | |
| 12164 | # The size constraints ensure that the delayed certificate message can't |
| 12165 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 12166 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12167 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12168 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 12169 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12170 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12171 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 12172 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12173 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12174 | hs_timeout=2500-60000" \ |
| 12175 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12176 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12177 | 0 \ |
| 12178 | -c "Buffering HS message" \ |
| 12179 | -c "attempt to make space by freeing buffered future messages" \ |
| 12180 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12181 | -S "Buffering HS message" \ |
| 12182 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12183 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12184 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12185 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12186 | -S "Remember CCS message" |
| 12187 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12188 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12189 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12190 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 12191 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12192 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 12193 | hs_timeout=2500-60000" \ |
| 12194 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12195 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12196 | 0 \ |
| 12197 | -C "Buffering HS message" \ |
| 12198 | -C "Next handshake message has been buffered - load"\ |
| 12199 | -s "Buffering HS message" \ |
| 12200 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12201 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12202 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12203 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12204 | -S "Remember CCS message" |
| 12205 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12206 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12207 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12208 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12209 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 12210 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12211 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12212 | hs_timeout=2500-60000" \ |
| 12213 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12214 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12215 | 0 \ |
| 12216 | -C "Buffering HS message" \ |
| 12217 | -C "Next handshake message has been buffered - load"\ |
| 12218 | -S "Buffering HS message" \ |
| 12219 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12220 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12221 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12222 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12223 | -S "Remember CCS message" |
| 12224 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12225 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12226 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12227 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 12228 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12229 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12230 | hs_timeout=2500-60000" \ |
| 12231 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12232 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12233 | 0 \ |
| 12234 | -C "Buffering HS message" \ |
| 12235 | -C "Next handshake message has been buffered - load"\ |
| 12236 | -S "Buffering HS message" \ |
| 12237 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12238 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12239 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12240 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12241 | -s "Remember CCS message" |
| 12242 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12243 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12244 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12245 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12246 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12247 | hs_timeout=2500-60000" \ |
| 12248 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12249 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 12250 | 0 \ |
| 12251 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12252 | -s "Found buffered record from current epoch - load" \ |
| 12253 | -c "Buffer record from epoch 1" \ |
| 12254 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12255 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12256 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 12257 | # from the server are delayed, so that the encrypted Finished message |
| 12258 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 12259 | # in afterwards, the encrypted Finished message must be freed in order |
| 12260 | # to make space for the NewSessionTicket to be reassembled. |
| 12261 | # This works only in very particular circumstances: |
| 12262 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 12263 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 12264 | # the encrypted Finished message. |
| 12265 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 12266 | # needs to be fragmented. |
| 12267 | # - All messages sent by the server must be small enough to be either sent |
| 12268 | # without fragmentation or be reassembled within the bounds of |
| 12269 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 12270 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 12271 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 12272 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12273 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 12274 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12275 | "$P_SRV mtu=140 response_size=90 dgram_packing=0 psk=73776f726466697368 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 12276 | "$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] | 12277 | 0 \ |
| 12278 | -s "Buffer record from epoch 1" \ |
| 12279 | -s "Found buffered record from current epoch - load" \ |
| 12280 | -c "Buffer record from epoch 1" \ |
| 12281 | -C "Found buffered record from current epoch - load" \ |
| 12282 | -c "Enough space available after freeing future epoch record" |
| 12283 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 12284 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 12285 | |
| 12286 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12287 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 12288 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12289 | "$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] | 12290 | psk=73776f726466697368" \ |
| 12291 | "$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] | 12292 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12293 | 0 \ |
| 12294 | -s "Extra-header:" \ |
| 12295 | -c "HTTP/1.0 200 OK" |
| 12296 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12297 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12298 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 12299 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12300 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 12301 | "$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] | 12302 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 12303 | 0 \ |
| 12304 | -s "Extra-header:" \ |
| 12305 | -c "HTTP/1.0 200 OK" |
| 12306 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12307 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12308 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12309 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 12310 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12311 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 12312 | "$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] | 12313 | 0 \ |
| 12314 | -s "Extra-header:" \ |
| 12315 | -c "HTTP/1.0 200 OK" |
| 12316 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12317 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12318 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12319 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 12320 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12321 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 12322 | "$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] | 12323 | 0 \ |
| 12324 | -s "Extra-header:" \ |
| 12325 | -c "HTTP/1.0 200 OK" |
| 12326 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12327 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12328 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12329 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12330 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 12331 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12332 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 12333 | "$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] | 12334 | 0 \ |
| 12335 | -s "Extra-header:" \ |
| 12336 | -c "HTTP/1.0 200 OK" |
| 12337 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12338 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12339 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12340 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12341 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 12342 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12343 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 12344 | "$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] | 12345 | 0 \ |
| 12346 | -s "Extra-header:" \ |
| 12347 | -c "HTTP/1.0 200 OK" |
| 12348 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12349 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12350 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12351 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12352 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 12353 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12354 | "$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] | 12355 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12356 | "$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] | 12357 | 0 \ |
| 12358 | -s "Extra-header:" \ |
| 12359 | -c "HTTP/1.0 200 OK" |
| 12360 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12361 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 12362 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 12363 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 12364 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12365 | "$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] | 12366 | psk=73776f726466697368 debug_level=3" \ |
| 12367 | "$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] | 12368 | 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] | 12369 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12370 | 0 \ |
| 12371 | -s "a session has been resumed" \ |
| 12372 | -c "a session has been resumed" \ |
| 12373 | -s "Extra-header:" \ |
| 12374 | -c "HTTP/1.0 200 OK" |
| 12375 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12376 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 12377 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 12378 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 12379 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12380 | "$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] | 12381 | psk=73776f726466697368 debug_level=3 nbio=2" \ |
| 12382 | "$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] | 12383 | 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] | 12384 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 12385 | 0 \ |
| 12386 | -s "a session has been resumed" \ |
| 12387 | -c "a session has been resumed" \ |
| 12388 | -s "Extra-header:" \ |
| 12389 | -c "HTTP/1.0 200 OK" |
| 12390 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12391 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12392 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12393 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 12394 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12395 | "$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] | 12396 | psk=73776f726466697368 renegotiation=1 debug_level=2" \ |
| 12397 | "$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] | 12398 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 12399 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12400 | 0 \ |
| 12401 | -c "=> renegotiate" \ |
| 12402 | -s "=> renegotiate" \ |
| 12403 | -s "Extra-header:" \ |
| 12404 | -c "HTTP/1.0 200 OK" |
| 12405 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12406 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12407 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12408 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 12409 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12410 | "$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] | 12411 | psk=73776f726466697368 renegotiation=1 debug_level=2" \ |
| 12412 | "$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] | 12413 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12414 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12415 | 0 \ |
| 12416 | -c "=> renegotiate" \ |
| 12417 | -s "=> renegotiate" \ |
| 12418 | -s "Extra-header:" \ |
| 12419 | -c "HTTP/1.0 200 OK" |
| 12420 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12421 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12422 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12423 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 12424 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12425 | "$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] | 12426 | psk=73776f726466697368 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12427 | debug_level=2" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12428 | "$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] | 12429 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12430 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12431 | 0 \ |
| 12432 | -c "=> renegotiate" \ |
| 12433 | -s "=> renegotiate" \ |
| 12434 | -s "Extra-header:" \ |
| 12435 | -c "HTTP/1.0 200 OK" |
| 12436 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12437 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12438 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12439 | 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] | 12440 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12441 | "$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] | 12442 | psk=73776f726466697368 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12443 | debug_level=2 nbio=2" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12444 | "$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] | 12445 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12446 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12447 | 0 \ |
| 12448 | -c "=> renegotiate" \ |
| 12449 | -s "=> renegotiate" \ |
| 12450 | -s "Extra-header:" \ |
| 12451 | -c "HTTP/1.0 200 OK" |
| 12452 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12453 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 12454 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 12455 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error |
| 12456 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12457 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12458 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12459 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12460 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 12461 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 12462 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ |
| 12463 | "$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] | 12464 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 12465 | -c "HTTP/1.0 200 OK" |
| 12466 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12467 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12468 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12469 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12470 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12471 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 12472 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12473 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12474 | "$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] | 12475 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12476 | -c "HTTP/1.0 200 OK" |
| 12477 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12478 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12479 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12480 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12481 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12482 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 12483 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12484 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12485 | "$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] | 12486 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12487 | -c "HTTP/1.0 200 OK" |
| 12488 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 12489 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12490 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12491 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12492 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12493 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 12494 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 12495 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12496 | "$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] | 12497 | 0 \ |
| 12498 | -s "Extra-header:" \ |
| 12499 | -c "Extra-header:" |
| 12500 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12501 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12502 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12503 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12504 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12505 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 12506 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12507 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12508 | "$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] | 12509 | 0 \ |
| 12510 | -s "Extra-header:" \ |
| 12511 | -c "Extra-header:" |
| 12512 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12513 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12514 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12515 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12516 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12517 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 12518 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12519 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12520 | "$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] | 12521 | 0 \ |
| 12522 | -s "Extra-header:" \ |
| 12523 | -c "Extra-header:" |
| 12524 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12525 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12526 | run_test "export keys functionality" \ |
| 12527 | "$P_SRV eap_tls=1 debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 12528 | "$P_CLI force_version=tls12 eap_tls=1 debug_level=3" \ |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12529 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 12530 | -c "EAP-TLS key material is:"\ |
| 12531 | -s "EAP-TLS key material is:"\ |
| 12532 | -c "EAP-TLS IV is:" \ |
| 12533 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12534 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 12535 | # openssl feature tests: check if tls1.3 exists. |
| 12536 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12537 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 12538 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 12539 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 12540 | 0 \ |
| 12541 | -c "TLS 1.3" \ |
| 12542 | -s "TLS 1.3" |
| 12543 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 12544 | # 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] | 12545 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 12546 | requires_gnutls_next_no_ticket |
| 12547 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12548 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 12549 | "$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] | 12550 | "$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] | 12551 | 0 \ |
| 12552 | -s "Version: TLS1.3" \ |
| 12553 | -c "Version: TLS1.3" |
| 12554 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 12555 | # TLS1.3 test cases |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12556 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12557 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12558 | requires_ciphersuite_enabled TLS1-3-CHACHA20-POLY1305-SHA256 |
Valerio Setti | cf29c5d | 2023-09-01 09:03:41 +0200 | [diff] [blame] | 12559 | requires_any_configs_enabled "PSA_WANT_ECC_MONTGOMERY_255" |
| 12560 | requires_any_configs_enabled "PSA_WANT_ECC_SECP_R1_256" |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12561 | run_test "TLS 1.3: Default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12562 | "$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] | 12563 | "$P_CLI allow_sha1=0" \ |
| 12564 | 0 \ |
| 12565 | -s "Protocol is TLSv1.3" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12566 | -s "Ciphersuite is TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12567 | -s "ECDH/FFDH group: " \ |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12568 | -s "selected signature algorithm ecdsa_secp256r1_sha256" |
| 12569 | |
Ronald Cron | 587cfe6 | 2024-02-08 08:56:09 +0100 | [diff] [blame] | 12570 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12571 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12572 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 12573 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 12574 | run_test "Establish TLS 1.2 then TLS 1.3 session" \ |
| 12575 | "$P_SRV" \ |
| 12576 | "( $P_CLI force_version=tls12; \ |
| 12577 | $P_CLI force_version=tls13 )" \ |
| 12578 | 0 \ |
| 12579 | -s "Protocol is TLSv1.2" \ |
| 12580 | -s "Protocol is TLSv1.3" \ |
| 12581 | |
Ronald Cron | 90abb22 | 2024-02-08 09:02:49 +0100 | [diff] [blame] | 12582 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12583 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12584 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 12585 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 12586 | run_test "Establish TLS 1.3 then TLS 1.2 session" \ |
| 12587 | "$P_SRV" \ |
| 12588 | "( $P_CLI force_version=tls13; \ |
| 12589 | $P_CLI force_version=tls12 )" \ |
| 12590 | 0 \ |
| 12591 | -s "Protocol is TLSv1.3" \ |
| 12592 | -s "Protocol is TLSv1.2" \ |
| 12593 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12594 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12595 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12596 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12597 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12598 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12599 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12600 | "$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] | 12601 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 12602 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12603 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12604 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12605 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12606 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12607 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12608 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12609 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12610 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12611 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12612 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12613 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12614 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12615 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12616 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12617 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 12618 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12619 | -c "=> parse certificate verify" \ |
| 12620 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12621 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12622 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 12623 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12624 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 12625 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 12626 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 12627 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12628 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12629 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12630 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12631 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12632 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12633 | "$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] | 12634 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 12635 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12636 | -s "SERVER HELLO was queued" \ |
| 12637 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12638 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12639 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12640 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12641 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12642 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12643 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12644 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12645 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12646 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12647 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12648 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12649 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12650 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12651 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 12652 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12653 | -c "=> parse certificate verify" \ |
| 12654 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12655 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12656 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 12657 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12658 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12659 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12660 | requires_openssl_tls1_3_with_compatible_ephemeral |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12661 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12662 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12663 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12664 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12665 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12666 | run_test "TLS 1.3: alpn - openssl" \ |
| 12667 | "$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] | 12668 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12669 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12670 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12671 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12672 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12673 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12674 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12675 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12676 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12677 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12678 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12679 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12680 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12681 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12682 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12683 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12684 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12685 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12686 | -c "=> parse certificate verify" \ |
| 12687 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12688 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 12689 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12690 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12691 | -c "HTTP/1.0 200 ok" \ |
| 12692 | -c "Application Layer Protocol is h2" |
| 12693 | |
| 12694 | requires_gnutls_tls1_3 |
| 12695 | requires_gnutls_next_no_ticket |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12696 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12697 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12698 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12699 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12700 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12701 | run_test "TLS 1.3: alpn - gnutls" \ |
| 12702 | "$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] | 12703 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12704 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12705 | -s "SERVER HELLO was queued" \ |
| 12706 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12707 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12708 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12709 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12710 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12711 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12712 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12713 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12714 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12715 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12716 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12717 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12718 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12719 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12720 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12721 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12722 | -c "=> parse certificate verify" \ |
| 12723 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12724 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 12725 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12726 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12727 | -c "HTTP/1.0 200 OK" \ |
| 12728 | -c "Application Layer Protocol is h2" |
| 12729 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12730 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12731 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 12732 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12733 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12734 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12735 | run_test "TLS 1.3: server alpn - openssl" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12736 | "$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] | 12737 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ |
| 12738 | 0 \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12739 | -s "found alpn extension" \ |
| 12740 | -s "server side, adding alpn extension" \ |
| 12741 | -s "Protocol is TLSv1.3" \ |
| 12742 | -s "HTTP/1.0 200 OK" \ |
| 12743 | -s "Application Layer Protocol is h2" |
| 12744 | |
| 12745 | requires_gnutls_tls1_3 |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12746 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 12747 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12748 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12749 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12750 | run_test "TLS 1.3: server alpn - gnutls" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12751 | "$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] | 12752 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ |
| 12753 | 0 \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12754 | -s "found alpn extension" \ |
| 12755 | -s "server side, adding alpn extension" \ |
| 12756 | -s "Protocol is TLSv1.3" \ |
| 12757 | -s "HTTP/1.0 200 OK" \ |
| 12758 | -s "Application Layer Protocol is h2" |
| 12759 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12760 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12761 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12762 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12763 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12764 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12765 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12766 | "$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] | 12767 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12768 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12769 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12770 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12771 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12772 | -c "HTTP/1.0 200 ok" \ |
| 12773 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12774 | |
| 12775 | requires_gnutls_tls1_3 |
| 12776 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12777 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12778 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12779 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12780 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12781 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12782 | "$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] | 12783 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12784 | 0 \ |
| 12785 | -c "got a certificate request" \ |
| 12786 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 12787 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12788 | -c "HTTP/1.0 200 OK" \ |
| 12789 | -c "Protocol is TLSv1.3" |
| 12790 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12791 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12792 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12793 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12794 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12795 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12796 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12797 | "$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] | 12798 | "$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] | 12799 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12800 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12801 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12802 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12803 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12804 | |
| 12805 | requires_gnutls_tls1_3 |
| 12806 | requires_gnutls_next_no_ticket |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12807 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12808 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12809 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12810 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12811 | "$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] | 12812 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/cli2.crt \ |
| 12813 | key_file=$DATA_FILES_PATH/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 12814 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12815 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12816 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12817 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12818 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12819 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12820 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12821 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12822 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12823 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12824 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12825 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12826 | "$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] | 12827 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12828 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12829 | 0 \ |
| 12830 | -c "got a certificate request" \ |
| 12831 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12832 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12833 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12834 | |
| 12835 | requires_gnutls_tls1_3 |
| 12836 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12837 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12838 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12839 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12840 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12841 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12842 | "$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] | 12843 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12844 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12845 | 0 \ |
| 12846 | -c "got a certificate request" \ |
| 12847 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12848 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12849 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12850 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12851 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12852 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12853 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12854 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12855 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12856 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12857 | "$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] | 12858 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12859 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12860 | 0 \ |
| 12861 | -c "got a certificate request" \ |
| 12862 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12863 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12864 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12865 | |
| 12866 | requires_gnutls_tls1_3 |
| 12867 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12868 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12869 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12870 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12871 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12872 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12873 | "$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] | 12874 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12875 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12876 | 0 \ |
| 12877 | -c "got a certificate request" \ |
| 12878 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12879 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12880 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12881 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12882 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12883 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12884 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12885 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12886 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12887 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12888 | "$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] | 12889 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12890 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12891 | 0 \ |
| 12892 | -c "got a certificate request" \ |
| 12893 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12894 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12895 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12896 | |
| 12897 | requires_gnutls_tls1_3 |
| 12898 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12899 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12900 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12901 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12902 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12903 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12904 | "$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] | 12905 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12906 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12907 | 0 \ |
| 12908 | -c "got a certificate request" \ |
| 12909 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12910 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12911 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12912 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12913 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12914 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12915 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12916 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12917 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12918 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12919 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12920 | "$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] | 12921 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12922 | 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] | 12923 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12924 | -c "got a certificate request" \ |
| 12925 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12926 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12927 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12928 | |
| 12929 | requires_gnutls_tls1_3 |
| 12930 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12931 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12932 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12933 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12934 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12935 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12936 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12937 | "$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] | 12938 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12939 | 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] | 12940 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12941 | -c "got a certificate request" \ |
| 12942 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12943 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12944 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12945 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12946 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12947 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12948 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12949 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12950 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12951 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12952 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 12953 | "$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] | 12954 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12955 | 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] | 12956 | 0 \ |
| 12957 | -c "got a certificate request" \ |
| 12958 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12959 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12960 | -c "Protocol is TLSv1.3" |
| 12961 | |
| 12962 | requires_gnutls_tls1_3 |
| 12963 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12964 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12965 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12966 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12967 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12968 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12969 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 12970 | "$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] | 12971 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12972 | 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] | 12973 | 0 \ |
| 12974 | -c "got a certificate request" \ |
| 12975 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12976 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12977 | -c "Protocol is TLSv1.3" |
| 12978 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12979 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12980 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12981 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12982 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12983 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12984 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12985 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 12986 | "$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] | 12987 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12988 | 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] | 12989 | 0 \ |
| 12990 | -c "got a certificate request" \ |
| 12991 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12992 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12993 | -c "Protocol is TLSv1.3" |
| 12994 | |
| 12995 | requires_gnutls_tls1_3 |
| 12996 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12997 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12998 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12999 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13000 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13001 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 13002 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 13003 | "$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] | 13004 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13005 | 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] | 13006 | 0 \ |
| 13007 | -c "got a certificate request" \ |
| 13008 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13009 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13010 | -c "Protocol is TLSv1.3" |
| 13011 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13012 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 13013 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13014 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13015 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13016 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13017 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 13018 | 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] | 13019 | "$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] | 13020 | -sigalgs ecdsa_secp256r1_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13021 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13022 | 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] | 13023 | 1 \ |
| 13024 | -c "got a certificate request" \ |
| 13025 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13026 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13027 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 13028 | |
| 13029 | requires_gnutls_tls1_3 |
| 13030 | requires_gnutls_next_no_ticket |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 13031 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13032 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13033 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13034 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13035 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 13036 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 13037 | "$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] | 13038 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13039 | 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] | 13040 | 1 \ |
| 13041 | -c "got a certificate request" \ |
| 13042 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13043 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13044 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 13045 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13046 | # Test using an opaque private key for client authentication |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13047 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13048 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13049 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13050 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13051 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13052 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 13053 | "$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] | 13054 | "$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] | 13055 | 0 \ |
| 13056 | -c "got a certificate request" \ |
| 13057 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13058 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13059 | -c "Protocol is TLSv1.3" |
| 13060 | |
| 13061 | requires_gnutls_tls1_3 |
| 13062 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13063 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13064 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13065 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13066 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13067 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 13068 | "$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] | 13069 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/cli2.crt \ |
| 13070 | key_file=$DATA_FILES_PATH/cli2.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13071 | 0 \ |
| 13072 | -c "got a certificate request" \ |
| 13073 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13074 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13075 | -c "Protocol is TLSv1.3" |
| 13076 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13077 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13078 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13079 | requires_config_enabled MBEDTLS_SSL_CLI_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, ecdsa_secp256r1_sha256 - openssl" \ |
| 13084 | "$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] | 13085 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 13086 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key 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 | |
| 13093 | requires_gnutls_tls1_3 |
| 13094 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13095 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13096 | requires_config_enabled MBEDTLS_SSL_CLI_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, ecdsa_secp256r1_sha256 - gnutls" \ |
| 13101 | "$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] | 13102 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 13103 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key 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 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13110 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13111 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13112 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13113 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13114 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13115 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13116 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 13117 | "$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] | 13118 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 13119 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13120 | 0 \ |
| 13121 | -c "got a certificate request" \ |
| 13122 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13123 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13124 | -c "Protocol is TLSv1.3" |
| 13125 | |
| 13126 | requires_gnutls_tls1_3 |
| 13127 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13128 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13129 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13130 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13131 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13132 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13133 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 13134 | "$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] | 13135 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 13136 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13137 | 0 \ |
| 13138 | -c "got a certificate request" \ |
| 13139 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13140 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13141 | -c "Protocol is TLSv1.3" |
| 13142 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13143 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13144 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13145 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13146 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13147 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13148 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13149 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 13150 | "$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] | 13151 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13152 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13153 | 0 \ |
| 13154 | -c "got a certificate request" \ |
| 13155 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13156 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13157 | -c "Protocol is TLSv1.3" |
| 13158 | |
| 13159 | requires_gnutls_tls1_3 |
| 13160 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13161 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13162 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13163 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13164 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13165 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13166 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 13167 | "$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] | 13168 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13169 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13170 | 0 \ |
| 13171 | -c "got a certificate request" \ |
| 13172 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13173 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13174 | -c "Protocol is TLSv1.3" |
| 13175 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13176 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13177 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13178 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13179 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13180 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13181 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13182 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13183 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 13184 | "$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] | 13185 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13186 | 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] | 13187 | 0 \ |
| 13188 | -c "got a certificate request" \ |
| 13189 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13190 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13191 | -c "Protocol is TLSv1.3" |
| 13192 | |
| 13193 | requires_gnutls_tls1_3 |
| 13194 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13195 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13196 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13197 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13198 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13199 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13200 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13201 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 13202 | "$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] | 13203 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13204 | 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] | 13205 | 0 \ |
| 13206 | -c "got a certificate request" \ |
| 13207 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13208 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13209 | -c "Protocol is TLSv1.3" |
| 13210 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13211 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13212 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13213 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13214 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13215 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13216 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13217 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13218 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 13219 | "$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] | 13220 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13221 | 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] | 13222 | 0 \ |
| 13223 | -c "got a certificate request" \ |
| 13224 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13225 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13226 | -c "Protocol is TLSv1.3" |
| 13227 | |
| 13228 | requires_gnutls_tls1_3 |
| 13229 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13230 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13231 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13232 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13233 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
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 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13236 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 13237 | "$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] | 13238 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13239 | 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] | 13240 | 0 \ |
| 13241 | -c "got a certificate request" \ |
| 13242 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13243 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13244 | -c "Protocol is TLSv1.3" |
| 13245 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13246 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13247 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13248 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13249 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13250 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
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 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13253 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 13254 | "$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] | 13255 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13256 | 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] | 13257 | 0 \ |
| 13258 | -c "got a certificate request" \ |
| 13259 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13260 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13261 | -c "Protocol is TLSv1.3" |
| 13262 | |
| 13263 | requires_gnutls_tls1_3 |
| 13264 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13265 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13266 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13267 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13268 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13269 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13270 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13271 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \ |
| 13272 | "$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] | 13273 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13274 | 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] | 13275 | 0 \ |
| 13276 | -c "got a certificate request" \ |
| 13277 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13278 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13279 | -c "Protocol is TLSv1.3" |
| 13280 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13281 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13282 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13283 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13284 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13285 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13286 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13287 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13288 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 13289 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 13290 | -sigalgs ecdsa_secp256r1_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13291 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13292 | 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] | 13293 | 1 \ |
| 13294 | -c "got a certificate request" \ |
| 13295 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13296 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13297 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13298 | |
| 13299 | requires_gnutls_tls1_3 |
| 13300 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13301 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13302 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13303 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13304 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13305 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13306 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13307 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 13308 | "$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] | 13309 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13310 | 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] | 13311 | 1 \ |
| 13312 | -c "got a certificate request" \ |
| 13313 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13314 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13315 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13316 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13317 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13318 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13319 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13320 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13321 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13322 | 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] | 13323 | "$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] | 13324 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13325 | 0 \ |
| 13326 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13327 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13328 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13329 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13330 | -c "HTTP/1.0 200 ok" |
| 13331 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13332 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13333 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13334 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13335 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13336 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13337 | 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] | 13338 | "$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] | 13339 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 13340 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13341 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13342 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13343 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13344 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 13345 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13346 | |
| 13347 | requires_gnutls_tls1_3 |
| 13348 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13349 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13350 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13351 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13352 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13353 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13354 | 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] | 13355 | "$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] | 13356 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13357 | 0 \ |
| 13358 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13359 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13360 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13361 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13362 | -c "HTTP/1.0 200 OK" |
| 13363 | |
| 13364 | requires_gnutls_tls1_3 |
| 13365 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13366 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13367 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13368 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13369 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13370 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13371 | 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] | 13372 | "$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] | 13373 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 13374 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13375 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13376 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13377 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13378 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 13379 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13380 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13381 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13382 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 13383 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13384 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 13385 | run_test "TLS 1.3: Server side check - openssl" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13386 | "$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] | 13387 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 13388 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 13389 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13390 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13391 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13392 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 13393 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13394 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13395 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 13396 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13397 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13398 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13399 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13400 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13401 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13402 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13403 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13404 | "$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] | 13405 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13406 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13407 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13408 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13409 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13410 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 13411 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13412 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13413 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13414 | -s "=> parse client hello" \ |
| 13415 | -s "<= parse client hello" |
| 13416 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13417 | requires_gnutls_tls1_3 |
| 13418 | requires_gnutls_next_no_ticket |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13419 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 13420 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13421 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 13422 | run_test "TLS 1.3: Server side check - gnutls" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13423 | "$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] | 13424 | "$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] | 13425 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 13426 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13427 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13428 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13429 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 13430 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13431 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13432 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 13433 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 13434 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13435 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13436 | requires_gnutls_tls1_3 |
| 13437 | requires_gnutls_next_no_ticket |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13438 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13439 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13440 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13441 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13442 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13443 | "$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] | 13444 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13445 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13446 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13447 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13448 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13449 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 13450 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13451 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13452 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13453 | -s "=> parse client hello" \ |
| 13454 | -s "<= parse client hello" |
| 13455 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13456 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13457 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 13458 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13459 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13460 | run_test "TLS 1.3: Server side check - mbedtls" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13461 | "$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] | 13462 | "$P_CLI debug_level=4" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 13463 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13464 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13465 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13466 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13467 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13468 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13469 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13470 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 13471 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 13472 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 13473 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13474 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13475 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13476 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13477 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13478 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13479 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13480 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13481 | "$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] | 13482 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13483 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13484 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13485 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13486 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13487 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13488 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13489 | -s "=> parse client hello" \ |
| 13490 | -s "<= parse client hello" |
| 13491 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13492 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13493 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13494 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13495 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13496 | 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] | 13497 | "$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] | 13498 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13499 | 1 \ |
| 13500 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13501 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13502 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13503 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13504 | -s "=> write certificate request" \ |
| 13505 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 13506 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13507 | -s "=> parse client hello" \ |
| 13508 | -s "<= parse client hello" |
| 13509 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13510 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13511 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13512 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13513 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13514 | 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] | 13515 | "$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] | 13516 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13517 | 0 \ |
| 13518 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13519 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13520 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13521 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13522 | -s "=> write certificate request" \ |
| 13523 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13524 | -s "=> parse client hello" \ |
| 13525 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13526 | |
| 13527 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13528 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13529 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13530 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13531 | requires_config_enabled PSA_WANT_ALG_ECDH |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13532 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13533 | "$P_SRV debug_level=4 groups=secp384r1" \ |
| 13534 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 13535 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13536 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13537 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13538 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13539 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 13540 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13541 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13542 | -s "=> write hello retry request" \ |
| 13543 | -s "<= write hello retry request" |
| 13544 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13545 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13546 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13547 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13548 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13549 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13550 | "$P_SRV debug_level=4 crt_file=none key_file=none" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 13551 | "$P_CLI debug_level=4" \ |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13552 | 1 \ |
| 13553 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13554 | -s "No certificate available." |
| 13555 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13556 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13557 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13558 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13559 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13560 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13561 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13562 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13563 | 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,-,-,-" \ |
| 13564 | "$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] | 13565 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13566 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13567 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13568 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 13569 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13570 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13571 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13572 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13573 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13574 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13575 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13576 | 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,-,-,-" \ |
| 13577 | "$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] | 13578 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13579 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13580 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13581 | |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 13582 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13583 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13584 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13585 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13586 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13587 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13588 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13589 | 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,-,-,-" \ |
| 13590 | "$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] | 13591 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13592 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13593 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 13594 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 13595 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 13596 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 13597 | TEST_SUITE_NAME=${i##*/} |
| 13598 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 13599 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 13600 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 13601 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 13602 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13603 | # Test 1.3 compatibility mode |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13604 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13605 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13606 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13607 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13608 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13609 | 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] | 13610 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13611 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13612 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13613 | -s "Protocol is TLSv1.3" \ |
| 13614 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13615 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13616 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13617 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13618 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13619 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13620 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13621 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13622 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13623 | run_test "TLS 1.3 m->m both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13624 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13625 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13626 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13627 | -s "Protocol is TLSv1.3" \ |
| 13628 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13629 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13630 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13631 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13632 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13633 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13634 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13635 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13636 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13637 | 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] | 13638 | "$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] | 13639 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13640 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13641 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13642 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13643 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13644 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13645 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13646 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13647 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13648 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13649 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13650 | 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] | 13651 | "$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] | 13652 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13653 | 1 \ |
| 13654 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 13655 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13656 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13657 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13658 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13659 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13660 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13661 | run_test "TLS 1.3 m->O both with middlebox compat support" \ |
| 13662 | "$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] | 13663 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13664 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13665 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13666 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13667 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13668 | requires_gnutls_tls1_3 |
| 13669 | requires_gnutls_next_no_ticket |
| 13670 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13671 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13672 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13673 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13674 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13675 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 13676 | "$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] | 13677 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13678 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13679 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13680 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13681 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13682 | |
| 13683 | requires_gnutls_tls1_3 |
| 13684 | requires_gnutls_next_no_ticket |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13685 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13686 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13687 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13688 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13689 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 13690 | "$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] | 13691 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13692 | 1 \ |
| 13693 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 13694 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13695 | requires_gnutls_tls1_3 |
| 13696 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13697 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13698 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13699 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13700 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13701 | run_test "TLS 1.3 m->G both with middlebox compat support" \ |
| 13702 | "$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] | 13703 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13704 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13705 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13706 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13707 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13708 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13709 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13710 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13711 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13712 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13713 | 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] | 13714 | "$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] | 13715 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13716 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13717 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13718 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13719 | -C "14 03 03 00 01" |
| 13720 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13721 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13722 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13723 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13724 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13725 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13726 | 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] | 13727 | "$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] | 13728 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13729 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13730 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13731 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" |
| 13732 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13733 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13734 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13735 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13736 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13737 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13738 | run_test "TLS 1.3 O->m both with middlebox compat support" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13739 | "$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] | 13740 | "$O_NEXT_CLI -msg -debug" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13741 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13742 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13743 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13744 | -c "14 03 03 00 01" |
| 13745 | |
| 13746 | requires_gnutls_tls1_3 |
| 13747 | requires_gnutls_next_no_ticket |
| 13748 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13749 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13750 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13751 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13752 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13753 | 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] | 13754 | "$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] | 13755 | "$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] | 13756 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13757 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13758 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13759 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 13760 | |
| 13761 | requires_gnutls_tls1_3 |
| 13762 | requires_gnutls_next_no_ticket |
| 13763 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13764 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13765 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13766 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13767 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13768 | 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] | 13769 | "$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] | 13770 | "$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] | 13771 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13772 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13773 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13774 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 13775 | -c "discarding change cipher spec in TLS1.3" |
| 13776 | |
| 13777 | requires_gnutls_tls1_3 |
| 13778 | requires_gnutls_next_no_ticket |
| 13779 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13780 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13781 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13782 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13783 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13784 | run_test "TLS 1.3 G->m both with middlebox compat support" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13785 | "$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] | 13786 | "$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] | 13787 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13788 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13789 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13790 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 13791 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13792 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13793 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13794 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13795 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13796 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13797 | 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] | 13798 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 13799 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13800 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13801 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13802 | -c "Protocol is TLSv1.3" \ |
| 13803 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13804 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13805 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13806 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13807 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13808 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13809 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13810 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13811 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13812 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13813 | 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] | 13814 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 13815 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13816 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13817 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13818 | -c "Protocol is TLSv1.3" \ |
| 13819 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13820 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13821 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13822 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13823 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13824 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13825 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13826 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13827 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13828 | run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ |
| 13829 | "$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] | 13830 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13831 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13832 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13833 | -c "received HelloRetryRequest message" \ |
| 13834 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13835 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13836 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13837 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13838 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13839 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13840 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13841 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13842 | run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ |
| 13843 | "$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] | 13844 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13845 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13846 | -c "received HelloRetryRequest message" \ |
| 13847 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 13848 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13849 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13850 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13851 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13852 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13853 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13854 | run_test "TLS 1.3 m->O HRR both with middlebox compat support" \ |
| 13855 | "$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] | 13856 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13857 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13858 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13859 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13860 | |
| 13861 | requires_gnutls_tls1_3 |
| 13862 | requires_gnutls_next_no_ticket |
| 13863 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13864 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13865 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13866 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13867 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13868 | run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ |
| 13869 | "$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] | 13870 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13871 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13872 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13873 | -c "received HelloRetryRequest message" \ |
| 13874 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13875 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13876 | |
| 13877 | requires_gnutls_tls1_3 |
| 13878 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13879 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13880 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13881 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13882 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13883 | run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \ |
| 13884 | "$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] | 13885 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13886 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13887 | -c "received HelloRetryRequest message" \ |
| 13888 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 13889 | |
| 13890 | requires_gnutls_tls1_3 |
| 13891 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13892 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13893 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13894 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13895 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13896 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13897 | run_test "TLS 1.3 m->G HRR both with middlebox compat support" \ |
| 13898 | "$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] | 13899 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13900 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13901 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13902 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13903 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13904 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13905 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13906 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13907 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13908 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13909 | 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] | 13910 | "$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] | 13911 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13912 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13913 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13914 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13915 | -C "14 03 03 00 01" |
| 13916 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13917 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13918 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13919 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13920 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13921 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13922 | 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] | 13923 | "$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] | 13924 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13925 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13926 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13927 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13928 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13929 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13930 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13931 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13932 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13933 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13934 | 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] | 13935 | "$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] | 13936 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13937 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13938 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13939 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13940 | -c "14 03 03 00 01" |
| 13941 | |
| 13942 | requires_gnutls_tls1_3 |
| 13943 | requires_gnutls_next_no_ticket |
| 13944 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13945 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13946 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13947 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13948 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13949 | 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] | 13950 | "$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] | 13951 | "$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] | 13952 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13953 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13954 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13955 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 13956 | |
| 13957 | requires_gnutls_tls1_3 |
| 13958 | requires_gnutls_next_no_ticket |
| 13959 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13960 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13961 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13962 | requires_config_enabled PSA_WANT_ALG_ECDH |
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 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13965 | 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] | 13966 | "$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] | 13967 | "$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] | 13968 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13969 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13970 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13971 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 13972 | -c "discarding change cipher spec in TLS1.3" |
| 13973 | |
| 13974 | requires_gnutls_tls1_3 |
| 13975 | requires_gnutls_next_no_ticket |
| 13976 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13977 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13978 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13979 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13980 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13981 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13982 | 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] | 13983 | "$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] | 13984 | "$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] | 13985 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13986 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13987 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13988 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 13989 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13990 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13991 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13992 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13993 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13994 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13995 | run_test "TLS 1.3: Check signature algorithm order, m->O" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13996 | "$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] | 13997 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 13998 | -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] | 13999 | "$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] | 14000 | 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] | 14001 | 0 \ |
| 14002 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14003 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14004 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14005 | |
| 14006 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14007 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14008 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14009 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14010 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14011 | run_test "TLS 1.3: Check signature algorithm order, m->G" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14012 | "$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] | 14013 | -d 4 |
| 14014 | --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] | 14015 | "$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] | 14016 | 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] | 14017 | 0 \ |
| 14018 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14019 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14020 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14021 | |
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 |
| 14024 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14025 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14026 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14027 | run_test "TLS 1.3: Check signature algorithm order, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14028 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14029 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14030 | 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] | 14031 | 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] | 14032 | "$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] | 14033 | 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] | 14034 | 0 \ |
| 14035 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14036 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 14037 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14038 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 14039 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14040 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14041 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14042 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14043 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14044 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14045 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14046 | run_test "TLS 1.3: Check signature algorithm order, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14047 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14048 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14049 | 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] | 14050 | 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] | 14051 | "$O_NEXT_CLI_NO_CERT -msg -CAfile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14052 | -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] | 14053 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 14054 | 0 \ |
| 14055 | -c "TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14056 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14057 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 14058 | |
| 14059 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14060 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14061 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14062 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14063 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14064 | run_test "TLS 1.3: Check signature algorithm order, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14065 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14066 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14067 | 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] | 14068 | 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] | 14069 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14070 | --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] | 14071 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" \ |
| 14072 | 0 \ |
| 14073 | -c "Negotiated version: 3.4" \ |
| 14074 | -c "HTTP/1.0 200 [Oo][Kk]" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14075 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14076 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 14077 | |
| 14078 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14079 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14080 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14081 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14082 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14083 | 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] | 14084 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14085 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14086 | 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] | 14087 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14088 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14089 | --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] | 14090 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512" \ |
| 14091 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 14092 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14093 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14094 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14095 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14096 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14097 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14098 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14099 | 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] | 14100 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14101 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14102 | 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] | 14103 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14104 | "$O_NEXT_CLI_NO_CERT -msg -CAfile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14105 | -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] | 14106 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \ |
| 14107 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 14108 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14109 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14110 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14111 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14112 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14113 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14114 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14115 | 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] | 14116 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14117 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14118 | 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] | 14119 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14120 | "$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] | 14121 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14122 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 14123 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14124 | |
| 14125 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14126 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14127 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14128 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14129 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14130 | run_test "TLS 1.3: Check server no suitable certificate, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14131 | "$P_SRV debug_level=4 |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14132 | 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] | 14133 | 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] | 14134 | "$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] | 14135 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \ |
| 14136 | 1 \ |
| 14137 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14138 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14139 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14140 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14141 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14142 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14143 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14144 | run_test "TLS 1.3: Check server no suitable certificate, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14145 | "$P_SRV debug_level=4 |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14146 | 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] | 14147 | 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] | 14148 | "$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] | 14149 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \ |
| 14150 | 1 \ |
| 14151 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14152 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14153 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14154 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14155 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14156 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14157 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14158 | run_test "TLS 1.3: Check server no suitable certificate, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14159 | "$P_SRV debug_level=4 |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14160 | 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] | 14161 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 14162 | "$P_CLI allow_sha1=0 debug_level=4 \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 14163 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14164 | 1 \ |
| 14165 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14166 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14167 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14168 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14169 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14170 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14171 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14172 | run_test "TLS 1.3: Check client no signature algorithm, m->O" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14173 | "$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] | 14174 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 14175 | -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] | 14176 | "$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] | 14177 | 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] | 14178 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14179 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14180 | |
| 14181 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14182 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14183 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14184 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14185 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14186 | run_test "TLS 1.3: Check client no signature algorithm, m->G" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14187 | "$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] | 14188 | -d 4 |
| 14189 | --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] | 14190 | "$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] | 14191 | 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] | 14192 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14193 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14194 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14195 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14196 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14197 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14198 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14199 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14200 | run_test "TLS 1.3: Check client no signature algorithm, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14201 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14202 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14203 | 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] | 14204 | 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] | 14205 | "$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] | 14206 | 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] | 14207 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14208 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14209 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14210 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 14211 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 14212 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14213 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 14214 | 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] | 14215 | "$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] | 14216 | -msg -tls1_2 |
| 14217 | -Verify 10 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14218 | "$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] | 14219 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 14220 | min_version=tls12 max_version=tls13 " \ |
| 14221 | 0 \ |
| 14222 | -c "Protocol is TLSv1.2" \ |
| 14223 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14224 | |
| 14225 | |
| 14226 | requires_gnutls_tls1_3 |
| 14227 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 14228 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14229 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 14230 | 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] | 14231 | "$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] | 14232 | -d 4 |
| 14233 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14234 | "$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] | 14235 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 14236 | min_version=tls12 max_version=tls13 " \ |
| 14237 | 0 \ |
| 14238 | -c "Protocol is TLSv1.2" \ |
| 14239 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14240 | |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14241 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14242 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14243 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14244 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14245 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14246 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14247 | requires_config_enabled PSA_WANT_DH_RFC7919_3072 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14248 | requires_gnutls_tls1_3 |
| 14249 | requires_gnutls_next_no_ticket |
| 14250 | requires_gnutls_next_disable_tls13_compat |
| 14251 | 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] | 14252 | "$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" \ |
| 14253 | "$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] | 14254 | 0 \ |
| 14255 | -s "Protocol is TLSv1.3" \ |
| 14256 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14257 | -s "received signature algorithm: 0x804" \ |
| 14258 | -s "got named group: ffdhe3072(0101)" \ |
| 14259 | -s "Certificate verification was skipped" \ |
| 14260 | -C "received HelloRetryRequest message" |
| 14261 | |
| 14262 | |
| 14263 | requires_gnutls_tls1_3 |
| 14264 | requires_gnutls_next_no_ticket |
| 14265 | requires_gnutls_next_disable_tls13_compat |
| 14266 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14267 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14268 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14269 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14270 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14271 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14272 | requires_config_enabled PSA_WANT_DH_RFC7919_3072 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14273 | 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] | 14274 | "$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" \ |
| 14275 | "$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] | 14276 | 0 \ |
| 14277 | -c "HTTP/1.0 200 OK" \ |
| 14278 | -c "Protocol is TLSv1.3" \ |
| 14279 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14280 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14281 | -c "NamedGroup: ffdhe3072 ( 101 )" \ |
| 14282 | -c "Verifying peer X.509 certificate... ok" \ |
| 14283 | -C "received HelloRetryRequest message" |
| 14284 | |
| 14285 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14286 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14287 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14288 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14289 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14290 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14291 | requires_config_enabled PSA_WANT_DH_RFC7919_4096 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14292 | requires_gnutls_tls1_3 |
| 14293 | requires_gnutls_next_no_ticket |
| 14294 | requires_gnutls_next_disable_tls13_compat |
| 14295 | 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] | 14296 | "$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" \ |
| 14297 | "$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] | 14298 | 0 \ |
| 14299 | -s "Protocol is TLSv1.3" \ |
| 14300 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14301 | -s "received signature algorithm: 0x804" \ |
| 14302 | -s "got named group: ffdhe4096(0102)" \ |
| 14303 | -s "Certificate verification was skipped" \ |
| 14304 | -C "received HelloRetryRequest message" |
| 14305 | |
| 14306 | |
| 14307 | requires_gnutls_tls1_3 |
| 14308 | requires_gnutls_next_no_ticket |
| 14309 | requires_gnutls_next_disable_tls13_compat |
| 14310 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14311 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14312 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14313 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14314 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14315 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14316 | requires_config_enabled PSA_WANT_DH_RFC7919_4096 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14317 | 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] | 14318 | "$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" \ |
| 14319 | "$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] | 14320 | 0 \ |
| 14321 | -c "HTTP/1.0 200 OK" \ |
| 14322 | -c "Protocol is TLSv1.3" \ |
| 14323 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14324 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14325 | -c "NamedGroup: ffdhe4096 ( 102 )" \ |
| 14326 | -c "Verifying peer X.509 certificate... ok" \ |
| 14327 | -C "received HelloRetryRequest message" |
| 14328 | |
| 14329 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14330 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14331 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14332 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14333 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14334 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14335 | requires_config_enabled PSA_WANT_DH_RFC7919_6144 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14336 | requires_gnutls_tls1_3 |
| 14337 | requires_gnutls_next_no_ticket |
| 14338 | requires_gnutls_next_disable_tls13_compat |
| 14339 | 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] | 14340 | "$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" \ |
| 14341 | "$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] | 14342 | 0 \ |
| 14343 | -s "Protocol is TLSv1.3" \ |
| 14344 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14345 | -s "received signature algorithm: 0x804" \ |
| 14346 | -s "got named group: ffdhe6144(0103)" \ |
| 14347 | -s "Certificate verification was skipped" \ |
| 14348 | -C "received HelloRetryRequest message" |
| 14349 | |
| 14350 | requires_gnutls_tls1_3 |
| 14351 | requires_gnutls_next_no_ticket |
| 14352 | requires_gnutls_next_disable_tls13_compat |
| 14353 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14354 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14355 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14356 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14357 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14358 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14359 | requires_config_enabled PSA_WANT_DH_RFC7919_6144 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14360 | 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] | 14361 | "$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" \ |
| 14362 | "$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] | 14363 | 0 \ |
| 14364 | -c "HTTP/1.0 200 OK" \ |
| 14365 | -c "Protocol is TLSv1.3" \ |
| 14366 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14367 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14368 | -c "NamedGroup: ffdhe6144 ( 103 )" \ |
| 14369 | -c "Verifying peer X.509 certificate... ok" \ |
| 14370 | -C "received HelloRetryRequest message" |
| 14371 | |
| 14372 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14373 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14374 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14375 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14376 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14377 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14378 | requires_config_enabled PSA_WANT_DH_RFC7919_8192 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14379 | requires_gnutls_tls1_3 |
| 14380 | requires_gnutls_next_no_ticket |
| 14381 | requires_gnutls_next_disable_tls13_compat |
| 14382 | client_needs_more_time 4 |
| 14383 | 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] | 14384 | "$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" \ |
| 14385 | "$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] | 14386 | 0 \ |
| 14387 | -s "Protocol is TLSv1.3" \ |
| 14388 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14389 | -s "received signature algorithm: 0x804" \ |
| 14390 | -s "got named group: ffdhe8192(0104)" \ |
| 14391 | -s "Certificate verification was skipped" \ |
| 14392 | -C "received HelloRetryRequest message" |
| 14393 | |
| 14394 | requires_gnutls_tls1_3 |
| 14395 | requires_gnutls_next_no_ticket |
| 14396 | requires_gnutls_next_disable_tls13_compat |
| 14397 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14398 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14399 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14400 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14401 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14402 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14403 | requires_config_enabled PSA_WANT_DH_RFC7919_8192 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14404 | client_needs_more_time 4 |
| 14405 | 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] | 14406 | "$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" \ |
| 14407 | "$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] | 14408 | 0 \ |
| 14409 | -c "HTTP/1.0 200 OK" \ |
| 14410 | -c "Protocol is TLSv1.3" \ |
| 14411 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14412 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14413 | -c "NamedGroup: ffdhe8192 ( 104 )" \ |
| 14414 | -c "Verifying peer X.509 certificate... ok" \ |
| 14415 | -C "received HelloRetryRequest message" |
| 14416 | |
Ronald Cron | 8a74f07 | 2023-06-14 17:59:29 +0200 | [diff] [blame] | 14417 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 14418 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14419 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14420 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 14421 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14422 | 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] | 14423 | "$P_SRV nbio=2 psk=73776f726466697368 psk_identity=0a0b0c tls13_kex_modes=psk groups=none" \ |
| 14424 | "$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] | 14425 | 0 \ |
| 14426 | -C "received HelloRetryRequest message" \ |
| 14427 | -c "Selected key exchange mode: psk$" \ |
| 14428 | -c "HTTP/1.0 200 OK" |
| 14429 | |
Waleed Elmelegy | 790f3b1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14430 | # Legacy_compression_methods testing |
| 14431 | |
| 14432 | requires_gnutls |
Waleed Elmelegy | 38c8757 | 2024-07-15 17:25:04 +0000 | [diff] [blame] | 14433 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Waleed Elmelegy | 790f3b1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14434 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Waleed Elmelegy | 38c8757 | 2024-07-15 17:25:04 +0000 | [diff] [blame] | 14435 | run_test "TLS 1.2 ClientHello indicating support for deflate compression method" \ |
| 14436 | "$P_SRV debug_level=3" \ |
| 14437 | "$G_CLI --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+COMP-DEFLATE localhost" \ |
| 14438 | 0 \ |
| 14439 | -c "Handshake was completed" \ |
| 14440 | -s "dumping .client hello, compression. (2 bytes)" |
Waleed Elmelegy | 790f3b1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14441 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14442 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 14443 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14444 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 14445 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 14446 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 14447 | requires_max_content_len 16384 |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 14448 | run_tests_memory_after_handshake |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14449 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14450 | if [ "$LIST_TESTS" -eq 0 ]; then |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 14451 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14452 | # Final report |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 14453 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14454 | echo "------------------------------------------------------------------------" |
| 14455 | |
| 14456 | if [ $FAILS = 0 ]; then |
| 14457 | printf "PASSED" |
| 14458 | else |
| 14459 | printf "FAILED" |
| 14460 | fi |
| 14461 | PASSES=$(( $TESTS - $FAILS )) |
| 14462 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
| 14463 | |
Gilles Peskine | c75048c | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 14464 | if [ $((TESTS - SKIPS)) -lt $MIN_TESTS ]; then |
| 14465 | cat <<EOF |
| 14466 | Error: Expected to run at least $MIN_TESTS, but only ran $((TESTS - SKIPS)). |
| 14467 | Maybe a bad filter ('$FILTER') or a bad configuration? |
| 14468 | EOF |
| 14469 | if [ $FAILS -eq 0 ]; then |
| 14470 | FAILS=1 |
| 14471 | fi |
| 14472 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 14473 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 14474 | |
Tom Cosgrove | fc0e79e | 2023-01-13 12:13:41 +0000 | [diff] [blame] | 14475 | if [ $FAILS -gt 255 ]; then |
| 14476 | # Clamp at 255 as caller gets exit code & 0xFF |
| 14477 | # (so 256 would be 0, or success, etc) |
| 14478 | FAILS=255 |
| 14479 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 14480 | exit $FAILS |