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 | 184c4f0 | 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 | 184c4f0 | 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 | 184c4f0 | 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 | 184c4f0 | 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" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 71 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 72 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 73 | |
Gilles Peskine | dd782f4 | 2024-04-29 17:46:24 +0200 | [diff] [blame] | 74 | # If $OPENSSL is at least 1.1.1, use it as OPENSSL_NEXT as well. |
| 75 | if [ -z "${OPENSSL_NEXT:-}" ]; then |
| 76 | case $($OPENSSL version) in |
| 77 | OpenSSL\ 1.1.[1-9]*) OPENSSL_NEXT=$OPENSSL;; |
| 78 | OpenSSL\ [3-9]*) OPENSSL_NEXT=$OPENSSL;; |
| 79 | esac |
| 80 | fi |
| 81 | |
| 82 | # If $GNUTLS_CLI is at least 3.7, use it as GNUTLS_NEXT_CLI as well. |
| 83 | if [ -z "${GNUTLS_NEXT_CLI:-}" ]; then |
| 84 | case $($GNUTLS_CLI --version) in |
| 85 | gnutls-cli\ 3.[1-9][0-9]*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 86 | gnutls-cli\ 3.[7-9].*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 87 | gnutls-cli\ [4-9]*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 88 | esac |
| 89 | fi |
| 90 | |
| 91 | # If $GNUTLS_SERV is at least 3.7, use it as GNUTLS_NEXT_SERV as well. |
| 92 | if [ -z "${GNUTLS_NEXT_SERV:-}" ]; then |
| 93 | case $($GNUTLS_SERV --version) in |
| 94 | gnutls-cli\ 3.[1-9][0-9]*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 95 | gnutls-cli\ 3.[7-9].*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 96 | gnutls-cli\ [4-9]*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 97 | esac |
| 98 | fi |
| 99 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 100 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 101 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" |
| 102 | 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] | 103 | O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www " |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 104 | 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] | 105 | 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] | 106 | else |
| 107 | O_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 108 | O_NEXT_SRV_NO_CERT=false |
Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 109 | O_NEXT_SRV_EARLY_DATA=false |
XiaokangQian | b1847a2 | 2022-06-08 07:49:31 +0000 | [diff] [blame] | 110 | O_NEXT_CLI_NO_CERT=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 111 | O_NEXT_CLI=false |
| 112 | fi |
| 113 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 114 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 115 | 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] | 116 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 117 | else |
| 118 | G_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 119 | G_NEXT_SRV_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 120 | fi |
| 121 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 122 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 123 | 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] | 124 | 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] | 125 | else |
| 126 | G_NEXT_CLI=false |
XiaokangQian | fb1a3fe | 2022-06-09 06:37:33 +0000 | [diff] [blame] | 127 | G_NEXT_CLI_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 128 | fi |
| 129 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 130 | TESTS=0 |
| 131 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 132 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 133 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 134 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 135 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 136 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 137 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 138 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 139 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 140 | SHOW_TEST_NUMBER=0 |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 141 | LIST_TESTS=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 142 | RUN_TEST_NUMBER='' |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 143 | RUN_TEST_SUITE='' |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 144 | |
Gilles Peskine | 39c5207 | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 145 | MIN_TESTS=1 |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 146 | PRESERVE_LOGS=0 |
| 147 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 148 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 149 | # port which is this plus 10000. Each port number may be independently |
| 150 | # overridden by a command line option. |
| 151 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 152 | PXY_PORT=$((SRV_PORT + 10000)) |
| 153 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 154 | print_usage() { |
| 155 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 156 | printf " -h|--help\tPrint this help.\n" |
| 157 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 158 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 159 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 160 | 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] | 161 | 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] | 162 | 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] | 163 | printf " --list-test-cases\tList all potential test cases (No Execution)\n" |
Gilles Peskine | 39c5207 | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 164 | printf " --min \tMinimum number of non-skipped tests (default 1)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 165 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 166 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 167 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 168 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 169 | printf " --seed \tInteger seed value to use for this test run\n" |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 170 | printf " --test-suite\tOnly matching test suites are executed\n" |
| 171 | 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] | 172 | } |
| 173 | |
| 174 | get_options() { |
| 175 | while [ $# -gt 0 ]; do |
| 176 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 177 | -f|--filter) |
| 178 | shift; FILTER=$1 |
| 179 | ;; |
| 180 | -e|--exclude) |
| 181 | shift; EXCLUDE=$1 |
| 182 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 183 | -m|--memcheck) |
| 184 | MEMCHECK=1 |
| 185 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 186 | -n|--number) |
| 187 | shift; RUN_TEST_NUMBER=$1 |
| 188 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 189 | -s|--show-numbers) |
| 190 | SHOW_TEST_NUMBER=1 |
| 191 | ;; |
Tomás González | 4a86da2 | 2023-09-01 17:41:16 +0100 | [diff] [blame] | 192 | -l|--list-test-cases) |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 193 | LIST_TESTS=1 |
| 194 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 195 | -p|--preserve-logs) |
| 196 | PRESERVE_LOGS=1 |
| 197 | ;; |
Gilles Peskine | 39c5207 | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 198 | --min) |
| 199 | shift; MIN_TESTS=$1 |
| 200 | ;; |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 201 | --outcome-file) |
| 202 | shift; MBEDTLS_TEST_OUTCOME_FILE=$1 |
| 203 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 204 | --port) |
| 205 | shift; SRV_PORT=$1 |
| 206 | ;; |
| 207 | --proxy-port) |
| 208 | shift; PXY_PORT=$1 |
| 209 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 210 | --seed) |
| 211 | shift; SEED="$1" |
| 212 | ;; |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 213 | --test-suite) |
| 214 | shift; RUN_TEST_SUITE="$1" |
| 215 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 216 | -h|--help) |
| 217 | print_usage |
| 218 | exit 0 |
| 219 | ;; |
| 220 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 221 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 222 | print_usage |
| 223 | exit 1 |
| 224 | ;; |
| 225 | esac |
| 226 | shift |
| 227 | done |
| 228 | } |
| 229 | |
Tomás González | 0e8a08a | 2023-08-23 15:29:57 +0100 | [diff] [blame] | 230 | get_options "$@" |
| 231 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 232 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 233 | # testing. Skip non-boolean options (with something other than spaces |
| 234 | # and a comment after "#define SYMBOL"). The variable contains a |
Minos Galanakis | 4ce27cb | 2024-12-02 15:51:07 +0000 | [diff] [blame] | 235 | # space-separated list of symbols. The list should always be |
| 236 | # terminated by a single whitespace character, otherwise the last entry |
| 237 | # will not get matched by the parsing regex. |
Tomás González | f162b4f | 2023-08-23 15:31:12 +0100 | [diff] [blame] | 238 | if [ "$LIST_TESTS" -eq 0 ];then |
Minos Galanakis | 4ce27cb | 2024-12-02 15:51:07 +0000 | [diff] [blame] | 239 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` ) " |
Tomás González | f162b4f | 2023-08-23 15:31:12 +0100 | [diff] [blame] | 240 | else |
Tomás González | be2c66e | 2023-09-01 10:34:49 +0100 | [diff] [blame] | 241 | P_QUERY=":" |
Tomás González | f162b4f | 2023-08-23 15:31:12 +0100 | [diff] [blame] | 242 | CONFIGS_ENABLED="" |
| 243 | fi |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 244 | # Skip next test; use this macro to skip tests which are legitimate |
| 245 | # in theory and expected to be re-introduced at some point, but |
| 246 | # aren't expected to succeed at the moment due to problems outside |
| 247 | # our control (such as bugs in other TLS implementations). |
| 248 | skip_next_test() { |
| 249 | SKIP_NEXT="YES" |
| 250 | } |
| 251 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 252 | # Check if the required configuration ($1) is enabled |
| 253 | is_config_enabled() |
| 254 | { |
| 255 | case $CONFIGS_ENABLED in |
| 256 | *" $1"[\ =]*) return 0;; |
| 257 | *) return 1;; |
| 258 | esac |
| 259 | } |
| 260 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 261 | # 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] | 262 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 263 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 264 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 265 | *) SKIP_NEXT="YES";; |
| 266 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 267 | } |
| 268 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 269 | # 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] | 270 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 271 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 272 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 273 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 274 | } |
| 275 | |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 276 | requires_all_configs_enabled() { |
Gilles Peskine | 9404169 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 277 | for x in "$@"; do |
| 278 | if ! is_config_enabled "$x"; then |
| 279 | SKIP_NEXT="YES" |
| 280 | return |
| 281 | fi |
| 282 | done |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 283 | } |
| 284 | |
| 285 | requires_all_configs_disabled() { |
Gilles Peskine | 9404169 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 286 | for x in "$@"; do |
| 287 | if is_config_enabled "$x"; then |
| 288 | SKIP_NEXT="YES" |
| 289 | return |
| 290 | fi |
| 291 | done |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 292 | } |
| 293 | |
| 294 | requires_any_configs_enabled() { |
Gilles Peskine | 9404169 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 295 | for x in "$@"; do |
| 296 | if is_config_enabled "$x"; then |
| 297 | return |
| 298 | fi |
| 299 | done |
| 300 | SKIP_NEXT="YES" |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 301 | } |
| 302 | |
| 303 | requires_any_configs_disabled() { |
Gilles Peskine | 9404169 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 304 | for x in "$@"; do |
| 305 | if ! is_config_enabled "$x"; then |
| 306 | return |
| 307 | fi |
| 308 | done |
| 309 | SKIP_NEXT="YES" |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 310 | } |
| 311 | |
Ronald Cron | 454eb91 | 2022-10-21 08:56:04 +0200 | [diff] [blame] | 312 | TLS1_2_KEY_EXCHANGES_WITH_CERT="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 313 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 314 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 315 | MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED \ |
| 316 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 317 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 318 | TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT="MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 319 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 320 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 321 | TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 322 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
Gilles Peskine | ac767e5 | 2024-09-20 18:08:44 +0200 | [diff] [blame] | 323 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED" |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 324 | |
Gilles Peskine | 9d3b207 | 2024-09-06 15:38:47 +0200 | [diff] [blame] | 325 | requires_certificate_authentication () { |
Gilles Peskine | e3eab32 | 2024-09-10 12:24:23 +0200 | [diff] [blame] | 326 | if is_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 327 | then |
Gilles Peskine | e3eab32 | 2024-09-10 12:24:23 +0200 | [diff] [blame] | 328 | # TLS 1.3 is negotiated by default, so check whether it supports |
| 329 | # certificate-based authentication. |
| 330 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 331 | else # Only TLS 1.2 is enabled. |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 332 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 333 | fi |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 334 | } |
| 335 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 336 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 337 | # This function uses the query_config command line option to query the |
| 338 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 339 | # program. The command will always return a success value if the |
| 340 | # configuration is defined and the value will be printed to stdout. |
| 341 | # |
| 342 | # Note that if the configuration is not defined or is defined to nothing, |
| 343 | # the output of this function will be an empty string. |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 344 | if [ "$LIST_TESTS" -eq 0 ];then |
| 345 | ${P_SRV} "query_config=${1}" |
| 346 | else |
| 347 | echo "1" |
| 348 | fi |
| 349 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 350 | } |
| 351 | |
| 352 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 353 | VAL="$( get_config_value_or_default "$1" )" |
| 354 | if [ -z "$VAL" ]; then |
| 355 | # Should never happen |
| 356 | echo "Mbed TLS configuration $1 is not defined" |
| 357 | exit 1 |
| 358 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 359 | SKIP_NEXT="YES" |
| 360 | fi |
| 361 | } |
| 362 | |
| 363 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 364 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 365 | if [ -z "$VAL" ]; then |
| 366 | # Should never happen |
| 367 | echo "Mbed TLS configuration $1 is not defined" |
| 368 | exit 1 |
| 369 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 370 | SKIP_NEXT="YES" |
| 371 | fi |
| 372 | } |
| 373 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 374 | requires_config_value_equals() { |
| 375 | VAL=$( get_config_value_or_default "$1" ) |
| 376 | if [ -z "$VAL" ]; then |
| 377 | # Should never happen |
| 378 | echo "Mbed TLS configuration $1 is not defined" |
| 379 | exit 1 |
| 380 | elif [ "$VAL" -ne "$2" ]; then |
| 381 | SKIP_NEXT="YES" |
| 382 | fi |
| 383 | } |
| 384 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 385 | # Require Mbed TLS to support the given protocol version. |
| 386 | # |
| 387 | # Inputs: |
| 388 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 389 | requires_protocol_version() { |
| 390 | # Support for DTLS is detected separately in detect_dtls(). |
| 391 | case "$1" in |
| 392 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 393 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; |
| 394 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 395 | esac |
| 396 | } |
| 397 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 398 | # Space-separated list of ciphersuites supported by this build of |
| 399 | # Mbed TLS. |
Ronald Cron | 5b73de8 | 2023-11-28 15:49:25 +0100 | [diff] [blame] | 400 | P_CIPHERSUITES="" |
| 401 | if [ "$LIST_TESTS" -eq 0 ]; then |
| 402 | P_CIPHERSUITES=" $($P_CLI help_ciphersuites 2>/dev/null | |
| 403 | grep 'TLS-\|TLS1-3' | |
| 404 | tr -s ' \n' ' ')" |
| 405 | |
| 406 | if [ -z "${P_CIPHERSUITES# }" ]; then |
| 407 | echo >&2 "$0: fatal error: no cipher suites found!" |
| 408 | exit 125 |
| 409 | fi |
| 410 | fi |
| 411 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 412 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 413 | case $P_CIPHERSUITES in |
| 414 | *" $1 "*) :;; |
| 415 | *) SKIP_NEXT="YES";; |
| 416 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 417 | } |
| 418 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 419 | requires_cipher_enabled() { |
| 420 | KEY_TYPE=$1 |
| 421 | MODE=${2:-} |
Gilles Peskine | fb31ebd | 2024-10-24 20:14:16 +0200 | [diff] [blame] | 422 | case "$KEY_TYPE" in |
| 423 | CHACHA20) |
| 424 | requires_config_enabled PSA_WANT_ALG_CHACHA20_POLY1305 |
| 425 | requires_config_enabled PSA_WANT_KEY_TYPE_CHACHA20 |
| 426 | ;; |
| 427 | *) |
| 428 | requires_config_enabled PSA_WANT_ALG_${MODE} |
| 429 | requires_config_enabled PSA_WANT_KEY_TYPE_${KEY_TYPE} |
| 430 | ;; |
| 431 | esac |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 432 | } |
| 433 | |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 434 | # Automatically detect required features based on command line parameters. |
| 435 | # Parameters are: |
| 436 | # - $1 = command line (call to a TLS client or server program) |
| 437 | # - $2 = client/server |
| 438 | # - $3 = TLS version (TLS12 or TLS13) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 439 | # - $4 = Use an external tool without ECDH support |
| 440 | # - $5 = run test options |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 441 | detect_required_features() { |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 442 | CMD_LINE=$1 |
| 443 | ROLE=$2 |
| 444 | TLS_VERSION=$3 |
| 445 | EXT_WO_ECDH=$4 |
| 446 | TEST_OPTIONS=${5:-} |
| 447 | |
| 448 | case "$CMD_LINE" in |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 449 | *\ force_version=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 450 | tmp="${CMD_LINE##*\ force_version=}" |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 451 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 452 | requires_protocol_version "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 453 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 454 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 455 | case "$CMD_LINE" in |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 456 | *\ force_ciphersuite=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 457 | tmp="${CMD_LINE##*\ force_ciphersuite=}" |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 458 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 459 | requires_ciphersuite_enabled "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 460 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 461 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 462 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 463 | *[-_\ =]tickets=[^0]*) |
| 464 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 465 | esac |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 466 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 467 | *[-_\ =]alpn=*) |
| 468 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 469 | esac |
| 470 | |
Gilles Peskine | ae3dc17 | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 471 | case " $CMD_LINE " in |
| 472 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
Gilles Peskine | 6e85e35 | 2024-09-10 12:06:33 +0200 | [diff] [blame] | 473 | # The test case involves certificates (crt), or a relevant |
| 474 | # aspect of it is the (certificate-based) authentication mode. |
Gilles Peskine | ae3dc17 | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 475 | requires_certificate_authentication;; |
| 476 | esac |
| 477 | |
Gilles Peskine | 7985d45 | 2024-09-04 16:06:10 +0200 | [diff] [blame] | 478 | case " $CMD_LINE " in |
Gilles Peskine | 58b399e | 2025-02-13 21:23:22 +0100 | [diff] [blame] | 479 | *\ ca_callback=1\ *) |
| 480 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK;; |
| 481 | esac |
| 482 | |
| 483 | case " $CMD_LINE " in |
Gilles Peskine | ae710c8 | 2024-09-04 16:07:56 +0200 | [diff] [blame] | 484 | *"programs/ssl/dtls_client "*|\ |
Gilles Peskine | 7985d45 | 2024-09-04 16:06:10 +0200 | [diff] [blame] | 485 | *"programs/ssl/ssl_client1 "*) |
| 486 | requires_config_enabled MBEDTLS_CTR_DRBG_C |
| 487 | requires_config_enabled MBEDTLS_ENTROPY_C |
| 488 | requires_config_enabled MBEDTLS_PEM_PARSE_C |
| 489 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 490 | requires_certificate_authentication |
| 491 | ;; |
Gilles Peskine | 6b4d693 | 2024-09-04 16:51:50 +0200 | [diff] [blame] | 492 | *"programs/ssl/dtls_server "*|\ |
Gilles Peskine | c83e56c | 2024-09-04 17:47:14 +0200 | [diff] [blame] | 493 | *"programs/ssl/ssl_fork_server "*|\ |
Gilles Peskine | 3abca95 | 2024-09-04 16:31:06 +0200 | [diff] [blame] | 494 | *"programs/ssl/ssl_pthread_server "*|\ |
Gilles Peskine | a21e893 | 2024-09-04 16:30:32 +0200 | [diff] [blame] | 495 | *"programs/ssl/ssl_server "*) |
| 496 | requires_config_enabled MBEDTLS_CTR_DRBG_C |
| 497 | requires_config_enabled MBEDTLS_ENTROPY_C |
| 498 | requires_config_enabled MBEDTLS_PEM_PARSE_C |
| 499 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 500 | requires_certificate_authentication |
Gilles Peskine | f9ad830 | 2024-09-13 23:08:48 +0200 | [diff] [blame] | 501 | # The actual minimum depends on the configuration since it's |
| 502 | # mostly about the certificate size. |
| 503 | # In config-suite-b.h, for the test certificates (server5.crt), |
| 504 | # 1024 is not enough. |
| 505 | requires_config_value_at_least MBEDTLS_SSL_OUT_CONTENT_LEN 2000 |
Gilles Peskine | a21e893 | 2024-09-04 16:30:32 +0200 | [diff] [blame] | 506 | ;; |
Gilles Peskine | 7985d45 | 2024-09-04 16:06:10 +0200 | [diff] [blame] | 507 | esac |
| 508 | |
Gilles Peskine | 3abca95 | 2024-09-04 16:31:06 +0200 | [diff] [blame] | 509 | case " $CMD_LINE " in |
| 510 | *"programs/ssl/ssl_pthread_server "*) |
| 511 | requires_config_enabled MBEDTLS_THREADING_PTHREAD;; |
| 512 | esac |
| 513 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 514 | case "$CMD_LINE" in |
Gilles Peskine | 4f09864 | 2024-09-06 15:35:58 +0200 | [diff] [blame] | 515 | *[-_\ =]psk*|*[-_\ =]PSK*) :;; # No certificate requirement with PSK |
Gilles Peskine | e855317 | 2024-04-26 21:28:49 +0200 | [diff] [blame] | 516 | */server5*|\ |
| 517 | */server7*|\ |
| 518 | */dir-maxpath*) |
Gilles Peskine | ae3dc17 | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 519 | requires_certificate_authentication |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 520 | if [ "$TLS_VERSION" = "TLS13" ]; then |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 521 | # In case of TLS13 the support for ECDSA is enough |
| 522 | requires_pk_alg "ECDSA" |
| 523 | else |
| 524 | # For TLS12 requirements are different between server and client |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 525 | if [ "$ROLE" = "server" ]; then |
Valerio Setti | 194e2bd | 2023-03-02 17:18:10 +0100 | [diff] [blame] | 526 | # If the server uses "server5*" certificates, then an ECDSA based |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 527 | # key exchange is required. However gnutls also does not |
| 528 | # support ECDH, so this limit the choice to ECDHE-ECDSA |
| 529 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 530 | requires_any_configs_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
| 531 | else |
| 532 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT |
| 533 | fi |
| 534 | elif [ "$ROLE" = "client" ]; then |
| 535 | # On the client side it is enough to have any certificate |
| 536 | # based authentication together with support for ECDSA. |
| 537 | # Of course the GnuTLS limitation mentioned above applies |
| 538 | # also here. |
| 539 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 540 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH |
| 541 | else |
| 542 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 543 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 544 | requires_pk_alg "ECDSA" |
| 545 | fi |
| 546 | fi |
| 547 | ;; |
| 548 | esac |
| 549 | |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 550 | case "$CMD_LINE" in |
Gilles Peskine | 4f09864 | 2024-09-06 15:35:58 +0200 | [diff] [blame] | 551 | *[-_\ =]psk*|*[-_\ =]PSK*) :;; # No certificate requirement with PSK |
Gilles Peskine | d00b93b | 2024-04-29 16:03:02 +0200 | [diff] [blame] | 552 | */server1*|\ |
Gilles Peskine | e855317 | 2024-04-26 21:28:49 +0200 | [diff] [blame] | 553 | */server2*|\ |
| 554 | */server7*) |
Gilles Peskine | ae3dc17 | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 555 | requires_certificate_authentication |
Gilles Peskine | d00b93b | 2024-04-29 16:03:02 +0200 | [diff] [blame] | 556 | # Certificates with an RSA key. The algorithm requirement is |
| 557 | # some subset of {PKCS#1v1.5 encryption, PKCS#1v1.5 signature, |
| 558 | # PSS signature}. We can't easily tell which subset works, and |
| 559 | # we aren't currently running ssl-opt.sh in configurations |
| 560 | # where partial RSA support is a problem, so generically, we |
| 561 | # just require RSA and it works out for our tests so far. |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 562 | requires_config_enabled "MBEDTLS_RSA_C" |
| 563 | esac |
| 564 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 565 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 566 | } |
| 567 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 568 | adapt_cmd_for_psk () { |
| 569 | case "$2" in |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 570 | *openssl*s_server*) s='-psk 73776f726466697368 -nocert';; |
| 571 | *openssl*) s='-psk 73776f726466697368';; |
Gilles Peskine | 6f9952a | 2024-09-06 15:27:57 +0200 | [diff] [blame] | 572 | *gnutls-cli*) s='--pskusername=Client_identity --pskkey=73776f726466697368';; |
| 573 | *gnutls-serv*) s='--pskpasswd=../framework/data_files/simplepass.psk';; |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 574 | *) s='psk=73776f726466697368';; |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 575 | esac |
| 576 | eval $1='"$2 $s"' |
| 577 | unset s |
| 578 | } |
| 579 | |
| 580 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 581 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 582 | # |
| 583 | # If not running in a PSK-only build, do nothing. |
| 584 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 585 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 586 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 587 | # a pre-shared key, do nothing. |
| 588 | # |
Gilles Peskine | 7dfe7c9 | 2024-09-20 18:16:41 +0200 | [diff] [blame] | 589 | # This code does not consider builds with ECDHE-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 590 | # |
| 591 | # Inputs: |
| 592 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 593 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 594 | # * "$@": options passed to run_test. |
| 595 | # |
| 596 | # Outputs: |
| 597 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 598 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 599 | maybe_adapt_for_psk() { |
| 600 | if [ "$PSK_ONLY" != "YES" ]; then |
| 601 | return |
| 602 | fi |
| 603 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 604 | return |
| 605 | fi |
| 606 | case "$CLI_CMD $SRV_CMD" in |
| 607 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 608 | return;; |
| 609 | *force_ciphersuite*) |
| 610 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 611 | # PSK cipher suite could be substituted, but we're not ready for |
| 612 | # that yet. |
| 613 | SKIP_NEXT="YES" |
| 614 | return;; |
| 615 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 616 | # The test case involves certificates. PSK won't do. |
| 617 | SKIP_NEXT="YES" |
| 618 | return;; |
| 619 | esac |
| 620 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 621 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 622 | } |
| 623 | |
Gilles Peskine | db26406 | 2024-09-06 19:08:41 +0200 | [diff] [blame] | 624 | # PSK_PRESENT="YES" if at least one protocol versions supports at least |
| 625 | # one PSK key exchange mode. |
Gilles Peskine | 24b4303 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 626 | PSK_PRESENT="NO" |
Gilles Peskine | db26406 | 2024-09-06 19:08:41 +0200 | [diff] [blame] | 627 | # PSK_ONLY="YES" if all the available key exchange modes are PSK-based |
| 628 | # (pure-PSK or PSK-ephemeral, possibly both). |
Gilles Peskine | 24b4303 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 629 | PSK_ONLY="" |
| 630 | for c in $CONFIGS_ENABLED; do |
| 631 | case $c in |
| 632 | MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | 2dd4395 | 2024-09-09 11:24:17 +0200 | [diff] [blame] | 633 | MBEDTLS_KEY_EXCHANGE_*_PSK_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | 24b4303 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 634 | MBEDTLS_KEY_EXCHANGE_*_ENABLED) PSK_ONLY="NO";; |
| 635 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | db26406 | 2024-09-06 19:08:41 +0200 | [diff] [blame] | 636 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_*_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | 24b4303 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 637 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_*_ENABLED) PSK_ONLY="NO";; |
| 638 | esac |
| 639 | done |
Gilles Peskine | 7f453bf | 2024-09-09 10:57:01 +0200 | [diff] [blame] | 640 | # At this stage, $PSK_ONLY is empty if we haven't detected a non-PSK |
| 641 | # key exchange, i.e. if we're in a PSK-only build or a build with no |
| 642 | # key exchanges at all. We avoid triggering PSK-only adaptation code in |
Gilles Peskine | 6e85e35 | 2024-09-10 12:06:33 +0200 | [diff] [blame] | 643 | # the edge case of no key exchanges. |
Gilles Peskine | 24b4303 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 644 | : ${PSK_ONLY:=$PSK_PRESENT} |
| 645 | unset c |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 646 | |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 647 | HAS_ALG_MD5="NO" |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 648 | HAS_ALG_SHA_1="NO" |
| 649 | HAS_ALG_SHA_224="NO" |
| 650 | HAS_ALG_SHA_256="NO" |
| 651 | HAS_ALG_SHA_384="NO" |
| 652 | HAS_ALG_SHA_512="NO" |
| 653 | |
| 654 | check_for_hash_alg() |
| 655 | { |
| 656 | CURR_ALG="INVALID"; |
Gilles Peskine | fb31ebd | 2024-10-24 20:14:16 +0200 | [diff] [blame] | 657 | CURR_ALG=PSA_WANT_ALG_${1} |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 658 | |
| 659 | case $CONFIGS_ENABLED in |
| 660 | *" $CURR_ALG"[\ =]*) |
| 661 | return 0 |
| 662 | ;; |
| 663 | *) :;; |
| 664 | esac |
| 665 | return 1 |
| 666 | } |
| 667 | |
| 668 | populate_enabled_hash_algs() |
| 669 | { |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 670 | 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] | 671 | if check_for_hash_alg "$hash_alg"; then |
| 672 | hash_alg_variable=HAS_ALG_${hash_alg} |
| 673 | eval ${hash_alg_variable}=YES |
| 674 | fi |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 675 | done |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 676 | } |
| 677 | |
| 678 | # skip next test if the given hash alg is not supported |
| 679 | requires_hash_alg() { |
| 680 | HASH_DEFINE="Invalid" |
| 681 | HAS_HASH_ALG="NO" |
| 682 | case $1 in |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 683 | MD5):;; |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 684 | SHA_1):;; |
| 685 | SHA_224):;; |
| 686 | SHA_256):;; |
| 687 | SHA_384):;; |
| 688 | SHA_512):;; |
| 689 | *) |
| 690 | echo "Unsupported hash alg - $1" |
| 691 | exit 1 |
| 692 | ;; |
| 693 | esac |
| 694 | |
| 695 | HASH_DEFINE=HAS_ALG_${1} |
| 696 | eval "HAS_HASH_ALG=\${${HASH_DEFINE}}" |
| 697 | if [ "$HAS_HASH_ALG" = "NO" ] |
| 698 | then |
| 699 | SKIP_NEXT="YES" |
| 700 | fi |
| 701 | } |
| 702 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 703 | # Skip next test if the given pk alg is not enabled |
| 704 | requires_pk_alg() { |
| 705 | case $1 in |
| 706 | ECDSA) |
Gilles Peskine | fb31ebd | 2024-10-24 20:14:16 +0200 | [diff] [blame] | 707 | requires_config_enabled PSA_WANT_ALG_ECDSA |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 708 | ;; |
| 709 | *) |
| 710 | echo "Unknown/unimplemented case $1 in requires_pk_alg" |
| 711 | exit 1 |
| 712 | ;; |
| 713 | esac |
| 714 | } |
| 715 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 716 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 717 | requires_openssl_with_fallback_scsv() { |
| 718 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 719 | 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] | 720 | then |
| 721 | OPENSSL_HAS_FBSCSV="YES" |
| 722 | else |
| 723 | OPENSSL_HAS_FBSCSV="NO" |
| 724 | fi |
| 725 | fi |
| 726 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 727 | SKIP_NEXT="YES" |
| 728 | fi |
| 729 | } |
| 730 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 731 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 732 | requires_max_content_len() { |
| 733 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 734 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 735 | } |
| 736 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 737 | # skip next test if GnuTLS isn't available |
| 738 | requires_gnutls() { |
| 739 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 740 | 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] | 741 | GNUTLS_AVAILABLE="YES" |
| 742 | else |
| 743 | GNUTLS_AVAILABLE="NO" |
| 744 | fi |
| 745 | fi |
| 746 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 747 | SKIP_NEXT="YES" |
| 748 | fi |
| 749 | } |
| 750 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 751 | # skip next test if GnuTLS-next isn't available |
| 752 | requires_gnutls_next() { |
| 753 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 754 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 755 | GNUTLS_NEXT_AVAILABLE="YES" |
| 756 | else |
| 757 | GNUTLS_NEXT_AVAILABLE="NO" |
| 758 | fi |
| 759 | fi |
| 760 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 761 | SKIP_NEXT="YES" |
| 762 | fi |
| 763 | } |
| 764 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 765 | requires_openssl_next() { |
| 766 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 767 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 768 | OPENSSL_NEXT_AVAILABLE="YES" |
| 769 | else |
| 770 | OPENSSL_NEXT_AVAILABLE="NO" |
| 771 | fi |
| 772 | fi |
| 773 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 774 | SKIP_NEXT="YES" |
| 775 | fi |
| 776 | } |
| 777 | |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 778 | # skip next test if openssl version is lower than 3.0 |
| 779 | requires_openssl_3_x() { |
| 780 | requires_openssl_next |
| 781 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 782 | OPENSSL_3_X_AVAILABLE="NO" |
| 783 | fi |
| 784 | if [ -z "${OPENSSL_3_X_AVAILABLE:-}" ]; then |
Przemek Stekiel | a53dca1 | 2023-06-14 20:53:09 +0200 | [diff] [blame] | 785 | if $OPENSSL_NEXT version 2>&1 | grep "OpenSSL 3." >/dev/null |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 786 | then |
| 787 | OPENSSL_3_X_AVAILABLE="YES" |
| 788 | else |
| 789 | OPENSSL_3_X_AVAILABLE="NO" |
| 790 | fi |
| 791 | fi |
| 792 | if [ "$OPENSSL_3_X_AVAILABLE" = "NO" ]; then |
| 793 | SKIP_NEXT="YES" |
| 794 | fi |
| 795 | } |
| 796 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 797 | # skip next test if openssl does not support ffdh keys |
| 798 | requires_openssl_tls1_3_with_ffdh() { |
| 799 | requires_openssl_3_x |
| 800 | } |
| 801 | |
Przemek Stekiel | 7dda271 | 2023-06-27 14:43:33 +0200 | [diff] [blame] | 802 | # skip next test if openssl cannot handle ephemeral key exchange |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 803 | requires_openssl_tls1_3_with_compatible_ephemeral() { |
| 804 | requires_openssl_next |
| 805 | |
| 806 | if !(is_config_enabled "PSA_WANT_ALG_ECDH"); then |
| 807 | requires_openssl_tls1_3_with_ffdh |
| 808 | fi |
| 809 | } |
| 810 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 811 | # skip next test if tls1_3 is not available |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 812 | requires_openssl_tls1_3() { |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 813 | requires_openssl_next |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 814 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 815 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 816 | fi |
| 817 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 818 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 819 | then |
| 820 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 821 | else |
| 822 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 823 | fi |
| 824 | fi |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 825 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 826 | SKIP_NEXT="YES" |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 827 | fi |
| 828 | } |
| 829 | |
Gilles Peskine | 7f453bf | 2024-09-09 10:57:01 +0200 | [diff] [blame] | 830 | # OpenSSL servers forbid client renegotiation by default since OpenSSL 3.0. |
| 831 | # Older versions always allow it and have no command-line option. |
Gilles Peskine | 56ee69d | 2024-09-06 13:52:14 +0200 | [diff] [blame] | 832 | OPENSSL_S_SERVER_CLIENT_RENEGOTIATION= |
| 833 | case $($OPENSSL s_server -help 2>&1) in |
| 834 | *-client_renegotiation*) |
| 835 | OPENSSL_S_SERVER_CLIENT_RENEGOTIATION=-client_renegotiation;; |
| 836 | esac |
| 837 | |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 838 | # skip next test if tls1_3 is not available |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 839 | requires_gnutls_tls1_3() { |
| 840 | requires_gnutls_next |
| 841 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 842 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 843 | fi |
| 844 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 845 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 846 | then |
| 847 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 848 | else |
| 849 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 850 | fi |
| 851 | fi |
| 852 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 853 | SKIP_NEXT="YES" |
| 854 | fi |
| 855 | } |
| 856 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 857 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 858 | requires_gnutls_next_no_ticket() { |
| 859 | requires_gnutls_next |
| 860 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 861 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 862 | fi |
| 863 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 864 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 865 | then |
| 866 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 867 | else |
| 868 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 869 | fi |
| 870 | fi |
| 871 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 872 | SKIP_NEXT="YES" |
| 873 | fi |
| 874 | } |
| 875 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 876 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 877 | requires_gnutls_next_disable_tls13_compat() { |
| 878 | requires_gnutls_next |
| 879 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 880 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 881 | fi |
| 882 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 883 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 884 | then |
| 885 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 886 | else |
| 887 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 888 | fi |
| 889 | fi |
| 890 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 891 | SKIP_NEXT="YES" |
| 892 | fi |
| 893 | } |
| 894 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 895 | # skip next test if GnuTLS does not support the record size limit extension |
| 896 | requires_gnutls_record_size_limit() { |
| 897 | requires_gnutls_next |
| 898 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 899 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="NO" |
| 900 | else |
| 901 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="YES" |
| 902 | fi |
| 903 | if [ "$GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE" = "NO" ]; then |
| 904 | SKIP_NEXT="YES" |
| 905 | fi |
| 906 | } |
| 907 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 908 | # skip next test if IPv6 isn't available on this host |
| 909 | requires_ipv6() { |
| 910 | if [ -z "${HAS_IPV6:-}" ]; then |
| 911 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 912 | SRV_PID=$! |
| 913 | sleep 1 |
| 914 | kill $SRV_PID >/dev/null 2>&1 |
| 915 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 916 | HAS_IPV6="NO" |
| 917 | else |
| 918 | HAS_IPV6="YES" |
| 919 | fi |
| 920 | rm -r $SRV_OUT |
| 921 | fi |
| 922 | |
| 923 | if [ "$HAS_IPV6" = "NO" ]; then |
| 924 | SKIP_NEXT="YES" |
| 925 | fi |
| 926 | } |
| 927 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 928 | # skip next test if it's i686 or uname is not available |
| 929 | requires_not_i686() { |
| 930 | if [ -z "${IS_I686:-}" ]; then |
| 931 | IS_I686="YES" |
| 932 | if which "uname" >/dev/null 2>&1; then |
| 933 | if [ -z "$(uname -a | grep i686)" ]; then |
| 934 | IS_I686="NO" |
| 935 | fi |
| 936 | fi |
| 937 | fi |
| 938 | if [ "$IS_I686" = "YES" ]; then |
| 939 | SKIP_NEXT="YES" |
| 940 | fi |
| 941 | } |
| 942 | |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 943 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 944 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 945 | 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] | 946 | if [ "$LIST_TESTS" -eq 0 ];then |
| 947 | # Calculate the input & output maximum content lengths set in the config |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 948 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 949 | # Calculate the maximum content length that fits both |
| 950 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 951 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 952 | fi |
| 953 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 954 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 955 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 956 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 957 | # skip the next test if the SSL output buffer is less than 16KB |
| 958 | requires_full_size_output_buffer() { |
| 959 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 960 | SKIP_NEXT="YES" |
| 961 | fi |
| 962 | } |
| 963 | |
Gilles Peskine | 05030d4 | 2024-10-31 18:52:40 +0100 | [diff] [blame] | 964 | # Skip the next test if called by all.sh in a component with MSan |
| 965 | # (which we also call MemSan) or Valgrind. |
| 966 | not_with_msan_or_valgrind() { |
| 967 | case "_${MBEDTLS_TEST_CONFIGURATION:-}_" in |
| 968 | *_msan_*|*_memsan_*|*_valgrind_*) SKIP_NEXT="YES";; |
| 969 | esac |
| 970 | } |
| 971 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 972 | # skip the next test if valgrind is in use |
| 973 | not_with_valgrind() { |
| 974 | if [ "$MEMCHECK" -gt 0 ]; then |
| 975 | SKIP_NEXT="YES" |
| 976 | fi |
| 977 | } |
| 978 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 979 | # skip the next test if valgrind is NOT in use |
| 980 | only_with_valgrind() { |
| 981 | if [ "$MEMCHECK" -eq 0 ]; then |
| 982 | SKIP_NEXT="YES" |
| 983 | fi |
| 984 | } |
| 985 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 986 | # 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] | 987 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 988 | CLI_DELAY_FACTOR=$1 |
| 989 | } |
| 990 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 991 | # wait for the given seconds after the client finished in the next test |
| 992 | server_needs_more_time() { |
| 993 | SRV_DELAY_SECONDS=$1 |
| 994 | } |
| 995 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 996 | # print_name <name> |
| 997 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 998 | TESTS=$(( $TESTS + 1 )) |
| 999 | LINE="" |
| 1000 | |
| 1001 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 1002 | LINE="$TESTS " |
| 1003 | fi |
| 1004 | |
| 1005 | LINE="$LINE$1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1006 | |
Tomás González | 378e364 | 2023-09-04 10:41:37 +0100 | [diff] [blame] | 1007 | printf "%s " "$LINE" |
| 1008 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
| 1009 | for i in `seq 1 $LEN`; do printf '.'; done |
| 1010 | printf ' ' |
| 1011 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1012 | } |
| 1013 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1014 | # record_outcome <outcome> [<failure-reason>] |
| 1015 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 1016 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1017 | record_outcome() { |
| 1018 | echo "$1" |
| 1019 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 1020 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 1021 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Jerry Yu | 9e47b26 | 2023-11-06 10:52:01 +0800 | [diff] [blame] | 1022 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1023 | "$1" "${2-}" \ |
| 1024 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 1025 | fi |
| 1026 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 1027 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1028 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 1029 | # True if the presence of the given pattern in a log definitely indicates |
| 1030 | # that the test has failed. False if the presence is inconclusive. |
| 1031 | # |
| 1032 | # Inputs: |
| 1033 | # * $1: pattern found in the logs |
| 1034 | # * $TIMES_LEFT: >0 if retrying is an option |
| 1035 | # |
| 1036 | # Outputs: |
| 1037 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 1038 | # unchanged otherwise. |
| 1039 | # * Return value: 1 if the pattern is inconclusive, |
| 1040 | # 0 if the failure is definitive. |
| 1041 | log_pattern_presence_is_conclusive() { |
| 1042 | # If we've run out of attempts, then don't retry no matter what. |
| 1043 | if [ $TIMES_LEFT -eq 0 ]; then |
| 1044 | return 0 |
| 1045 | fi |
| 1046 | case $1 in |
| 1047 | "resend") |
| 1048 | # An undesired resend may have been caused by the OS dropping or |
| 1049 | # delaying a packet at an inopportune time. |
| 1050 | outcome="RETRY(resend)" |
| 1051 | return 1;; |
| 1052 | esac |
| 1053 | } |
| 1054 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1055 | # fail <message> |
| 1056 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1057 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 1058 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1059 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 1060 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1061 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1062 | if [ -n "$PXY_CMD" ]; then |
| 1063 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1064 | fi |
| 1065 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1066 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 1067 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1068 | echo " ! server output:" |
| 1069 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1070 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1071 | echo " ! client output:" |
| 1072 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1073 | if [ -n "$PXY_CMD" ]; then |
| 1074 | echo " ! ========================================================" |
| 1075 | echo " ! proxy output:" |
| 1076 | cat o-pxy-${TESTS}.log |
| 1077 | fi |
| 1078 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1079 | fi |
| 1080 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 1081 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1082 | } |
| 1083 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1084 | # is_polar <cmd_line> |
| 1085 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1086 | case "$1" in |
| 1087 | *ssl_client2*) true;; |
| 1088 | *ssl_server2*) true;; |
| 1089 | *) false;; |
| 1090 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1091 | } |
| 1092 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 1093 | # openssl s_server doesn't have -www with DTLS |
| 1094 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1095 | case "$SRV_CMD" in |
| 1096 | *s_server*-dtls*) |
| 1097 | NEEDS_INPUT=1 |
| 1098 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 1099 | *) NEEDS_INPUT=0;; |
| 1100 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 1101 | } |
| 1102 | |
| 1103 | # provide input to commands that need it |
| 1104 | provide_input() { |
| 1105 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 1106 | return |
| 1107 | fi |
| 1108 | |
| 1109 | while true; do |
| 1110 | echo "HTTP/1.0 200 OK" |
| 1111 | sleep 1 |
| 1112 | done |
| 1113 | } |
| 1114 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1115 | # has_mem_err <log_file_name> |
| 1116 | has_mem_err() { |
| 1117 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 1118 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 1119 | then |
| 1120 | return 1 # false: does not have errors |
| 1121 | else |
| 1122 | return 0 # true: has errors |
| 1123 | fi |
| 1124 | } |
| 1125 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1126 | # 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] | 1127 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1128 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1129 | newline=' |
| 1130 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1131 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1132 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1133 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1134 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1135 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1136 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1137 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 1138 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1139 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1140 | # When we use a proxy, it will be listening on the same port we |
| 1141 | # 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] | 1142 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1143 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1144 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1145 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1146 | echo "$3 START TIMEOUT" |
| 1147 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1148 | break |
| 1149 | fi |
| 1150 | # Linux and *BSD support decimal arguments to sleep. On other |
| 1151 | # OSes this may be a tight loop. |
| 1152 | sleep 0.1 2>/dev/null || true |
| 1153 | done |
| 1154 | } |
| 1155 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1156 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 1157 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1158 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1159 | } |
| 1160 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1161 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1162 | # Wait for server process $2 to be listening on port $1. |
| 1163 | wait_server_start() { |
| 1164 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 1165 | } |
| 1166 | |
| 1167 | # Wait for proxy process $2 to be listening on port $1. |
| 1168 | wait_proxy_start() { |
| 1169 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 1170 | } |
| 1171 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1172 | # 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] | 1173 | # 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] | 1174 | # acceptable bounds |
| 1175 | check_server_hello_time() { |
| 1176 | # 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] | 1177 | 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] | 1178 | # Get the Unix timestamp for now |
| 1179 | CUR_TIME=$(date +'%s') |
| 1180 | THRESHOLD_IN_SECS=300 |
| 1181 | |
| 1182 | # Check if the ServerHello time was printed |
| 1183 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 1184 | return 1 |
| 1185 | fi |
| 1186 | |
| 1187 | # Check the time in ServerHello is within acceptable bounds |
| 1188 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 1189 | # The time in ServerHello is at least 5 minutes before now |
| 1190 | return 1 |
| 1191 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 1192 | # 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] | 1193 | return 1 |
| 1194 | else |
| 1195 | return 0 |
| 1196 | fi |
| 1197 | } |
| 1198 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1199 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 1200 | handshake_memory_get() { |
| 1201 | OUTPUT_VARIABLE="$1" |
| 1202 | OUTPUT_FILE="$2" |
| 1203 | |
| 1204 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 1205 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 1206 | |
| 1207 | # Check if memory usage was read |
| 1208 | if [ -z "$MEM_USAGE" ]; then |
| 1209 | echo "Error: Can not read the value of handshake memory usage" |
| 1210 | return 1 |
| 1211 | else |
| 1212 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 1213 | return 0 |
| 1214 | fi |
| 1215 | } |
| 1216 | |
| 1217 | # Get handshake memory usage from server or client output and check if this value |
| 1218 | # is not higher than the maximum given by the first argument |
| 1219 | handshake_memory_check() { |
| 1220 | MAX_MEMORY="$1" |
| 1221 | OUTPUT_FILE="$2" |
| 1222 | |
| 1223 | # Get memory usage |
| 1224 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 1225 | return 1 |
| 1226 | fi |
| 1227 | |
| 1228 | # Check if memory usage is below max value |
| 1229 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 1230 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 1231 | "but should be below $MAX_MEMORY bytes" |
| 1232 | return 1 |
| 1233 | else |
| 1234 | return 0 |
| 1235 | fi |
| 1236 | } |
| 1237 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1238 | # wait for client to terminate and set CLI_EXIT |
| 1239 | # must be called right after starting the client |
| 1240 | wait_client_done() { |
| 1241 | CLI_PID=$! |
| 1242 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1243 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 1244 | CLI_DELAY_FACTOR=1 |
| 1245 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1246 | ( 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] | 1247 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1248 | |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1249 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
| 1250 | # To remove it from stdout, redirect stdout/stderr to CLI_OUT |
| 1251 | wait $CLI_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1252 | CLI_EXIT=$? |
| 1253 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1254 | kill $DOG_PID >/dev/null 2>&1 |
Jerry Yu | fe52e55 | 2022-07-09 04:23:43 +0000 | [diff] [blame] | 1255 | wait $DOG_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1256 | |
| 1257 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1258 | |
| 1259 | sleep $SRV_DELAY_SECONDS |
| 1260 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1261 | } |
| 1262 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1263 | # check if the given command uses dtls and sets global variable DTLS |
| 1264 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1265 | case "$1" in |
Gilles Peskine | 6b4d693 | 2024-09-04 16:51:50 +0200 | [diff] [blame] | 1266 | *dtls=1*|*-dtls*|*-u*|*/dtls_*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1267 | *) DTLS=0;; |
| 1268 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1269 | } |
| 1270 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1271 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 1272 | is_gnutls() { |
| 1273 | case "$1" in |
| 1274 | *gnutls-cli*) |
| 1275 | CMD_IS_GNUTLS=1 |
| 1276 | ;; |
| 1277 | *gnutls-serv*) |
| 1278 | CMD_IS_GNUTLS=1 |
| 1279 | ;; |
| 1280 | *) |
| 1281 | CMD_IS_GNUTLS=0 |
| 1282 | ;; |
| 1283 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1284 | } |
| 1285 | |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 1286 | # Some external tools (gnutls or openssl) might not have support for static ECDH |
| 1287 | # 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] | 1288 | # and client command lines, given as input, to verify if the current test |
| 1289 | # is using one of these tools. |
| 1290 | use_ext_tool_without_ecdh_support() { |
| 1291 | case "$1" in |
| 1292 | *$GNUTLS_SERV*|\ |
| 1293 | *${GNUTLS_NEXT_SERV:-"gnutls-serv-dummy"}*|\ |
| 1294 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1295 | echo "yes" |
| 1296 | return;; |
| 1297 | esac |
| 1298 | case "$2" in |
| 1299 | *$GNUTLS_CLI*|\ |
| 1300 | *${GNUTLS_NEXT_CLI:-"gnutls-cli-dummy"}*|\ |
| 1301 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1302 | echo "yes" |
| 1303 | return;; |
| 1304 | esac |
| 1305 | echo "no" |
| 1306 | } |
| 1307 | |
Jerry Yu | f467d46 | 2022-11-07 13:12:44 +0800 | [diff] [blame] | 1308 | # Generate random psk_list argument for ssl_server2 |
| 1309 | get_srv_psk_list () |
| 1310 | { |
| 1311 | case $(( TESTS % 3 )) in |
| 1312 | 0) echo "psk_list=abc,dead,def,beef,Client_identity,6162636465666768696a6b6c6d6e6f70";; |
| 1313 | 1) echo "psk_list=abc,dead,Client_identity,6162636465666768696a6b6c6d6e6f70,def,beef";; |
| 1314 | 2) echo "psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70,abc,dead,def,beef";; |
| 1315 | esac |
| 1316 | } |
| 1317 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1318 | # Determine what calc_verify trace is to be expected, if any. |
| 1319 | # |
| 1320 | # calc_verify is only called for two things: to calculate the |
| 1321 | # extended master secret, and to process client authentication. |
| 1322 | # |
| 1323 | # Warning: the current implementation assumes that extended_ms is not |
| 1324 | # disabled on the client or on the server. |
| 1325 | # |
| 1326 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1327 | # * $1: the value of the server auth_mode parameter. |
| 1328 | # 'required' if client authentication is expected, |
| 1329 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1330 | # * $CONFIGS_ENABLED |
| 1331 | # |
| 1332 | # Outputs: |
| 1333 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 1334 | set_maybe_calc_verify() { |
| 1335 | maybe_calc_verify= |
| 1336 | case $CONFIGS_ENABLED in |
| 1337 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 1338 | *) |
| 1339 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1340 | ''|none) return;; |
| 1341 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1342 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 1343 | esac |
| 1344 | esac |
Gilles Peskine | fb31ebd | 2024-10-24 20:14:16 +0200 | [diff] [blame] | 1345 | maybe_calc_verify="PSA calc verify" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1346 | } |
| 1347 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1348 | # Compare file content |
| 1349 | # Usage: find_in_both pattern file1 file2 |
| 1350 | # extract from file1 the first line matching the pattern |
| 1351 | # check in file2 that the same line can be found |
| 1352 | find_in_both() { |
| 1353 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 1354 | if [ -z "$srv_pattern" ]; then |
| 1355 | return 1; |
| 1356 | fi |
| 1357 | |
| 1358 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 1359 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1360 | else |
| 1361 | return 1; |
| 1362 | fi |
| 1363 | } |
| 1364 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1365 | SKIP_HANDSHAKE_CHECK="NO" |
| 1366 | skip_handshake_stage_check() { |
| 1367 | SKIP_HANDSHAKE_CHECK="YES" |
| 1368 | } |
| 1369 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1370 | # Analyze the commands that will be used in a test. |
| 1371 | # |
| 1372 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 1373 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 1374 | # |
| 1375 | # Inputs: |
| 1376 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 1377 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 1378 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 1379 | # |
| 1380 | # Outputs: |
| 1381 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1382 | analyze_test_commands() { |
Gilles Peskine | ae710c8 | 2024-09-04 16:07:56 +0200 | [diff] [blame] | 1383 | # If the test uses DTLS, does not force a specific port, and does not |
| 1384 | # specify a custom proxy, add a simple proxy. |
| 1385 | # It provides timing info that's useful to debug failures. |
| 1386 | if [ "$DTLS" -eq 1 ] && |
| 1387 | [ "$THIS_SRV_PORT" = "$SRV_PORT" ] && |
| 1388 | [ -z "$PXY_CMD" ] |
| 1389 | then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1390 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 1391 | case " $SRV_CMD " in |
| 1392 | *' server_addr=::1 '*) |
| 1393 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 1394 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1395 | fi |
| 1396 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1397 | # update CMD_IS_GNUTLS variable |
| 1398 | is_gnutls "$SRV_CMD" |
| 1399 | |
| 1400 | # if the server uses gnutls but doesn't set priority, explicitly |
| 1401 | # set the default priority |
| 1402 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1403 | case "$SRV_CMD" in |
| 1404 | *--priority*) :;; |
| 1405 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 1406 | esac |
| 1407 | fi |
| 1408 | |
| 1409 | # update CMD_IS_GNUTLS variable |
| 1410 | is_gnutls "$CLI_CMD" |
| 1411 | |
| 1412 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1413 | # set the default priority |
| 1414 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1415 | case "$CLI_CMD" in |
| 1416 | *--priority*) :;; |
| 1417 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1418 | esac |
| 1419 | fi |
| 1420 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1421 | # fix client port |
| 1422 | if [ -n "$PXY_CMD" ]; then |
| 1423 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1424 | else |
Gilles Peskine | 2bc5c80 | 2024-09-04 16:05:11 +0200 | [diff] [blame] | 1425 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$THIS_SRV_PORT/g ) |
| 1426 | fi |
| 1427 | |
| 1428 | # If the test forces a specific port and the server is OpenSSL or |
| 1429 | # GnuTLS, override its port specification. |
| 1430 | if [ "$THIS_SRV_PORT" != "$SRV_PORT" ]; then |
| 1431 | case "$SRV_CMD" in |
Gilles Peskine | 6ef5239 | 2024-09-04 23:33:36 +0200 | [diff] [blame] | 1432 | "$G_SRV"*|"$G_NEXT_SRV"*) |
| 1433 | SRV_CMD=$( |
| 1434 | printf %s "$SRV_CMD " | |
| 1435 | sed -e "s/ -p $SRV_PORT / -p $THIS_SRV_PORT /" |
| 1436 | );; |
Gilles Peskine | 2bc5c80 | 2024-09-04 16:05:11 +0200 | [diff] [blame] | 1437 | "$O_SRV"*|"$O_NEXT_SRV"*) SRV_CMD="$SRV_CMD -accept $THIS_SRV_PORT";; |
| 1438 | esac |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1439 | fi |
| 1440 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1441 | # prepend valgrind to our commands if active |
| 1442 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1443 | if is_polar "$SRV_CMD"; then |
| 1444 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1445 | fi |
| 1446 | if is_polar "$CLI_CMD"; then |
| 1447 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1448 | fi |
| 1449 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1450 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1451 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1452 | # Check for failure conditions after a test case. |
| 1453 | # |
| 1454 | # Inputs from run_test: |
| 1455 | # * positional parameters: test options (see run_test documentation) |
| 1456 | # * $CLI_EXIT: client return code |
| 1457 | # * $CLI_EXPECT: expected client return code |
| 1458 | # * $SRV_RET: server return code |
| 1459 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1460 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1461 | # |
| 1462 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1463 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1464 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1465 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1466 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1467 | if [ $TIMES_LEFT -gt 0 ] && |
| 1468 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1469 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1470 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1471 | return |
| 1472 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1473 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1474 | # 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] | 1475 | # (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] | 1476 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1477 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1478 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1479 | then |
| 1480 | if is_polar "$SRV_CMD"; then |
| 1481 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1482 | else |
| 1483 | fail "server or client failed to reach handshake stage" |
| 1484 | return |
| 1485 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1486 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1487 | if is_polar "$CLI_CMD"; then |
| 1488 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1489 | else |
| 1490 | fail "server or client failed to reach handshake stage" |
| 1491 | return |
| 1492 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1493 | fi |
| 1494 | fi |
| 1495 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1496 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1497 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1498 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1499 | # care anyway), in case e.g. the server reports a memory leak. |
| 1500 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1501 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1502 | return |
| 1503 | fi |
| 1504 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1505 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1506 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1507 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1508 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1509 | 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] | 1510 | return |
| 1511 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1512 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1513 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1514 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1515 | # 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] | 1516 | while [ $# -gt 0 ] |
| 1517 | do |
| 1518 | case $1 in |
| 1519 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1520 | 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] | 1521 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1522 | return |
| 1523 | fi |
| 1524 | ;; |
| 1525 | |
| 1526 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1527 | 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] | 1528 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1529 | return |
| 1530 | fi |
| 1531 | ;; |
| 1532 | |
| 1533 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1534 | 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] | 1535 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1536 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1537 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1538 | return |
| 1539 | fi |
| 1540 | ;; |
| 1541 | |
| 1542 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1543 | 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] | 1544 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1545 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1546 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1547 | return |
| 1548 | fi |
| 1549 | ;; |
| 1550 | |
| 1551 | # The filtering in the following two options (-u and -U) do the following |
| 1552 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1553 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1554 | # - keep one of each non-unique line |
| 1555 | # - count how many lines remain |
| 1556 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1557 | # if there were no duplicates. |
| 1558 | "-U") |
| 1559 | 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 |
| 1560 | fail "lines following pattern '$2' must be unique in Server output" |
| 1561 | return |
| 1562 | fi |
| 1563 | ;; |
| 1564 | |
| 1565 | "-u") |
| 1566 | 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 |
| 1567 | 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] | 1568 | return |
| 1569 | fi |
| 1570 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1571 | "-F") |
| 1572 | if ! $2 "$SRV_OUT"; then |
| 1573 | fail "function call to '$2' failed on Server output" |
| 1574 | return |
| 1575 | fi |
| 1576 | ;; |
| 1577 | "-f") |
| 1578 | if ! $2 "$CLI_OUT"; then |
| 1579 | fail "function call to '$2' failed on Client output" |
| 1580 | return |
| 1581 | fi |
| 1582 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1583 | "-g") |
| 1584 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1585 | fail "function call to '$2' failed on Server and Client output" |
| 1586 | return |
| 1587 | fi |
| 1588 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1589 | |
| 1590 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1591 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1592 | exit 1 |
| 1593 | esac |
| 1594 | shift 2 |
| 1595 | done |
| 1596 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1597 | # check valgrind's results |
| 1598 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1599 | 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] | 1600 | fail "Server has memory errors" |
| 1601 | return |
| 1602 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1603 | 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] | 1604 | fail "Client has memory errors" |
| 1605 | return |
| 1606 | fi |
| 1607 | fi |
| 1608 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1609 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1610 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1611 | } |
| 1612 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1613 | # Run the current test case: start the server and if applicable the proxy, run |
| 1614 | # the client, wait for all processes to finish or time out. |
| 1615 | # |
| 1616 | # Inputs: |
| 1617 | # * $NAME: test case name |
| 1618 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1619 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1620 | # |
| 1621 | # Outputs: |
| 1622 | # * $CLI_EXIT: client return code |
| 1623 | # * $SRV_RET: server return code |
| 1624 | do_run_test_once() { |
| 1625 | # run the commands |
| 1626 | if [ -n "$PXY_CMD" ]; then |
| 1627 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1628 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1629 | PXY_PID=$! |
| 1630 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1631 | fi |
| 1632 | |
| 1633 | check_osrv_dtls |
| 1634 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1635 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1636 | SRV_PID=$! |
Gilles Peskine | 2bc5c80 | 2024-09-04 16:05:11 +0200 | [diff] [blame] | 1637 | wait_server_start "$THIS_SRV_PORT" "$SRV_PID" |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1638 | |
| 1639 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1640 | # The client must be a subprocess of the script in order for killing it to |
| 1641 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1642 | # not at the end of the line: the latter approach will spawn eval as a |
| 1643 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1644 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1645 | wait_client_done |
| 1646 | |
| 1647 | sleep 0.05 |
| 1648 | |
| 1649 | # terminate the server (and the proxy) |
| 1650 | kill $SRV_PID |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1651 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
Jerry Yu | 27d8092 | 2022-08-02 21:28:55 +0800 | [diff] [blame] | 1652 | # To remove it from stdout, redirect stdout/stderr to SRV_OUT |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1653 | wait $SRV_PID >> $SRV_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1654 | SRV_RET=$? |
| 1655 | |
| 1656 | if [ -n "$PXY_CMD" ]; then |
| 1657 | kill $PXY_PID >/dev/null 2>&1 |
Jerry Yu | 6969eee | 2022-10-10 10:25:26 +0800 | [diff] [blame] | 1658 | wait $PXY_PID >> $PXY_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1659 | fi |
| 1660 | } |
| 1661 | |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1662 | # 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] | 1663 | # $1 and $2 contain the server and client command lines, respectively. |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1664 | # |
| 1665 | # Note: this function only provides some guess about TLS version by simply |
Yanray Wang | 7b320fa | 2023-11-08 10:33:30 +0800 | [diff] [blame] | 1666 | # looking at the server/client command lines. Even though this works |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1667 | # for the sake of tests' filtering (especially in conjunction with the |
| 1668 | # detect_required_features() function), it does NOT guarantee that the |
| 1669 | # result is accurate. It does not check other conditions, such as: |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1670 | # - we can force a ciphersuite which contains "WITH" in its name, meaning |
| 1671 | # that we are going to use TLS 1.2 |
| 1672 | # - etc etc |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1673 | get_tls_version() { |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1674 | # First check if the version is forced on an Mbed TLS peer |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1675 | case $1 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1676 | *tls12*) |
| 1677 | echo "TLS12" |
| 1678 | return;; |
| 1679 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1680 | echo "TLS13" |
| 1681 | return;; |
| 1682 | esac |
| 1683 | case $2 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1684 | *tls12*) |
| 1685 | echo "TLS12" |
| 1686 | return;; |
| 1687 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1688 | echo "TLS13" |
| 1689 | return;; |
| 1690 | esac |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1691 | # Second check if the version is forced on an OpenSSL or GnuTLS peer |
| 1692 | case $1 in |
| 1693 | tls1_2*) |
| 1694 | echo "TLS12" |
| 1695 | return;; |
| 1696 | *tls1_3) |
| 1697 | echo "TLS13" |
| 1698 | return;; |
| 1699 | esac |
| 1700 | case $2 in |
| 1701 | *tls1_2) |
| 1702 | echo "TLS12" |
| 1703 | return;; |
| 1704 | *tls1_3) |
| 1705 | echo "TLS13" |
| 1706 | return;; |
| 1707 | esac |
| 1708 | # Third if the version is not forced, if TLS 1.3 is enabled then the test |
| 1709 | # is aimed to run a TLS 1.3 handshake. |
Gilles Peskine | 9404169 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 1710 | if is_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1711 | then |
| 1712 | echo "TLS13" |
| 1713 | else |
| 1714 | echo "TLS12" |
| 1715 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1716 | } |
| 1717 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1718 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1719 | # Options: -s pattern pattern that must be present in server output |
| 1720 | # -c pattern pattern that must be present in client output |
| 1721 | # -u pattern lines after pattern must be unique in client output |
| 1722 | # -f call shell function on client output |
| 1723 | # -S pattern pattern that must be absent in server output |
| 1724 | # -C pattern pattern that must be absent in client output |
| 1725 | # -U pattern lines after pattern must be unique in server output |
| 1726 | # -F call shell function on server output |
| 1727 | # -g call shell function on server and client output |
| 1728 | run_test() { |
| 1729 | NAME="$1" |
| 1730 | shift 1 |
| 1731 | |
Tomás González | 787428a | 2023-08-23 15:27:19 +0100 | [diff] [blame] | 1732 | if is_excluded "$NAME"; then |
| 1733 | SKIP_NEXT="NO" |
| 1734 | # There was no request to run the test, so don't record its outcome. |
| 1735 | return |
| 1736 | fi |
| 1737 | |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1738 | if [ "$LIST_TESTS" -gt 0 ]; then |
Pengyu Lv | 3c170d3 | 2023-11-29 13:53:34 +0800 | [diff] [blame] | 1739 | printf "%s\n" "${TEST_SUITE_NAME:-ssl-opt};$NAME" |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1740 | return |
| 1741 | fi |
| 1742 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 1743 | # Use ssl-opt as default test suite name. Also see record_outcome function |
| 1744 | if is_excluded_test_suite "${TEST_SUITE_NAME:-ssl-opt}"; then |
| 1745 | # Do not skip next test and skip current test. |
| 1746 | SKIP_NEXT="NO" |
| 1747 | return |
| 1748 | fi |
| 1749 | |
Tomás González | 51cb704 | 2023-09-07 10:21:19 +0100 | [diff] [blame] | 1750 | print_name "$NAME" |
| 1751 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1752 | # Do we only run numbered tests? |
| 1753 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1754 | case ",$RUN_TEST_NUMBER," in |
| 1755 | *",$TESTS,"*) :;; |
| 1756 | *) SKIP_NEXT="YES";; |
| 1757 | esac |
| 1758 | fi |
| 1759 | |
Gilles Peskine | ae710c8 | 2024-09-04 16:07:56 +0200 | [diff] [blame] | 1760 | # Does this test specify a proxy? |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1761 | if [ "X$1" = "X-p" ]; then |
| 1762 | PXY_CMD="$2" |
| 1763 | shift 2 |
| 1764 | else |
| 1765 | PXY_CMD="" |
| 1766 | fi |
| 1767 | |
Gilles Peskine | 2bc5c80 | 2024-09-04 16:05:11 +0200 | [diff] [blame] | 1768 | # Does this test force a specific port? |
| 1769 | if [ "$1" = "-P" ]; then |
| 1770 | THIS_SRV_PORT="$2" |
| 1771 | shift 2 |
| 1772 | else |
| 1773 | THIS_SRV_PORT="$SRV_PORT" |
| 1774 | fi |
| 1775 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1776 | # get commands and client output |
| 1777 | SRV_CMD="$1" |
| 1778 | CLI_CMD="$2" |
| 1779 | CLI_EXPECT="$3" |
| 1780 | shift 3 |
| 1781 | |
| 1782 | # Check if test uses files |
| 1783 | case "$SRV_CMD $CLI_CMD" in |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1784 | *$DATA_FILES_PATH/*) |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1785 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1786 | esac |
| 1787 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1788 | # Check if the test uses DTLS. |
| 1789 | detect_dtls "$SRV_CMD" |
| 1790 | if [ "$DTLS" -eq 1 ]; then |
| 1791 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1792 | fi |
| 1793 | |
Yanray Wang | 7b320fa | 2023-11-08 10:33:30 +0800 | [diff] [blame] | 1794 | # 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] | 1795 | EXT_WO_ECDH=$(use_ext_tool_without_ecdh_support "$SRV_CMD" "$CLI_CMD") |
| 1796 | |
Gilles Peskine | cc7d6ae | 2024-09-11 21:03:05 +0200 | [diff] [blame] | 1797 | # Guess the TLS version which is going to be used. |
| 1798 | # Note that this detection is wrong in some cases, which causes unduly |
| 1799 | # skipped test cases in builds with TLS 1.3 but not TLS 1.2. |
| 1800 | # https://github.com/Mbed-TLS/mbedtls/issues/9560 |
Valerio Setti | 726ffbf | 2023-08-02 20:02:44 +0200 | [diff] [blame] | 1801 | if [ "$EXT_WO_ECDH" = "no" ]; then |
| 1802 | TLS_VERSION=$(get_tls_version "$SRV_CMD" "$CLI_CMD") |
| 1803 | else |
| 1804 | TLS_VERSION="TLS12" |
| 1805 | fi |
| 1806 | |
Gilles Peskine | 4f09864 | 2024-09-06 15:35:58 +0200 | [diff] [blame] | 1807 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1808 | maybe_adapt_for_psk "$@" |
| 1809 | |
Valerio Setti | 726ffbf | 2023-08-02 20:02:44 +0200 | [diff] [blame] | 1810 | # 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] | 1811 | # from their command-line arguments, check whether they're enabled. |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1812 | detect_required_features "$SRV_CMD" "server" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
| 1813 | detect_required_features "$CLI_CMD" "client" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1814 | |
| 1815 | # should we skip? |
| 1816 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1817 | SKIP_NEXT="NO" |
| 1818 | record_outcome "SKIP" |
| 1819 | SKIPS=$(( $SKIPS + 1 )) |
| 1820 | return |
| 1821 | fi |
| 1822 | |
| 1823 | analyze_test_commands "$@" |
| 1824 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1825 | # One regular run and two retries |
| 1826 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1827 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1828 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1829 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1830 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1831 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1832 | check_test_failure "$@" |
| 1833 | case $outcome in |
| 1834 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1835 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1836 | FAIL) return;; |
| 1837 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1838 | done |
| 1839 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1840 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1841 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1842 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1843 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1844 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1845 | if [ -n "$PXY_CMD" ]; then |
| 1846 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1847 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1848 | fi |
| 1849 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1850 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1851 | } |
| 1852 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1853 | run_test_psa() { |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1854 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1855 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1856 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1857 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1858 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1859 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1860 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1861 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1862 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1863 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1864 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1865 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1866 | -S "error" \ |
| 1867 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1868 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1869 | } |
| 1870 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1871 | run_test_psa_force_curve() { |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1872 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1873 | run_test "PSA - ECDH with $1" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 1874 | "$P_SRV debug_level=4 force_version=tls12 groups=$1" \ |
| 1875 | "$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] | 1876 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1877 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1878 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1879 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1880 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1881 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1882 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1883 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1884 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1885 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1886 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1887 | } |
| 1888 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1889 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1890 | # a maximum fragment length. |
| 1891 | # first argument ($1) is MFL for SSL client |
| 1892 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1893 | run_test_memory_after_handshake_with_mfl() |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1894 | { |
| 1895 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1896 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1897 | |
| 1898 | # Leave some margin for robustness |
| 1899 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1900 | |
| 1901 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1902 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1903 | "$P_CLI debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1904 | 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] | 1905 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1906 | 0 \ |
| 1907 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1908 | } |
| 1909 | |
| 1910 | |
| 1911 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1912 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1913 | run_tests_memory_after_handshake() |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1914 | { |
| 1915 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1916 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1917 | |
| 1918 | # first test with default MFU is to get reference memory usage |
| 1919 | MEMORY_USAGE_MFL_16K=0 |
| 1920 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1921 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1922 | "$P_CLI debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1923 | 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] | 1924 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1925 | 0 \ |
| 1926 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1927 | |
| 1928 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1929 | run_test_memory_after_handshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1930 | |
| 1931 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1932 | run_test_memory_after_handshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1933 | |
| 1934 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1935 | run_test_memory_after_handshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1936 | |
| 1937 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1938 | run_test_memory_after_handshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1939 | } |
| 1940 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1941 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1942 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1943 | rm -f context_srv.txt |
| 1944 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1945 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1946 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1947 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1948 | 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] | 1949 | exit 1 |
| 1950 | } |
| 1951 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1952 | # |
| 1953 | # MAIN |
| 1954 | # |
| 1955 | |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 1956 | # Make the outcome file path relative to the original directory, not |
| 1957 | # to .../tests |
| 1958 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 1959 | [!/]*) |
| 1960 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 1961 | ;; |
| 1962 | esac |
| 1963 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 1964 | populate_enabled_hash_algs |
| 1965 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1966 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1967 | # patterns rather than regular expressions, use a case statement instead |
| 1968 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1969 | # detects simple cases: plain substring, everything, nothing. |
| 1970 | # |
| 1971 | # As an exception, the character '.' is treated as an ordinary character |
| 1972 | # if it is the only special character in the string. This is because it's |
| 1973 | # rare to need "any one character", but needing a literal '.' is common |
| 1974 | # (e.g. '-f "DTLS 1.2"'). |
| 1975 | need_grep= |
| 1976 | case "$FILTER" in |
| 1977 | '^$') simple_filter=;; |
| 1978 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1979 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1980 | need_grep=1;; |
| 1981 | *) # No regexp or shell-pattern special character |
| 1982 | simple_filter="*$FILTER*";; |
| 1983 | esac |
| 1984 | case "$EXCLUDE" in |
| 1985 | '^$') simple_exclude=;; |
| 1986 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1987 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1988 | need_grep=1;; |
| 1989 | *) # No regexp or shell-pattern special character |
| 1990 | simple_exclude="*$EXCLUDE*";; |
| 1991 | esac |
| 1992 | if [ -n "$need_grep" ]; then |
| 1993 | is_excluded () { |
| 1994 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1995 | } |
| 1996 | else |
| 1997 | is_excluded () { |
| 1998 | case "$1" in |
| 1999 | $simple_exclude) true;; |
| 2000 | $simple_filter) false;; |
| 2001 | *) true;; |
| 2002 | esac |
| 2003 | } |
| 2004 | fi |
| 2005 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 2006 | # Filter tests according to TEST_SUITE_NAME |
| 2007 | is_excluded_test_suite () { |
| 2008 | if [ -n "$RUN_TEST_SUITE" ] |
| 2009 | then |
| 2010 | case ",$RUN_TEST_SUITE," in |
| 2011 | *",$1,"*) false;; |
| 2012 | *) true;; |
| 2013 | esac |
| 2014 | else |
| 2015 | false |
| 2016 | fi |
| 2017 | |
| 2018 | } |
| 2019 | |
| 2020 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 2021 | if [ "$LIST_TESTS" -eq 0 ];then |
| 2022 | |
| 2023 | # sanity checks, avoid an avalanche of errors |
| 2024 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 2025 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 2026 | P_PXY_BIN="${P_PXY%%[ ]*}" |
| 2027 | if [ ! -x "$P_SRV_BIN" ]; then |
| 2028 | echo "Command '$P_SRV_BIN' is not an executable file" |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 2029 | exit 1 |
| 2030 | fi |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 2031 | if [ ! -x "$P_CLI_BIN" ]; then |
| 2032 | echo "Command '$P_CLI_BIN' is not an executable file" |
| 2033 | exit 1 |
| 2034 | fi |
| 2035 | if [ ! -x "$P_PXY_BIN" ]; then |
| 2036 | echo "Command '$P_PXY_BIN' is not an executable file" |
| 2037 | exit 1 |
| 2038 | fi |
| 2039 | if [ "$MEMCHECK" -gt 0 ]; then |
| 2040 | if which valgrind >/dev/null 2>&1; then :; else |
| 2041 | echo "Memcheck not possible. Valgrind not found" |
| 2042 | exit 1 |
| 2043 | fi |
| 2044 | fi |
| 2045 | if which $OPENSSL >/dev/null 2>&1; then :; else |
| 2046 | echo "Command '$OPENSSL' not found" |
| 2047 | exit 1 |
| 2048 | fi |
| 2049 | |
| 2050 | # used by watchdog |
| 2051 | MAIN_PID="$$" |
| 2052 | |
| 2053 | # We use somewhat arbitrary delays for tests: |
| 2054 | # - how long do we wait for the server to start (when lsof not available)? |
| 2055 | # - how long do we allow for the client to finish? |
| 2056 | # (not to check performance, just to avoid waiting indefinitely) |
| 2057 | # Things are slower with valgrind, so give extra time here. |
| 2058 | # |
| 2059 | # Note: without lsof, there is a trade-off between the running time of this |
| 2060 | # script and the risk of spurious errors because we didn't wait long enough. |
| 2061 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 2062 | # the script, only the case where a client or server gets stuck. |
| 2063 | if [ "$MEMCHECK" -gt 0 ]; then |
| 2064 | START_DELAY=6 |
| 2065 | DOG_DELAY=60 |
| 2066 | else |
| 2067 | START_DELAY=2 |
| 2068 | DOG_DELAY=20 |
| 2069 | fi |
| 2070 | |
| 2071 | # some particular tests need more time: |
| 2072 | # - for the client, we multiply the usual watchdog limit by a factor |
| 2073 | # - for the server, we sleep for a number of seconds after the client exits |
| 2074 | # see client_need_more_time() and server_needs_more_time() |
| 2075 | CLI_DELAY_FACTOR=1 |
| 2076 | SRV_DELAY_SECONDS=0 |
| 2077 | |
| 2078 | # fix commands to use this port, force IPv4 while at it |
| 2079 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
| 2080 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 2081 | # machines that will resolve to ::1, and we don't want ipv6 here. |
| 2082 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 2083 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
| 2084 | 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"}" |
| 2085 | O_SRV="$O_SRV -accept $SRV_PORT" |
| 2086 | O_CLI="$O_CLI -connect 127.0.0.1:+SRV_PORT" |
| 2087 | G_SRV="$G_SRV -p $SRV_PORT" |
| 2088 | G_CLI="$G_CLI -p +SRV_PORT" |
| 2089 | |
| 2090 | # Newer versions of OpenSSL have a syntax to enable all "ciphers", even |
| 2091 | # low-security ones. This covers not just cipher suites but also protocol |
| 2092 | # versions. It is necessary, for example, to use (D)TLS 1.0/1.1 on |
| 2093 | # OpenSSL 1.1.1f from Ubuntu 20.04. The syntax was only introduced in |
| 2094 | # OpenSSL 1.1.0 (21e0c1d23afff48601eb93135defddae51f7e2e3) and I can't find |
| 2095 | # a way to discover it from -help, so check the openssl version. |
| 2096 | case $($OPENSSL version) in |
| 2097 | "OpenSSL 0"*|"OpenSSL 1.0"*) :;; |
| 2098 | *) |
| 2099 | O_CLI="$O_CLI -cipher ALL@SECLEVEL=0" |
| 2100 | O_SRV="$O_SRV -cipher ALL@SECLEVEL=0" |
| 2101 | ;; |
| 2102 | esac |
| 2103 | |
| 2104 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 2105 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
| 2106 | O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT" |
| 2107 | O_NEXT_SRV_EARLY_DATA="$O_NEXT_SRV_EARLY_DATA -accept $SRV_PORT" |
| 2108 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
| 2109 | O_NEXT_CLI_NO_CERT="$O_NEXT_CLI_NO_CERT -connect 127.0.0.1:+SRV_PORT" |
| 2110 | fi |
| 2111 | |
| 2112 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
| 2113 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 2114 | G_NEXT_SRV_NO_CERT="$G_NEXT_SRV_NO_CERT -p $SRV_PORT" |
| 2115 | fi |
| 2116 | |
| 2117 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
| 2118 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
| 2119 | G_NEXT_CLI_NO_CERT="$G_NEXT_CLI_NO_CERT -p +SRV_PORT localhost" |
| 2120 | fi |
| 2121 | |
| 2122 | # Allow SHA-1, because many of our test certificates use it |
| 2123 | P_SRV="$P_SRV allow_sha1=1" |
| 2124 | P_CLI="$P_CLI allow_sha1=1" |
| 2125 | |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 2126 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2127 | # Also pick a unique name for intermediate files |
| 2128 | SRV_OUT="srv_out.$$" |
| 2129 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 2130 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2131 | SESSION="session.$$" |
| 2132 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 2133 | SKIP_NEXT="NO" |
| 2134 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 2135 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 2136 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2137 | # Basic test |
| 2138 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2139 | # Checks that: |
| 2140 | # - 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] | 2141 | # - the expected parameters are selected |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2142 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2143 | requires_hash_alg SHA_512 # "signature_algorithm ext: 6" |
Gilles Peskine | cd4fe70 | 2024-09-07 19:50:17 +0200 | [diff] [blame] | 2144 | requires_any_configs_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED \ |
| 2145 | PSA_WANT_ECC_MONTGOMERY_255 |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2146 | run_test "Default, TLS 1.2" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2147 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2148 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2149 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2150 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 2151 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2152 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 2153 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2154 | -S "error" \ |
| 2155 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2156 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2157 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2158 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2159 | run_test "Default, DTLS" \ |
| 2160 | "$P_SRV dtls=1" \ |
| 2161 | "$P_CLI dtls=1" \ |
| 2162 | 0 \ |
| 2163 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 2164 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2165 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 2166 | run_test "TLS client auth: required" \ |
| 2167 | "$P_SRV auth_mode=required" \ |
| 2168 | "$P_CLI" \ |
| 2169 | 0 \ |
| 2170 | -s "Verifying peer X.509 certificate... ok" |
| 2171 | |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 2172 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2173 | "$P_SRV" \ |
| 2174 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2175 | 0 \ |
| 2176 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2177 | -c "Key size is 256" |
| 2178 | |
| 2179 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2180 | "$P_SRV" \ |
| 2181 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2182 | 0 \ |
| 2183 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2184 | -c "Key size is 128" |
| 2185 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2186 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2187 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2188 | # module does not support PSA dispatching so we need builtin support. |
| 2189 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2190 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2191 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2192 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2193 | run_test "TLS: password protected client key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2194 | "$P_SRV force_version=tls12 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2195 | "$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] | 2196 | 0 |
| 2197 | |
| 2198 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2199 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2200 | # module does not support PSA dispatching so we need builtin support. |
| 2201 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2202 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2203 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2204 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2205 | run_test "TLS: password protected server key" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2206 | "$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] | 2207 | "$P_CLI force_version=tls12" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2208 | 0 |
| 2209 | |
| 2210 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2211 | requires_config_enabled MBEDTLS_RSA_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2212 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2213 | # module does not support PSA dispatching so we need builtin support. |
| 2214 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2215 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2216 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2217 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2218 | run_test "TLS: password protected server key, two certificates" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2219 | "$P_SRV force_version=tls12\ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2220 | key_file=$DATA_FILES_PATH/server5.key.enc key_pwd=PolarSSLTest crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2221 | 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] | 2222 | "$P_CLI" \ |
| 2223 | 0 |
| 2224 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2225 | run_test "CA callback on client" \ |
| 2226 | "$P_SRV debug_level=3" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 2227 | "$P_CLI ca_callback=1 debug_level=3 " \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2228 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2229 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2230 | -S "error" \ |
| 2231 | -C "error" |
| 2232 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2233 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2234 | requires_hash_alg SHA_256 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2235 | run_test "CA callback on server" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 2236 | "$P_SRV auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2237 | "$P_CLI ca_callback=1 debug_level=3 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2238 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2239 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2240 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2241 | -s "Verifying peer X.509 certificate... ok" \ |
| 2242 | -S "error" \ |
| 2243 | -C "error" |
| 2244 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2245 | # Test using an EC opaque private key for client authentication |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2246 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2247 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2248 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2249 | run_test "Opaque key for client authentication: ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2250 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2251 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 2252 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2253 | 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] | 2254 | 0 \ |
| 2255 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2256 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2257 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2258 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2259 | -S "error" \ |
| 2260 | -C "error" |
| 2261 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2262 | # Test using a RSA opaque private key for client authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2263 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2264 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2265 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2266 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2267 | run_test "Opaque key for client authentication: ECDHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2268 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2269 | key_file=$DATA_FILES_PATH/server2.key" \ |
| 2270 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2271 | 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] | 2272 | 0 \ |
| 2273 | -c "key type: Opaque" \ |
| 2274 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2275 | -s "Verifying peer X.509 certificate... ok" \ |
| 2276 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2277 | -S "error" \ |
| 2278 | -C "error" |
| 2279 | |
| 2280 | # Test using an EC opaque private key for server authentication |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2281 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2282 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2283 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2284 | run_test "Opaque key for server authentication: ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2285 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2286 | 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] | 2287 | "$P_CLI force_version=tls12" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2288 | 0 \ |
| 2289 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2290 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2291 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2292 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2293 | -S "error" \ |
| 2294 | -C "error" |
| 2295 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2296 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2297 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2298 | run_test "Opaque key for server authentication: ECDH-" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2299 | "$P_SRV auth_mode=required key_opaque=1\ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2300 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt\ |
| 2301 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdh,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2302 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2303 | 0 \ |
| 2304 | -c "Verifying peer X.509 certificate... ok" \ |
| 2305 | -c "Ciphersuite is TLS-ECDH-" \ |
| 2306 | -s "key types: Opaque, none" \ |
| 2307 | -s "Ciphersuite is TLS-ECDH-" \ |
| 2308 | -S "error" \ |
| 2309 | -C "error" |
| 2310 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2311 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2312 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2313 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2314 | run_test "Opaque key for server authentication: invalid key: decrypt with ECC key, no async" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2315 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2316 | 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] | 2317 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2318 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2319 | 1 \ |
| 2320 | -s "key types: Opaque, none" \ |
| 2321 | -s "error" \ |
| 2322 | -c "error" \ |
| 2323 | -c "Public key type mismatch" |
| 2324 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2325 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2326 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2327 | requires_config_enabled MBEDTLS_RSA_C |
| 2328 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2329 | requires_hash_alg SHA_256 |
| 2330 | run_test "Opaque key for server authentication: invalid key: ecdh with RSA key, no async" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2331 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2332 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=ecdh,none \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2333 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2334 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2335 | 1 \ |
| 2336 | -s "key types: Opaque, none" \ |
| 2337 | -s "error" \ |
| 2338 | -c "error" \ |
| 2339 | -c "Public key type mismatch" |
| 2340 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2341 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2342 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2343 | requires_hash_alg SHA_256 |
| 2344 | run_test "Opaque key for server authentication: invalid alg: decrypt with ECC key, async" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2345 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2346 | 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] | 2347 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2348 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2349 | 1 \ |
| 2350 | -s "key types: Opaque, none" \ |
| 2351 | -s "got ciphersuites in common, but none of them usable" \ |
| 2352 | -s "error" \ |
| 2353 | -c "error" |
| 2354 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2355 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2356 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2357 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2358 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2359 | run_test "Opaque key for server authentication: invalid alg: ecdh with RSA key, async" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2360 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2361 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2362 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2363 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2364 | 1 \ |
| 2365 | -s "key types: Opaque, none" \ |
| 2366 | -s "got ciphersuites in common, but none of them usable" \ |
| 2367 | -s "error" \ |
| 2368 | -c "error" |
| 2369 | |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2370 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2371 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2372 | run_test "Opaque key for server authentication: invalid alg: ECDHE-ECDSA with ecdh" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2373 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2374 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2375 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2376 | "$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] | 2377 | 1 \ |
| 2378 | -s "key types: Opaque, none" \ |
| 2379 | -s "got ciphersuites in common, but none of them usable" \ |
| 2380 | -s "error" \ |
| 2381 | -c "error" |
| 2382 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2383 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2384 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2385 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2386 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2387 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2388 | "$P_SRV force_version=tls12 key_opaque=1 crt_file=$DATA_FILES_PATH/server7.crt \ |
| 2389 | key_file=$DATA_FILES_PATH/server7.key key_opaque_algs=ecdh,none \ |
| 2390 | 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] | 2391 | key_opaque_algs2=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2392 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2393 | 0 \ |
| 2394 | -c "Verifying peer X.509 certificate... ok" \ |
| 2395 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2396 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2397 | -s "key types: Opaque, Opaque" \ |
| 2398 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2399 | -S "error" \ |
| 2400 | -C "error" |
| 2401 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2402 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2403 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2404 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2405 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDH-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2406 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server7.crt \ |
| 2407 | key_file=$DATA_FILES_PATH/server7.key key_opaque_algs=ecdsa-sign,none \ |
| 2408 | 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] | 2409 | key_opaque_algs2=ecdh,none debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2410 | "$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] | 2411 | 0 \ |
| 2412 | -c "Verifying peer X.509 certificate... ok" \ |
| 2413 | -c "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2414 | -c "CN=Polarssl Test EC CA" \ |
| 2415 | -s "key types: Opaque, Opaque" \ |
| 2416 | -s "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2417 | -S "error" \ |
| 2418 | -C "error" |
| 2419 | |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2420 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2421 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2422 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2423 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2424 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2425 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2426 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2427 | 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] | 2428 | "$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] | 2429 | 0 \ |
| 2430 | -c "Verifying peer X.509 certificate... ok" \ |
| 2431 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2432 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2433 | -s "key types: Opaque, Opaque" \ |
| 2434 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2435 | -S "error" \ |
| 2436 | -C "error" |
| 2437 | |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2438 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2439 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2440 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2441 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2442 | run_test "TLS 1.3 opaque key: no suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2443 | "$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] | 2444 | "$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] | 2445 | 1 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2446 | -c "key type: Opaque" \ |
| 2447 | -s "key types: Opaque, Opaque" \ |
| 2448 | -c "error" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 2449 | -s "no suitable signature algorithm" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2450 | |
| 2451 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2452 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2453 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2454 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2455 | run_test "TLS 1.3 opaque key: suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2456 | "$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] | 2457 | "$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] | 2458 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2459 | -c "key type: Opaque" \ |
| 2460 | -s "key types: Opaque, Opaque" \ |
| 2461 | -C "error" \ |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2462 | -S "error" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2463 | |
| 2464 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2465 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2466 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2467 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2468 | 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] | 2469 | "$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] | 2470 | "$P_CLI debug_level=4 sig_algs=rsa_pss_rsae_sha256,rsa_pss_rsae_sha512" \ |
| 2471 | 0 \ |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2472 | -s "key types: Opaque, Opaque" \ |
| 2473 | -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \ |
| 2474 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 2475 | -C "error" \ |
| 2476 | -S "error" \ |
| 2477 | |
| 2478 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2479 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2480 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2481 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2482 | 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] | 2483 | "$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] | 2484 | "$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] | 2485 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2486 | -c "key type: Opaque" \ |
| 2487 | -s "key types: Opaque, Opaque" \ |
| 2488 | -C "error" \ |
| 2489 | -S "error" \ |
| 2490 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2491 | # Test using a RSA opaque private key for server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2492 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2493 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2494 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2495 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2496 | run_test "Opaque key for server authentication: ECDHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2497 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2498 | 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] | 2499 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2500 | 0 \ |
| 2501 | -c "Verifying peer X.509 certificate... ok" \ |
| 2502 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2503 | -s "key types: Opaque, none" \ |
| 2504 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2505 | -S "error" \ |
| 2506 | -C "error" |
| 2507 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2508 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2509 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2510 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2511 | run_test "Opaque key for server authentication: RSA-" \ |
| 2512 | "$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] | 2513 | "$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] | 2514 | 0 \ |
| 2515 | -c "Verifying peer X.509 certificate... ok" \ |
| 2516 | -c "Ciphersuite is TLS-RSA-" \ |
| 2517 | -s "key types: Opaque, Opaque" \ |
| 2518 | -s "Ciphersuite is TLS-RSA-" \ |
| 2519 | -S "error" \ |
| 2520 | -C "error" |
| 2521 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2522 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2523 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2524 | requires_hash_alg SHA_256 |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 2525 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
| 2526 | run_test "Opaque key for server authentication: ECDHE-RSA, PSS instead of PKCS1" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2527 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2528 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ |
| 2529 | "$P_CLI crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 2530 | key_file=$DATA_FILES_PATH/server2.key force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2531 | 1 \ |
| 2532 | -s "key types: Opaque, none" \ |
| 2533 | -s "got ciphersuites in common, but none of them usable" \ |
| 2534 | -s "error" \ |
| 2535 | -c "error" |
| 2536 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2537 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2538 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2539 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2540 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2541 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2542 | run_test "Opaque keys for server authentication: RSA keys with different algs" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2543 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2544 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pss,none \ |
| 2545 | crt_file2=$DATA_FILES_PATH/server4.crt \ |
| 2546 | 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] | 2547 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2548 | 0 \ |
| 2549 | -c "Verifying peer X.509 certificate... ok" \ |
| 2550 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2551 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2552 | -s "key types: Opaque, Opaque" \ |
| 2553 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2554 | -S "error" \ |
| 2555 | -C "error" |
| 2556 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2557 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2558 | requires_config_enabled MBEDTLS_RSA_C |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 2559 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2560 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2561 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 2562 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2563 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2564 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2565 | crt_file2=$DATA_FILES_PATH/server4.crt \ |
| 2566 | key_file2=$DATA_FILES_PATH/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 2567 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2568 | 0 \ |
| 2569 | -c "Verifying peer X.509 certificate... ok" \ |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 2570 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2571 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2572 | -s "key types: Opaque, Opaque" \ |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 2573 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2574 | -S "error" \ |
| 2575 | -C "error" |
| 2576 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2577 | # Test using an EC opaque private key for client/server authentication |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2578 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2579 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2580 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2581 | run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2582 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2583 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none" \ |
| 2584 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2585 | 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] | 2586 | 0 \ |
| 2587 | -c "key type: Opaque" \ |
| 2588 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2589 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2590 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2591 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2592 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2593 | -S "error" \ |
| 2594 | -C "error" |
| 2595 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2596 | # Test using a RSA opaque private key for client/server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2597 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2598 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2599 | requires_hash_alg SHA_256 |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2600 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2601 | run_test "Opaque key for client/server authentication: ECDHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2602 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2603 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
| 2604 | "$P_CLI force_version=tls12 key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2605 | 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] | 2606 | 0 \ |
| 2607 | -c "key type: Opaque" \ |
| 2608 | -c "Verifying peer X.509 certificate... ok" \ |
| 2609 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2610 | -s "key types: Opaque, none" \ |
| 2611 | -s "Verifying peer X.509 certificate... ok" \ |
| 2612 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2613 | -S "error" \ |
| 2614 | -C "error" |
| 2615 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2616 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 2617 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 2618 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 2619 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 2620 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 2621 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 2622 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 2623 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 2624 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 2625 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 2626 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 2627 | |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2628 | requires_config_enabled PSA_WANT_ECC_SECP_R1_521 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2629 | run_test_psa_force_curve "secp521r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2630 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_512 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2631 | run_test_psa_force_curve "brainpoolP512r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2632 | requires_config_enabled PSA_WANT_ECC_SECP_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2633 | run_test_psa_force_curve "secp384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2634 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2635 | run_test_psa_force_curve "brainpoolP384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2636 | requires_config_enabled PSA_WANT_ECC_SECP_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2637 | run_test_psa_force_curve "secp256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2638 | requires_config_enabled PSA_WANT_ECC_SECP_K1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2639 | run_test_psa_force_curve "secp256k1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2640 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2641 | run_test_psa_force_curve "brainpoolP256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2642 | requires_config_enabled PSA_WANT_ECC_SECP_R1_224 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2643 | run_test_psa_force_curve "secp224r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2644 | requires_config_enabled PSA_WANT_ECC_SECP_R1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2645 | run_test_psa_force_curve "secp192r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2646 | requires_config_enabled PSA_WANT_ECC_SECP_K1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2647 | run_test_psa_force_curve "secp192k1" |
| 2648 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2649 | # Test current time in ServerHello |
| 2650 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 2651 | run_test "ServerHello contains gmt_unix_time" \ |
| 2652 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2653 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2654 | 0 \ |
| 2655 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2656 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2657 | |
| 2658 | # Test for uniqueness of IVs in AEAD ciphersuites |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2659 | run_test "Unique IV in GCM" \ |
| 2660 | "$P_SRV exchanges=20 debug_level=4" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 2661 | "$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] | 2662 | 0 \ |
| 2663 | -u "IV used" \ |
| 2664 | -U "IV used" |
| 2665 | |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2666 | # Test for correctness of sent single supported algorithm |
Gilles Peskine | cd4fe70 | 2024-09-07 19:50:17 +0200 | [diff] [blame] | 2667 | requires_any_configs_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2668 | PSA_WANT_ECC_SECP_R1_256 |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2669 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2670 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Paul Elliott | 3b4ceda | 2022-11-17 12:47:10 +0000 | [diff] [blame] | 2671 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2672 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 2673 | requires_pk_alg "ECDSA" |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2674 | requires_hash_alg SHA_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2675 | run_test "Single supported algorithm sending: mbedtls client" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2676 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2677 | "$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] | 2678 | 0 \ |
| 2679 | -c "Supported Signature Algorithm found: 04 03" |
| 2680 | |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2681 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2682 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | cd4fe70 | 2024-09-07 19:50:17 +0200 | [diff] [blame] | 2683 | requires_any_configs_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2684 | PSA_WANT_ECC_SECP_R1_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2685 | requires_hash_alg SHA_256 |
| 2686 | run_test "Single supported algorithm sending: openssl client" \ |
| 2687 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2688 | "$O_CLI -cert $DATA_FILES_PATH/server6.crt \ |
| 2689 | -key $DATA_FILES_PATH/server6.key" \ |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2690 | 0 |
| 2691 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2692 | # Tests for certificate verification callback |
| 2693 | run_test "Configuration-specific CRT verification callback" \ |
| 2694 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 843a00d | 2024-08-16 09:53:41 +0200 | [diff] [blame] | 2695 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2696 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2697 | -S "error" \ |
| 2698 | -c "Verify requested for " \ |
| 2699 | -c "Use configuration-specific verification callback" \ |
| 2700 | -C "Use context-specific verification callback" \ |
| 2701 | -C "error" |
| 2702 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2703 | run_test "Context-specific CRT verification callback" \ |
| 2704 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 843a00d | 2024-08-16 09:53:41 +0200 | [diff] [blame] | 2705 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2706 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2707 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2708 | -c "Verify requested for " \ |
| 2709 | -c "Use context-specific verification callback" \ |
| 2710 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2711 | -C "error" |
| 2712 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2713 | # Tests for SHA-1 support |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2714 | requires_hash_alg SHA_1 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2715 | run_test "SHA-1 forbidden by default in server certificate" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2716 | "$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] | 2717 | "$P_CLI debug_level=2 force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2718 | 1 \ |
| 2719 | -c "The certificate is signed with an unacceptable hash" |
| 2720 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2721 | requires_hash_alg SHA_1 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2722 | run_test "SHA-1 explicitly allowed in server certificate" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2723 | "$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] | 2724 | "$P_CLI force_version=tls12 allow_sha1=1" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2725 | 0 |
| 2726 | |
| 2727 | run_test "SHA-256 allowed by default in server certificate" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2728 | "$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] | 2729 | "$P_CLI force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2730 | 0 |
| 2731 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2732 | requires_hash_alg SHA_1 |
| 2733 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2734 | run_test "SHA-1 forbidden by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2735 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2736 | "$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] | 2737 | 1 \ |
| 2738 | -s "The certificate is signed with an unacceptable hash" |
| 2739 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2740 | requires_hash_alg SHA_1 |
| 2741 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2742 | run_test "SHA-1 explicitly allowed in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2743 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=1" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2744 | "$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] | 2745 | 0 |
| 2746 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2747 | requires_config_enabled MBEDTLS_RSA_C |
| 2748 | requires_hash_alg SHA_256 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2749 | run_test "SHA-256 allowed by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2750 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2751 | "$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] | 2752 | 0 |
| 2753 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2754 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2755 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2756 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2757 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2758 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2759 | 0 \ |
| 2760 | -c "next record in same datagram" \ |
| 2761 | -s "next record in same datagram" |
| 2762 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2763 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2764 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2765 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2766 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2767 | 0 \ |
| 2768 | -s "next record in same datagram" \ |
| 2769 | -C "next record in same datagram" |
| 2770 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2771 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2772 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2773 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2774 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2775 | 0 \ |
| 2776 | -S "next record in same datagram" \ |
| 2777 | -c "next record in same datagram" |
| 2778 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2779 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2780 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2781 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2782 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2783 | 0 \ |
| 2784 | -S "next record in same datagram" \ |
| 2785 | -C "next record in same datagram" |
| 2786 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2787 | # Tests for Context serialization |
| 2788 | |
| 2789 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2790 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2791 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2792 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2793 | 0 \ |
| 2794 | -c "Deserializing connection..." \ |
| 2795 | -S "Deserializing connection..." |
| 2796 | |
| 2797 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2798 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2799 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2800 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2801 | 0 \ |
| 2802 | -c "Deserializing connection..." \ |
| 2803 | -S "Deserializing connection..." |
| 2804 | |
| 2805 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2806 | run_test "Context serialization, client serializes, GCM" \ |
| 2807 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2808 | "$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] | 2809 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2810 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2811 | -S "Deserializing connection..." |
| 2812 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2813 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2814 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2815 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2816 | run_test "Context serialization, client serializes, with CID" \ |
| 2817 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2818 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2819 | 0 \ |
| 2820 | -c "Deserializing connection..." \ |
| 2821 | -S "Deserializing connection..." |
| 2822 | |
| 2823 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2824 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2825 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2826 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2827 | 0 \ |
| 2828 | -C "Deserializing connection..." \ |
| 2829 | -s "Deserializing connection..." |
| 2830 | |
| 2831 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2832 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2833 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2834 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2835 | 0 \ |
| 2836 | -C "Deserializing connection..." \ |
| 2837 | -s "Deserializing connection..." |
| 2838 | |
| 2839 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2840 | run_test "Context serialization, server serializes, GCM" \ |
| 2841 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2842 | "$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] | 2843 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2844 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2845 | -s "Deserializing connection..." |
| 2846 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2847 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2848 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2849 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2850 | run_test "Context serialization, server serializes, with CID" \ |
| 2851 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2852 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2853 | 0 \ |
| 2854 | -C "Deserializing connection..." \ |
| 2855 | -s "Deserializing connection..." |
| 2856 | |
| 2857 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2858 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2859 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2860 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2861 | 0 \ |
| 2862 | -c "Deserializing connection..." \ |
| 2863 | -s "Deserializing connection..." |
| 2864 | |
| 2865 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2866 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2867 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2868 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2869 | 0 \ |
| 2870 | -c "Deserializing connection..." \ |
| 2871 | -s "Deserializing connection..." |
| 2872 | |
| 2873 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2874 | run_test "Context serialization, both serialize, GCM" \ |
| 2875 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2876 | "$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] | 2877 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2878 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2879 | -s "Deserializing connection..." |
| 2880 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2881 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2882 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2883 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2884 | run_test "Context serialization, both serialize, with CID" \ |
| 2885 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2886 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2887 | 0 \ |
| 2888 | -c "Deserializing connection..." \ |
| 2889 | -s "Deserializing connection..." |
| 2890 | |
| 2891 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2892 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2893 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2894 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2895 | 0 \ |
| 2896 | -c "Deserializing connection..." \ |
| 2897 | -S "Deserializing connection..." |
| 2898 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2899 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2900 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2901 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2902 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2903 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2904 | 0 \ |
| 2905 | -c "Deserializing connection..." \ |
| 2906 | -S "Deserializing connection..." |
| 2907 | |
| 2908 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2909 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2910 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2911 | "$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] | 2912 | 0 \ |
| 2913 | -c "Deserializing connection..." \ |
| 2914 | -S "Deserializing connection..." |
| 2915 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2916 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2917 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2918 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2919 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2920 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2921 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2922 | 0 \ |
| 2923 | -c "Deserializing connection..." \ |
| 2924 | -S "Deserializing connection..." |
| 2925 | |
| 2926 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2927 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2928 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2929 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2930 | 0 \ |
| 2931 | -C "Deserializing connection..." \ |
| 2932 | -s "Deserializing connection..." |
| 2933 | |
| 2934 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2935 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2936 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2937 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2938 | 0 \ |
| 2939 | -C "Deserializing connection..." \ |
| 2940 | -s "Deserializing connection..." |
| 2941 | |
| 2942 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2943 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2944 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2945 | "$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] | 2946 | 0 \ |
| 2947 | -C "Deserializing connection..." \ |
| 2948 | -s "Deserializing connection..." |
| 2949 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2950 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2951 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2952 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2953 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2954 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2955 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2956 | 0 \ |
| 2957 | -C "Deserializing connection..." \ |
| 2958 | -s "Deserializing connection..." |
| 2959 | |
| 2960 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2961 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2962 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2963 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2964 | 0 \ |
| 2965 | -c "Deserializing connection..." \ |
| 2966 | -s "Deserializing connection..." |
| 2967 | |
| 2968 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2969 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 2970 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2971 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2972 | 0 \ |
| 2973 | -c "Deserializing connection..." \ |
| 2974 | -s "Deserializing connection..." |
| 2975 | |
| 2976 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2977 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2978 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2979 | "$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] | 2980 | 0 \ |
| 2981 | -c "Deserializing connection..." \ |
| 2982 | -s "Deserializing connection..." |
| 2983 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2984 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2985 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2986 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2987 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 2988 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2989 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2990 | 0 \ |
| 2991 | -c "Deserializing connection..." \ |
| 2992 | -s "Deserializing connection..." |
| 2993 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2994 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2995 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2996 | run_test "Saving the serialized context to a file" \ |
| 2997 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 2998 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 2999 | 0 \ |
| 3000 | -s "Save serialized context to a file... ok" \ |
| 3001 | -c "Save serialized context to a file... ok" |
| 3002 | rm -f context_srv.txt |
| 3003 | rm -f context_cli.txt |
| 3004 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3005 | # Tests for DTLS Connection ID extension |
| 3006 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3007 | # So far, the CID API isn't implemented, so we can't |
| 3008 | # grep for output witnessing its use. This needs to be |
| 3009 | # changed once the CID extension is implemented. |
| 3010 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3011 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3012 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3013 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3014 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 3015 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3016 | 0 \ |
| 3017 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3018 | -s "found CID extension" \ |
| 3019 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3020 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3021 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3022 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3023 | -C "found CID extension" \ |
| 3024 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3025 | -C "Copy CIDs into SSL transform" \ |
| 3026 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3027 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3028 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3029 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3030 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3031 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3032 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 3033 | 0 \ |
| 3034 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3035 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3036 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3037 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3038 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3039 | -C "found CID extension" \ |
| 3040 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3041 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 3042 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3043 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3044 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3045 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3046 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3047 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3048 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 3049 | 0 \ |
| 3050 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3051 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3052 | -c "client hello, adding CID extension" \ |
| 3053 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3054 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3055 | -s "server hello, adding CID extension" \ |
| 3056 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3057 | -c "Use of CID extension negotiated" \ |
| 3058 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3059 | -c "Copy CIDs into SSL transform" \ |
| 3060 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3061 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3062 | -s "Use of Connection ID has been negotiated" \ |
| 3063 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3064 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3065 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3066 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3067 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3068 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3069 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 3070 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 3071 | 0 \ |
| 3072 | -c "Enable use of CID extension." \ |
| 3073 | -s "Enable use of CID extension." \ |
| 3074 | -c "client hello, adding CID extension" \ |
| 3075 | -s "found CID extension" \ |
| 3076 | -s "Use of CID extension negotiated" \ |
| 3077 | -s "server hello, adding CID extension" \ |
| 3078 | -c "found CID extension" \ |
| 3079 | -c "Use of CID extension negotiated" \ |
| 3080 | -s "Copy CIDs into SSL transform" \ |
| 3081 | -c "Copy CIDs into SSL transform" \ |
| 3082 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3083 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3084 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3085 | -c "Use of Connection ID has been negotiated" \ |
| 3086 | -c "ignoring unexpected CID" \ |
| 3087 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3088 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3089 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3090 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3091 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 3092 | -p "$P_PXY mtu=800" \ |
| 3093 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3094 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3095 | 0 \ |
| 3096 | -c "Enable use of CID extension." \ |
| 3097 | -s "Enable use of CID extension." \ |
| 3098 | -c "client hello, adding CID extension" \ |
| 3099 | -s "found CID extension" \ |
| 3100 | -s "Use of CID extension negotiated" \ |
| 3101 | -s "server hello, adding CID extension" \ |
| 3102 | -c "found CID extension" \ |
| 3103 | -c "Use of CID extension negotiated" \ |
| 3104 | -s "Copy CIDs into SSL transform" \ |
| 3105 | -c "Copy CIDs into SSL transform" \ |
| 3106 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3107 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3108 | -s "Use of Connection ID has been negotiated" \ |
| 3109 | -c "Use of Connection ID has been negotiated" |
| 3110 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3111 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3112 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3113 | 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] | 3114 | -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] | 3115 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3116 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3117 | 0 \ |
| 3118 | -c "Enable use of CID extension." \ |
| 3119 | -s "Enable use of CID extension." \ |
| 3120 | -c "client hello, adding CID extension" \ |
| 3121 | -s "found CID extension" \ |
| 3122 | -s "Use of CID extension negotiated" \ |
| 3123 | -s "server hello, adding CID extension" \ |
| 3124 | -c "found CID extension" \ |
| 3125 | -c "Use of CID extension negotiated" \ |
| 3126 | -s "Copy CIDs into SSL transform" \ |
| 3127 | -c "Copy CIDs into SSL transform" \ |
| 3128 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3129 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3130 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3131 | -c "Use of Connection ID has been negotiated" \ |
| 3132 | -c "ignoring unexpected CID" \ |
| 3133 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3134 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3135 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3136 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3137 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3138 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3139 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3140 | 0 \ |
| 3141 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3142 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3143 | -c "client hello, adding CID extension" \ |
| 3144 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3145 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3146 | -s "server hello, adding CID extension" \ |
| 3147 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3148 | -c "Use of CID extension negotiated" \ |
| 3149 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3150 | -c "Copy CIDs into SSL transform" \ |
| 3151 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3152 | -s "Peer CID (length 0 Bytes):" \ |
| 3153 | -s "Use of Connection ID has been negotiated" \ |
| 3154 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3155 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3156 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3157 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3158 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3159 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3160 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3161 | 0 \ |
| 3162 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3163 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3164 | -c "client hello, adding CID extension" \ |
| 3165 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3166 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3167 | -s "server hello, adding CID extension" \ |
| 3168 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3169 | -c "Use of CID extension negotiated" \ |
| 3170 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3171 | -c "Copy CIDs into SSL transform" \ |
| 3172 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3173 | -c "Peer CID (length 0 Bytes):" \ |
| 3174 | -s "Use of Connection ID has been negotiated" \ |
| 3175 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3176 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3177 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3178 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3179 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3180 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3181 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3182 | 0 \ |
| 3183 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3184 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3185 | -c "client hello, adding CID extension" \ |
| 3186 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3187 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3188 | -s "server hello, adding CID extension" \ |
| 3189 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3190 | -c "Use of CID extension negotiated" \ |
| 3191 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3192 | -c "Copy CIDs into SSL transform" \ |
| 3193 | -S "Use of Connection ID has been negotiated" \ |
| 3194 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3195 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3196 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3197 | 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] | 3198 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3199 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3200 | 0 \ |
| 3201 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3202 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3203 | -c "client hello, adding CID extension" \ |
| 3204 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3205 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3206 | -s "server hello, adding CID extension" \ |
| 3207 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3208 | -c "Use of CID extension negotiated" \ |
| 3209 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3210 | -c "Copy CIDs into SSL transform" \ |
| 3211 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3212 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3213 | -s "Use of Connection ID has been negotiated" \ |
| 3214 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3215 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3216 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3217 | 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] | 3218 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3219 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3220 | 0 \ |
| 3221 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3222 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3223 | -c "client hello, adding CID extension" \ |
| 3224 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3225 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3226 | -s "server hello, adding CID extension" \ |
| 3227 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3228 | -c "Use of CID extension negotiated" \ |
| 3229 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3230 | -c "Copy CIDs into SSL transform" \ |
| 3231 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3232 | -s "Peer CID (length 0 Bytes):" \ |
| 3233 | -s "Use of Connection ID has been negotiated" \ |
| 3234 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3235 | |
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, Srv CID empty, AES-128-CCM-8" \ |
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 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 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 | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3250 | -c "Copy CIDs into SSL transform" \ |
| 3251 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3252 | -c "Peer CID (length 0 Bytes):" \ |
| 3253 | -s "Use of Connection ID has been negotiated" \ |
| 3254 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3255 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3256 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3257 | 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] | 3258 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3259 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3260 | 0 \ |
| 3261 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3262 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3263 | -c "client hello, adding CID extension" \ |
| 3264 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3265 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3266 | -s "server hello, adding CID extension" \ |
| 3267 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3268 | -c "Use of CID extension negotiated" \ |
| 3269 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3270 | -c "Copy CIDs into SSL transform" \ |
| 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+Srv CID nonempty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3276 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3277 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 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 2 Bytes): de ad" \ |
| 3290 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 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, Cli CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3296 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3297 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 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 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3310 | -s "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, Srv CID empty, AES-128-CBC" \ |
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 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 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 | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3328 | -c "Copy CIDs into SSL transform" \ |
| 3329 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3330 | -c "Peer CID (length 0 Bytes):" \ |
| 3331 | -s "Use of Connection ID has been negotiated" \ |
| 3332 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3333 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3334 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3335 | 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] | 3336 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3337 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3338 | 0 \ |
| 3339 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3340 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3341 | -c "client hello, adding CID extension" \ |
| 3342 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3343 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3344 | -s "server hello, adding CID extension" \ |
| 3345 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3346 | -c "Use of CID extension negotiated" \ |
| 3347 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3348 | -c "Copy CIDs into SSL transform" \ |
| 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 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3352 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3353 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3354 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3355 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3356 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3357 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3358 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3359 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3360 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3361 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3362 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3363 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3364 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3365 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3366 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3367 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3368 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3369 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3370 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3371 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3372 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3373 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3374 | 0 \ |
| 3375 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3376 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3377 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3378 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3379 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3380 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3381 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3382 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3383 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3384 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3385 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3386 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3387 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 3388 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3389 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3390 | 0 \ |
| 3391 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3392 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3393 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3394 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3395 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3396 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3397 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3398 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3399 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3400 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3401 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3402 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3403 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3404 | -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] | 3405 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3406 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3407 | 0 \ |
| 3408 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3409 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3410 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3411 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3412 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3413 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3414 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3415 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3416 | -c "ignoring unexpected CID" \ |
| 3417 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3418 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3419 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3420 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3421 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3422 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3423 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3424 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3425 | 0 \ |
| 3426 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3427 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3428 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3429 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3430 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3431 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3432 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3433 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3434 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3435 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3436 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3437 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3438 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 3439 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3440 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3441 | 0 \ |
| 3442 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3443 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3444 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3445 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3446 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3447 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3448 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3449 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3450 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3451 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3452 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3453 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3454 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3455 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3456 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3457 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3458 | 0 \ |
| 3459 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3460 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3461 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3462 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3463 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3464 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3465 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3466 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3467 | -c "ignoring unexpected CID" \ |
| 3468 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3469 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3470 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3471 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3472 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3473 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3474 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3475 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3476 | 0 \ |
| 3477 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3478 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3479 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3480 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3481 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3482 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3483 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3485 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3486 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3487 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 3488 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3489 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3490 | 0 \ |
| 3491 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3492 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3493 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3494 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3495 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3496 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3497 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3498 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3499 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3500 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3501 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3502 | -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] | 3503 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3504 | "$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" \ |
| 3505 | 0 \ |
| 3506 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3507 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3508 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3509 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3510 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3511 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3512 | -c "ignoring unexpected CID" \ |
| 3513 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3514 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3516 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3517 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3518 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3519 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3520 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3521 | 0 \ |
| 3522 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3523 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3524 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3525 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3526 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3527 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3528 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3529 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3530 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 3531 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3532 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3533 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3534 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3535 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3536 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3537 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3538 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3539 | 0 \ |
| 3540 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3541 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3542 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3543 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3544 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3545 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3546 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3547 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3548 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 3549 | -c "ignoring unexpected CID" \ |
| 3550 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3551 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3552 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3553 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3554 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3555 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 3556 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3557 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3558 | 0 \ |
| 3559 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3560 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3561 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3562 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3563 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3564 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3565 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3566 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3567 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 3568 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3569 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3570 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3571 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3572 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3573 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3574 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3575 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3576 | 0 \ |
| 3577 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3578 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3579 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3580 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3581 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3582 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3583 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3584 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3585 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 3586 | -c "ignoring unexpected CID" \ |
| 3587 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3588 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3589 | # 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] | 3590 | # tests check that the buffer contents are reallocated when the message is |
| 3591 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3592 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3593 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3594 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3595 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 3596 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3597 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 3598 | 0 \ |
| 3599 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3600 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3601 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3602 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3603 | -s "Reallocating in_buf" \ |
| 3604 | -s "Reallocating out_buf" |
| 3605 | |
| 3606 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3607 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3608 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3609 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 3610 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3611 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 3612 | 0 \ |
| 3613 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3614 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3615 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3616 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3617 | -s "Reallocating in_buf" \ |
| 3618 | -s "Reallocating out_buf" |
| 3619 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3620 | # Tests for Encrypt-then-MAC extension |
| 3621 | |
| 3622 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3623 | "$P_SRV debug_level=3 \ |
| 3624 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3625 | "$P_CLI debug_level=3" \ |
| 3626 | 0 \ |
| 3627 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3628 | -s "found encrypt then mac extension" \ |
| 3629 | -s "server hello, adding encrypt then mac extension" \ |
| 3630 | -c "found encrypt_then_mac extension" \ |
| 3631 | -c "using encrypt then mac" \ |
| 3632 | -s "using encrypt then mac" |
| 3633 | |
| 3634 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3635 | "$P_SRV debug_level=3 etm=0 \ |
| 3636 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3637 | "$P_CLI debug_level=3 etm=1" \ |
| 3638 | 0 \ |
| 3639 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3640 | -s "found encrypt then mac extension" \ |
| 3641 | -S "server hello, adding encrypt then mac extension" \ |
| 3642 | -C "found encrypt_then_mac extension" \ |
| 3643 | -C "using encrypt then mac" \ |
| 3644 | -S "using encrypt then mac" |
| 3645 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3646 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3647 | "$P_SRV debug_level=3 etm=1 \ |
| 3648 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3649 | "$P_CLI debug_level=3 etm=1" \ |
| 3650 | 0 \ |
| 3651 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3652 | -s "found encrypt then mac extension" \ |
| 3653 | -S "server hello, adding encrypt then mac extension" \ |
| 3654 | -C "found encrypt_then_mac extension" \ |
| 3655 | -C "using encrypt then mac" \ |
| 3656 | -S "using encrypt then mac" |
| 3657 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3658 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3659 | "$P_SRV debug_level=3 etm=1 \ |
| 3660 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3661 | "$P_CLI debug_level=3 etm=0" \ |
| 3662 | 0 \ |
| 3663 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3664 | -S "found encrypt then mac extension" \ |
| 3665 | -S "server hello, adding encrypt then mac extension" \ |
| 3666 | -C "found encrypt_then_mac extension" \ |
| 3667 | -C "using encrypt then mac" \ |
| 3668 | -S "using encrypt then mac" |
| 3669 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3670 | # Tests for Extended Master Secret extension |
| 3671 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3672 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3673 | run_test "Extended Master Secret: default" \ |
| 3674 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3675 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3676 | 0 \ |
| 3677 | -c "client hello, adding extended_master_secret extension" \ |
| 3678 | -s "found extended master secret extension" \ |
| 3679 | -s "server hello, adding extended master secret extension" \ |
| 3680 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3681 | -c "session hash for extended master secret" \ |
| 3682 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3683 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3684 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3685 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3686 | "$P_SRV debug_level=3 extended_ms=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3687 | "$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] | 3688 | 0 \ |
| 3689 | -c "client hello, adding extended_master_secret extension" \ |
| 3690 | -s "found extended master secret extension" \ |
| 3691 | -S "server hello, adding extended master secret extension" \ |
| 3692 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3693 | -C "session hash for extended master secret" \ |
| 3694 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3695 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3696 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3697 | run_test "Extended Master Secret: client disabled, server enabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3698 | "$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] | 3699 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3700 | 0 \ |
| 3701 | -C "client hello, adding extended_master_secret extension" \ |
| 3702 | -S "found extended master secret extension" \ |
| 3703 | -S "server hello, adding extended master secret extension" \ |
| 3704 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3705 | -C "session hash for extended master secret" \ |
| 3706 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3707 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3708 | # Test sending and receiving empty application data records |
| 3709 | |
| 3710 | run_test "Encrypt then MAC: empty application data record" \ |
| 3711 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3712 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3713 | 0 \ |
| 3714 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3715 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3716 | -c "0 bytes written in 1 fragments" |
| 3717 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3718 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3719 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3720 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3721 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3722 | 0 \ |
| 3723 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3724 | -c "0 bytes written in 1 fragments" |
| 3725 | |
| 3726 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3727 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3728 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3729 | 0 \ |
| 3730 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3731 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3732 | -c "0 bytes written in 1 fragments" |
| 3733 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3734 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3735 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3736 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3737 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3738 | 0 \ |
| 3739 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3740 | -c "0 bytes written in 1 fragments" |
| 3741 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3742 | # Tests for CBC 1/n-1 record splitting |
| 3743 | |
| 3744 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3745 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3746 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3747 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3748 | 0 \ |
| 3749 | -s "Read from client: 123 bytes read" \ |
| 3750 | -S "Read from client: 1 bytes read" \ |
| 3751 | -S "122 bytes read" |
| 3752 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3753 | # Tests for Session Tickets |
| 3754 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3755 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3756 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3757 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3758 | "$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] | 3759 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3760 | -c "client hello, adding session ticket extension" \ |
| 3761 | -s "found session ticket extension" \ |
| 3762 | -s "server hello, adding session ticket extension" \ |
| 3763 | -c "found session_ticket extension" \ |
| 3764 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3765 | -S "session successfully restored from cache" \ |
| 3766 | -s "session successfully restored from ticket" \ |
| 3767 | -s "a session has been resumed" \ |
| 3768 | -c "a session has been resumed" |
| 3769 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3770 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3771 | run_test "Session resume using tickets: manual rotation" \ |
| 3772 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3773 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3774 | 0 \ |
| 3775 | -c "client hello, adding session ticket extension" \ |
| 3776 | -s "found session ticket extension" \ |
| 3777 | -s "server hello, adding session ticket extension" \ |
| 3778 | -c "found session_ticket extension" \ |
| 3779 | -c "parse new session ticket" \ |
| 3780 | -S "session successfully restored from cache" \ |
| 3781 | -s "session successfully restored from ticket" \ |
| 3782 | -s "a session has been resumed" \ |
| 3783 | -c "a session has been resumed" |
| 3784 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3785 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3786 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3787 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3788 | "$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] | 3789 | 0 \ |
| 3790 | -c "client hello, adding session ticket extension" \ |
| 3791 | -s "found session ticket extension" \ |
| 3792 | -s "server hello, adding session ticket extension" \ |
| 3793 | -c "found session_ticket extension" \ |
| 3794 | -c "parse new session ticket" \ |
| 3795 | -S "session successfully restored from cache" \ |
| 3796 | -s "session successfully restored from ticket" \ |
| 3797 | -s "a session has been resumed" \ |
| 3798 | -c "a session has been resumed" |
| 3799 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3800 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3801 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3802 | "$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] | 3803 | "$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] | 3804 | 0 \ |
| 3805 | -c "client hello, adding session ticket extension" \ |
| 3806 | -s "found session ticket extension" \ |
| 3807 | -s "server hello, adding session ticket extension" \ |
| 3808 | -c "found session_ticket extension" \ |
| 3809 | -c "parse new session ticket" \ |
| 3810 | -S "session successfully restored from cache" \ |
| 3811 | -S "session successfully restored from ticket" \ |
| 3812 | -S "a session has been resumed" \ |
| 3813 | -C "a session has been resumed" |
| 3814 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3815 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3816 | run_test "Session resume using tickets: session copy" \ |
| 3817 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3818 | "$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] | 3819 | 0 \ |
| 3820 | -c "client hello, adding session ticket extension" \ |
| 3821 | -s "found session ticket extension" \ |
| 3822 | -s "server hello, adding session ticket extension" \ |
| 3823 | -c "found session_ticket extension" \ |
| 3824 | -c "parse new session ticket" \ |
| 3825 | -S "session successfully restored from cache" \ |
| 3826 | -s "session successfully restored from ticket" \ |
| 3827 | -s "a session has been resumed" \ |
| 3828 | -c "a session has been resumed" |
| 3829 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3830 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3831 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3832 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3833 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3834 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3835 | 0 \ |
| 3836 | -c "client hello, adding session ticket extension" \ |
| 3837 | -c "found session_ticket extension" \ |
| 3838 | -c "parse new session ticket" \ |
| 3839 | -c "a session has been resumed" |
| 3840 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3841 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3842 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3843 | run_test "Session resume using tickets: openssl client" \ |
Gilles Peskine | 01fde2c | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 3844 | "$P_SRV force_version=tls12 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3845 | "( $O_CLI -sess_out $SESSION; \ |
| 3846 | $O_CLI -sess_in $SESSION; \ |
| 3847 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3848 | 0 \ |
| 3849 | -s "found session ticket extension" \ |
| 3850 | -s "server hello, adding session ticket extension" \ |
| 3851 | -S "session successfully restored from cache" \ |
| 3852 | -s "session successfully restored from ticket" \ |
| 3853 | -s "a session has been resumed" |
| 3854 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3855 | requires_cipher_enabled "AES" "GCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3856 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3857 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3858 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3859 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3860 | 0 \ |
| 3861 | -c "client hello, adding session ticket extension" \ |
| 3862 | -s "found session ticket extension" \ |
| 3863 | -s "server hello, adding session ticket extension" \ |
| 3864 | -c "found session_ticket extension" \ |
| 3865 | -c "parse new session ticket" \ |
| 3866 | -S "session successfully restored from cache" \ |
| 3867 | -s "session successfully restored from ticket" \ |
| 3868 | -s "a session has been resumed" \ |
| 3869 | -c "a session has been resumed" |
| 3870 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3871 | requires_cipher_enabled "AES" "GCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3872 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3873 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3874 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3875 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3876 | 0 \ |
| 3877 | -c "client hello, adding session ticket extension" \ |
| 3878 | -s "found session ticket extension" \ |
| 3879 | -s "server hello, adding session ticket extension" \ |
| 3880 | -c "found session_ticket extension" \ |
| 3881 | -c "parse new session ticket" \ |
| 3882 | -S "session successfully restored from cache" \ |
| 3883 | -s "session successfully restored from ticket" \ |
| 3884 | -s "a session has been resumed" \ |
| 3885 | -c "a session has been resumed" |
| 3886 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3887 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3888 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3889 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3890 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3891 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3892 | 0 \ |
| 3893 | -c "client hello, adding session ticket extension" \ |
| 3894 | -s "found session ticket extension" \ |
| 3895 | -s "server hello, adding session ticket extension" \ |
| 3896 | -c "found session_ticket extension" \ |
| 3897 | -c "parse new session ticket" \ |
| 3898 | -S "session successfully restored from cache" \ |
| 3899 | -s "session successfully restored from ticket" \ |
| 3900 | -s "a session has been resumed" \ |
| 3901 | -c "a session has been resumed" |
| 3902 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3903 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3904 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3905 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 3906 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3907 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3908 | 0 \ |
| 3909 | -c "client hello, adding session ticket extension" \ |
| 3910 | -s "found session ticket extension" \ |
| 3911 | -s "server hello, adding session ticket extension" \ |
| 3912 | -c "found session_ticket extension" \ |
| 3913 | -c "parse new session ticket" \ |
| 3914 | -S "session successfully restored from cache" \ |
| 3915 | -s "session successfully restored from ticket" \ |
| 3916 | -s "a session has been resumed" \ |
| 3917 | -c "a session has been resumed" |
| 3918 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3919 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3920 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3921 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 3922 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3923 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3924 | 0 \ |
| 3925 | -c "client hello, adding session ticket extension" \ |
| 3926 | -s "found session ticket extension" \ |
| 3927 | -s "server hello, adding session ticket extension" \ |
| 3928 | -c "found session_ticket extension" \ |
| 3929 | -c "parse new session ticket" \ |
| 3930 | -S "session successfully restored from cache" \ |
| 3931 | -s "session successfully restored from ticket" \ |
| 3932 | -s "a session has been resumed" \ |
| 3933 | -c "a session has been resumed" |
| 3934 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3935 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3936 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3937 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 3938 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3939 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3940 | 0 \ |
| 3941 | -c "client hello, adding session ticket extension" \ |
| 3942 | -s "found session ticket extension" \ |
| 3943 | -s "server hello, adding session ticket extension" \ |
| 3944 | -c "found session_ticket extension" \ |
| 3945 | -c "parse new session ticket" \ |
| 3946 | -S "session successfully restored from cache" \ |
| 3947 | -s "session successfully restored from ticket" \ |
| 3948 | -s "a session has been resumed" \ |
| 3949 | -c "a session has been resumed" |
| 3950 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3951 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3952 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3953 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 3954 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3955 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3956 | 0 \ |
| 3957 | -c "client hello, adding session ticket extension" \ |
| 3958 | -s "found session ticket extension" \ |
| 3959 | -s "server hello, adding session ticket extension" \ |
| 3960 | -c "found session_ticket extension" \ |
| 3961 | -c "parse new session ticket" \ |
| 3962 | -S "session successfully restored from cache" \ |
| 3963 | -s "session successfully restored from ticket" \ |
| 3964 | -s "a session has been resumed" \ |
| 3965 | -c "a session has been resumed" |
| 3966 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3967 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3968 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3969 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 3970 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3971 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3972 | 0 \ |
| 3973 | -c "client hello, adding session ticket extension" \ |
| 3974 | -s "found session ticket extension" \ |
| 3975 | -s "server hello, adding session ticket extension" \ |
| 3976 | -c "found session_ticket extension" \ |
| 3977 | -c "parse new session ticket" \ |
| 3978 | -S "session successfully restored from cache" \ |
| 3979 | -s "session successfully restored from ticket" \ |
| 3980 | -s "a session has been resumed" \ |
| 3981 | -c "a session has been resumed" |
| 3982 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 3983 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3984 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3985 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 3986 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3987 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3988 | 0 \ |
| 3989 | -c "client hello, adding session ticket extension" \ |
| 3990 | -s "found session ticket extension" \ |
| 3991 | -s "server hello, adding session ticket extension" \ |
| 3992 | -c "found session_ticket extension" \ |
| 3993 | -c "parse new session ticket" \ |
| 3994 | -S "session successfully restored from cache" \ |
| 3995 | -s "session successfully restored from ticket" \ |
| 3996 | -s "a session has been resumed" \ |
| 3997 | -c "a session has been resumed" |
| 3998 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 3999 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4000 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4001 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 4002 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4003 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4004 | 0 \ |
| 4005 | -c "client hello, adding session ticket extension" \ |
| 4006 | -s "found session ticket extension" \ |
| 4007 | -s "server hello, adding session ticket extension" \ |
| 4008 | -c "found session_ticket extension" \ |
| 4009 | -c "parse new session ticket" \ |
| 4010 | -S "session successfully restored from cache" \ |
| 4011 | -s "session successfully restored from ticket" \ |
| 4012 | -s "a session has been resumed" \ |
| 4013 | -c "a session has been resumed" |
| 4014 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4015 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4016 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4017 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 4018 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4019 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4020 | 0 \ |
| 4021 | -c "client hello, adding session ticket extension" \ |
| 4022 | -s "found session ticket extension" \ |
| 4023 | -s "server hello, adding session ticket extension" \ |
| 4024 | -c "found session_ticket extension" \ |
| 4025 | -c "parse new session ticket" \ |
| 4026 | -S "session successfully restored from cache" \ |
| 4027 | -s "session successfully restored from ticket" \ |
| 4028 | -s "a session has been resumed" \ |
| 4029 | -c "a session has been resumed" |
| 4030 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4031 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4032 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4033 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 4034 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4035 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4036 | 0 \ |
| 4037 | -c "client hello, adding session ticket extension" \ |
| 4038 | -s "found session ticket extension" \ |
| 4039 | -s "server hello, adding session ticket extension" \ |
| 4040 | -c "found session_ticket extension" \ |
| 4041 | -c "parse new session ticket" \ |
| 4042 | -S "session successfully restored from cache" \ |
| 4043 | -s "session successfully restored from ticket" \ |
| 4044 | -s "a session has been resumed" \ |
| 4045 | -c "a session has been resumed" |
| 4046 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4047 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4048 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4049 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 4050 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4051 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4052 | 0 \ |
| 4053 | -c "client hello, adding session ticket extension" \ |
| 4054 | -s "found session ticket extension" \ |
| 4055 | -s "server hello, adding session ticket extension" \ |
| 4056 | -c "found session_ticket extension" \ |
| 4057 | -c "parse new session ticket" \ |
| 4058 | -S "session successfully restored from cache" \ |
| 4059 | -s "session successfully restored from ticket" \ |
| 4060 | -s "a session has been resumed" \ |
| 4061 | -c "a session has been resumed" |
| 4062 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4063 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4064 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4065 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 4066 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4067 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4068 | 0 \ |
| 4069 | -c "client hello, adding session ticket extension" \ |
| 4070 | -s "found session ticket extension" \ |
| 4071 | -s "server hello, adding session ticket extension" \ |
| 4072 | -c "found session_ticket extension" \ |
| 4073 | -c "parse new session ticket" \ |
| 4074 | -S "session successfully restored from cache" \ |
| 4075 | -s "session successfully restored from ticket" \ |
| 4076 | -s "a session has been resumed" \ |
| 4077 | -c "a session has been resumed" |
| 4078 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4079 | requires_cipher_enabled "CHACHA20" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4080 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4081 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 4082 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4083 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4084 | 0 \ |
| 4085 | -c "client hello, adding session ticket extension" \ |
| 4086 | -s "found session ticket extension" \ |
| 4087 | -s "server hello, adding session ticket extension" \ |
| 4088 | -c "found session_ticket extension" \ |
| 4089 | -c "parse new session ticket" \ |
| 4090 | -S "session successfully restored from cache" \ |
| 4091 | -s "session successfully restored from ticket" \ |
| 4092 | -s "a session has been resumed" \ |
| 4093 | -c "a session has been resumed" |
| 4094 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4095 | # Tests for Session Tickets with DTLS |
| 4096 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4097 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4098 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4099 | run_test "Session resume using tickets, DTLS: basic" \ |
| 4100 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4101 | "$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] | 4102 | 0 \ |
| 4103 | -c "client hello, adding session ticket extension" \ |
| 4104 | -s "found session ticket extension" \ |
| 4105 | -s "server hello, adding session ticket extension" \ |
| 4106 | -c "found session_ticket extension" \ |
| 4107 | -c "parse new session ticket" \ |
| 4108 | -S "session successfully restored from cache" \ |
| 4109 | -s "session successfully restored from ticket" \ |
| 4110 | -s "a session has been resumed" \ |
| 4111 | -c "a session has been resumed" |
| 4112 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4113 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4114 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4115 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 4116 | "$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] | 4117 | "$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] | 4118 | 0 \ |
| 4119 | -c "client hello, adding session ticket extension" \ |
| 4120 | -s "found session ticket extension" \ |
| 4121 | -s "server hello, adding session ticket extension" \ |
| 4122 | -c "found session_ticket extension" \ |
| 4123 | -c "parse new session ticket" \ |
| 4124 | -S "session successfully restored from cache" \ |
| 4125 | -s "session successfully restored from ticket" \ |
| 4126 | -s "a session has been resumed" \ |
| 4127 | -c "a session has been resumed" |
| 4128 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4129 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4130 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4131 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 4132 | "$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] | 4133 | "$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] | 4134 | 0 \ |
| 4135 | -c "client hello, adding session ticket extension" \ |
| 4136 | -s "found session ticket extension" \ |
| 4137 | -s "server hello, adding session ticket extension" \ |
| 4138 | -c "found session_ticket extension" \ |
| 4139 | -c "parse new session ticket" \ |
| 4140 | -S "session successfully restored from cache" \ |
| 4141 | -S "session successfully restored from ticket" \ |
| 4142 | -S "a session has been resumed" \ |
| 4143 | -C "a session has been resumed" |
| 4144 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4145 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4146 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4147 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 4148 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4149 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1 reco_mode=0" \ |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4150 | 0 \ |
| 4151 | -c "client hello, adding session ticket extension" \ |
| 4152 | -s "found session ticket extension" \ |
| 4153 | -s "server hello, adding session ticket extension" \ |
| 4154 | -c "found session_ticket extension" \ |
| 4155 | -c "parse new session ticket" \ |
| 4156 | -S "session successfully restored from cache" \ |
| 4157 | -s "session successfully restored from ticket" \ |
| 4158 | -s "a session has been resumed" \ |
| 4159 | -c "a session has been resumed" |
| 4160 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4161 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4162 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4163 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 4164 | "$O_SRV -dtls" \ |
| 4165 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 4166 | 0 \ |
| 4167 | -c "client hello, adding session ticket extension" \ |
| 4168 | -c "found session_ticket extension" \ |
| 4169 | -c "parse new session ticket" \ |
| 4170 | -c "a session has been resumed" |
| 4171 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4172 | # 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] | 4173 | # 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] | 4174 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4175 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4176 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4177 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 4178 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4179 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4180 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4181 | rm -f $SESSION )" \ |
| 4182 | 0 \ |
| 4183 | -s "found session ticket extension" \ |
| 4184 | -s "server hello, adding session ticket extension" \ |
| 4185 | -S "session successfully restored from cache" \ |
| 4186 | -s "session successfully restored from ticket" \ |
| 4187 | -s "a session has been resumed" |
| 4188 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4189 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4190 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4191 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4192 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4193 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4194 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4195 | "$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] | 4196 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4197 | -c "client hello, adding session ticket extension" \ |
| 4198 | -s "found session ticket extension" \ |
| 4199 | -S "server hello, adding session ticket extension" \ |
| 4200 | -C "found session_ticket extension" \ |
| 4201 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4202 | -s "session successfully restored from cache" \ |
| 4203 | -S "session successfully restored from ticket" \ |
| 4204 | -s "a session has been resumed" \ |
| 4205 | -c "a session has been resumed" |
| 4206 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4207 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4208 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4209 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4210 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4211 | "$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] | 4212 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4213 | -C "client hello, adding session ticket extension" \ |
| 4214 | -S "found session ticket extension" \ |
| 4215 | -S "server hello, adding session ticket extension" \ |
| 4216 | -C "found session_ticket extension" \ |
| 4217 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4218 | -s "session successfully restored from cache" \ |
| 4219 | -S "session successfully restored from ticket" \ |
| 4220 | -s "a session has been resumed" \ |
| 4221 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4222 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4223 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4224 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4225 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4226 | "$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] | 4227 | 0 \ |
| 4228 | -S "session successfully restored from cache" \ |
| 4229 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4230 | -S "a session has been resumed" \ |
| 4231 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4232 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4233 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4234 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4235 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4236 | "$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] | 4237 | 0 \ |
| 4238 | -s "session successfully restored from cache" \ |
| 4239 | -S "session successfully restored from ticket" \ |
| 4240 | -s "a session has been resumed" \ |
| 4241 | -c "a session has been resumed" |
| 4242 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4243 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4244 | run_test "Session resume using cache: cache removed" \ |
| 4245 | "$P_SRV debug_level=3 tickets=0 cache_remove=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4246 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4247 | 0 \ |
| 4248 | -C "client hello, adding session ticket extension" \ |
| 4249 | -S "found session ticket extension" \ |
| 4250 | -S "server hello, adding session ticket extension" \ |
| 4251 | -C "found session_ticket extension" \ |
| 4252 | -C "parse new session ticket" \ |
| 4253 | -S "session successfully restored from cache" \ |
| 4254 | -S "session successfully restored from ticket" \ |
| 4255 | -S "a session has been resumed" \ |
| 4256 | -C "a session has been resumed" |
| 4257 | |
| 4258 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4259 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 4260 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4261 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4262 | "$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] | 4263 | 0 \ |
| 4264 | -s "session successfully restored from cache" \ |
| 4265 | -S "session successfully restored from ticket" \ |
| 4266 | -s "a session has been resumed" \ |
| 4267 | -c "a session has been resumed" |
| 4268 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4269 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4270 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4271 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4272 | "$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] | 4273 | 0 \ |
| 4274 | -S "session successfully restored from cache" \ |
| 4275 | -S "session successfully restored from ticket" \ |
| 4276 | -S "a session has been resumed" \ |
| 4277 | -C "a session has been resumed" |
| 4278 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4279 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4280 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4281 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4282 | "$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] | 4283 | 0 \ |
| 4284 | -s "session successfully restored from cache" \ |
| 4285 | -S "session successfully restored from ticket" \ |
| 4286 | -s "a session has been resumed" \ |
| 4287 | -c "a session has been resumed" |
| 4288 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4289 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4290 | run_test "Session resume using cache: session copy" \ |
| 4291 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4292 | "$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] | 4293 | 0 \ |
| 4294 | -s "session successfully restored from cache" \ |
| 4295 | -S "session successfully restored from ticket" \ |
| 4296 | -s "a session has been resumed" \ |
| 4297 | -c "a session has been resumed" |
| 4298 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4299 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4300 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4301 | run_test "Session resume using cache: openssl client" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4302 | "$P_SRV force_version=tls12 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 4303 | "( $O_CLI -sess_out $SESSION; \ |
| 4304 | $O_CLI -sess_in $SESSION; \ |
| 4305 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4306 | 0 \ |
| 4307 | -s "found session ticket extension" \ |
| 4308 | -S "server hello, adding session ticket extension" \ |
| 4309 | -s "session successfully restored from cache" \ |
| 4310 | -S "session successfully restored from ticket" \ |
| 4311 | -s "a session has been resumed" |
| 4312 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4313 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4314 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4315 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4316 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4317 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4318 | 0 \ |
| 4319 | -C "found session_ticket extension" \ |
| 4320 | -C "parse new session ticket" \ |
| 4321 | -c "a session has been resumed" |
| 4322 | |
Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 4323 | # Tests for Session resume and extensions |
| 4324 | |
| 4325 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4326 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 4327 | run_test "Session resume and connection ID" \ |
| 4328 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 4329 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 4330 | 0 \ |
| 4331 | -c "Enable use of CID extension." \ |
| 4332 | -s "Enable use of CID extension." \ |
| 4333 | -c "client hello, adding CID extension" \ |
| 4334 | -s "found CID extension" \ |
| 4335 | -s "Use of CID extension negotiated" \ |
| 4336 | -s "server hello, adding CID extension" \ |
| 4337 | -c "found CID extension" \ |
| 4338 | -c "Use of CID extension negotiated" \ |
| 4339 | -s "Copy CIDs into SSL transform" \ |
| 4340 | -c "Copy CIDs into SSL transform" \ |
| 4341 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 4342 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 4343 | -s "Use of Connection ID has been negotiated" \ |
| 4344 | -c "Use of Connection ID has been negotiated" |
| 4345 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4346 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 4347 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4348 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4349 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4350 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4351 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 4352 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4353 | "$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] | 4354 | 0 \ |
| 4355 | -c "client hello, adding session ticket extension" \ |
| 4356 | -s "found session ticket extension" \ |
| 4357 | -S "server hello, adding session ticket extension" \ |
| 4358 | -C "found session_ticket extension" \ |
| 4359 | -C "parse new session ticket" \ |
| 4360 | -s "session successfully restored from cache" \ |
| 4361 | -S "session successfully restored from ticket" \ |
| 4362 | -s "a session has been resumed" \ |
| 4363 | -c "a session has been resumed" |
| 4364 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4365 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4366 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4367 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4368 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 4369 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4370 | "$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] | 4371 | 0 \ |
| 4372 | -C "client hello, adding session ticket extension" \ |
| 4373 | -S "found session ticket extension" \ |
| 4374 | -S "server hello, adding session ticket extension" \ |
| 4375 | -C "found session_ticket extension" \ |
| 4376 | -C "parse new session ticket" \ |
| 4377 | -s "session successfully restored from cache" \ |
| 4378 | -S "session successfully restored from ticket" \ |
| 4379 | -s "a session has been resumed" \ |
| 4380 | -c "a session has been resumed" |
| 4381 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4382 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4383 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4384 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 4385 | "$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] | 4386 | "$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] | 4387 | 0 \ |
| 4388 | -S "session successfully restored from cache" \ |
| 4389 | -S "session successfully restored from ticket" \ |
| 4390 | -S "a session has been resumed" \ |
| 4391 | -C "a session has been resumed" |
| 4392 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4393 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4394 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4395 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 4396 | "$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] | 4397 | "$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] | 4398 | 0 \ |
| 4399 | -s "session successfully restored from cache" \ |
| 4400 | -S "session successfully restored from ticket" \ |
| 4401 | -s "a session has been resumed" \ |
| 4402 | -c "a session has been resumed" |
| 4403 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4404 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4405 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4406 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 4407 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4408 | "$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] | 4409 | 0 \ |
| 4410 | -s "session successfully restored from cache" \ |
| 4411 | -S "session successfully restored from ticket" \ |
| 4412 | -s "a session has been resumed" \ |
| 4413 | -c "a session has been resumed" |
| 4414 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4415 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4416 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4417 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 4418 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4419 | "$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] | 4420 | 0 \ |
| 4421 | -S "session successfully restored from cache" \ |
| 4422 | -S "session successfully restored from ticket" \ |
| 4423 | -S "a session has been resumed" \ |
| 4424 | -C "a session has been resumed" |
| 4425 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4426 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4427 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4428 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 4429 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4430 | "$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] | 4431 | 0 \ |
| 4432 | -s "session successfully restored from cache" \ |
| 4433 | -S "session successfully restored from ticket" \ |
| 4434 | -s "a session has been resumed" \ |
| 4435 | -c "a session has been resumed" |
| 4436 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4437 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4438 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4439 | run_test "Session resume using cache, DTLS: session copy" \ |
| 4440 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4441 | "$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] | 4442 | 0 \ |
| 4443 | -s "session successfully restored from cache" \ |
| 4444 | -S "session successfully restored from ticket" \ |
| 4445 | -s "a session has been resumed" \ |
| 4446 | -c "a session has been resumed" |
| 4447 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4448 | # 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] | 4449 | # 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] | 4450 | requires_openssl_next |
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 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4453 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4454 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 4455 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4456 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4457 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4458 | rm -f $SESSION )" \ |
| 4459 | 0 \ |
| 4460 | -s "found session ticket extension" \ |
| 4461 | -S "server hello, adding session ticket extension" \ |
| 4462 | -s "session successfully restored from cache" \ |
| 4463 | -S "session successfully restored from ticket" \ |
| 4464 | -s "a session has been resumed" |
| 4465 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4467 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4468 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 4469 | "$O_SRV -dtls" \ |
| 4470 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 4471 | 0 \ |
| 4472 | -C "found session_ticket extension" \ |
| 4473 | -C "parse new session ticket" \ |
| 4474 | -c "a session has been resumed" |
| 4475 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4476 | # Tests for Max Fragment Length extension |
| 4477 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4478 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4479 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4480 | run_test "Max fragment length: enabled, default" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4481 | "$P_SRV debug_level=3 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4482 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4483 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4484 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4485 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4486 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4487 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4488 | -C "client hello, adding max_fragment_length extension" \ |
| 4489 | -S "found max fragment length extension" \ |
| 4490 | -S "server hello, max_fragment_length extension" \ |
| 4491 | -C "found max_fragment_length extension" |
| 4492 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4493 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4495 | run_test "Max fragment length: enabled, default, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4496 | "$P_SRV debug_level=3 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4497 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4498 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4499 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4500 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4501 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4502 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4503 | -C "client hello, adding max_fragment_length extension" \ |
| 4504 | -S "found max fragment length extension" \ |
| 4505 | -S "server hello, max_fragment_length extension" \ |
| 4506 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4507 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4508 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4509 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4510 | |
| 4511 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4512 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4513 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 4514 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4515 | "$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] | 4516 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4517 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4518 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4519 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4520 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4521 | -C "client hello, adding max_fragment_length extension" \ |
| 4522 | -S "found max fragment length extension" \ |
| 4523 | -S "server hello, max_fragment_length extension" \ |
| 4524 | -C "found max_fragment_length extension" \ |
| 4525 | -c "fragment larger than.*maximum " |
| 4526 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4527 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 4528 | # (session fragment length will be 16384 regardless of mbedtls |
| 4529 | # content length configuration.) |
| 4530 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4531 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4532 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4533 | run_test "Max fragment length: disabled, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4534 | "$P_SRV debug_level=3 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4535 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4536 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4537 | -C "Maximum incoming record payload length is 16384" \ |
| 4538 | -C "Maximum outgoing record payload length is 16384" \ |
| 4539 | -S "Maximum incoming record payload length is 16384" \ |
| 4540 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4541 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4542 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4543 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4544 | |
| 4545 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4546 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4547 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4548 | "$P_SRV debug_level=3 dtls=1 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4549 | "$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] | 4550 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4551 | -C "Maximum incoming record payload length is 16384" \ |
| 4552 | -C "Maximum outgoing record payload length is 16384" \ |
| 4553 | -S "Maximum incoming record payload length is 16384" \ |
| 4554 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4555 | -c "fragment larger than.*maximum " |
| 4556 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4557 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4558 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4559 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4560 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4561 | "$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] | 4562 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4563 | -c "Maximum incoming record payload length is 4096" \ |
| 4564 | -c "Maximum outgoing record payload length is 4096" \ |
| 4565 | -s "Maximum incoming record payload length is 4096" \ |
| 4566 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4567 | -c "client hello, adding max_fragment_length extension" \ |
| 4568 | -s "found max fragment length extension" \ |
| 4569 | -s "server hello, max_fragment_length extension" \ |
| 4570 | -c "found max_fragment_length extension" |
| 4571 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4572 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4573 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4574 | run_test "Max fragment length: client 512, server 1024" \ |
| 4575 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4576 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4577 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4578 | -c "Maximum incoming record payload length is 512" \ |
| 4579 | -c "Maximum outgoing record payload length is 512" \ |
| 4580 | -s "Maximum incoming record payload length is 512" \ |
| 4581 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4582 | -c "client hello, adding max_fragment_length extension" \ |
| 4583 | -s "found max fragment length extension" \ |
| 4584 | -s "server hello, max_fragment_length extension" \ |
| 4585 | -c "found max_fragment_length extension" |
| 4586 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4587 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4588 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4589 | run_test "Max fragment length: client 512, server 2048" \ |
| 4590 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4591 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4592 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4593 | -c "Maximum incoming record payload length is 512" \ |
| 4594 | -c "Maximum outgoing record payload length is 512" \ |
| 4595 | -s "Maximum incoming record payload length is 512" \ |
| 4596 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4597 | -c "client hello, adding max_fragment_length extension" \ |
| 4598 | -s "found max fragment length extension" \ |
| 4599 | -s "server hello, max_fragment_length extension" \ |
| 4600 | -c "found max_fragment_length extension" |
| 4601 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4602 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4603 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4604 | run_test "Max fragment length: client 512, server 4096" \ |
| 4605 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4606 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4607 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4608 | -c "Maximum incoming record payload length is 512" \ |
| 4609 | -c "Maximum outgoing record payload length is 512" \ |
| 4610 | -s "Maximum incoming record payload length is 512" \ |
| 4611 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4612 | -c "client hello, adding max_fragment_length extension" \ |
| 4613 | -s "found max fragment length extension" \ |
| 4614 | -s "server hello, max_fragment_length extension" \ |
| 4615 | -c "found max_fragment_length extension" |
| 4616 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4617 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4618 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4619 | run_test "Max fragment length: client 1024, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4620 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4621 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4622 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4623 | -c "Maximum incoming record payload length is 1024" \ |
| 4624 | -c "Maximum outgoing record payload length is 1024" \ |
| 4625 | -s "Maximum incoming record payload length is 1024" \ |
| 4626 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4627 | -c "client hello, adding max_fragment_length extension" \ |
| 4628 | -s "found max fragment length extension" \ |
| 4629 | -s "server hello, max_fragment_length extension" \ |
| 4630 | -c "found max_fragment_length extension" |
| 4631 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4632 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4633 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4634 | run_test "Max fragment length: client 1024, server 2048" \ |
| 4635 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4636 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4637 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4638 | -c "Maximum incoming record payload length is 1024" \ |
| 4639 | -c "Maximum outgoing record payload length is 1024" \ |
| 4640 | -s "Maximum incoming record payload length is 1024" \ |
| 4641 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4642 | -c "client hello, adding max_fragment_length extension" \ |
| 4643 | -s "found max fragment length extension" \ |
| 4644 | -s "server hello, max_fragment_length extension" \ |
| 4645 | -c "found max_fragment_length extension" |
| 4646 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4647 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4648 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4649 | run_test "Max fragment length: client 1024, server 4096" \ |
| 4650 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4651 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4652 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4653 | -c "Maximum incoming record payload length is 1024" \ |
| 4654 | -c "Maximum outgoing record payload length is 1024" \ |
| 4655 | -s "Maximum incoming record payload length is 1024" \ |
| 4656 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4657 | -c "client hello, adding max_fragment_length extension" \ |
| 4658 | -s "found max fragment length extension" \ |
| 4659 | -s "server hello, max_fragment_length extension" \ |
| 4660 | -c "found max_fragment_length extension" |
| 4661 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4662 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4663 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4664 | run_test "Max fragment length: client 2048, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4665 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4666 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4667 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4668 | -c "Maximum incoming record payload length is 2048" \ |
| 4669 | -c "Maximum outgoing record payload length is 2048" \ |
| 4670 | -s "Maximum incoming record payload length is 2048" \ |
| 4671 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4672 | -c "client hello, adding max_fragment_length extension" \ |
| 4673 | -s "found max fragment length extension" \ |
| 4674 | -s "server hello, max_fragment_length extension" \ |
| 4675 | -c "found max_fragment_length extension" |
| 4676 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4677 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4678 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4679 | run_test "Max fragment length: client 2048, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4680 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4681 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4682 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4683 | -c "Maximum incoming record payload length is 2048" \ |
| 4684 | -c "Maximum outgoing record payload length is 2048" \ |
| 4685 | -s "Maximum incoming record payload length is 2048" \ |
| 4686 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4687 | -c "client hello, adding max_fragment_length extension" \ |
| 4688 | -s "found max fragment length extension" \ |
| 4689 | -s "server hello, max_fragment_length extension" \ |
| 4690 | -c "found max_fragment_length extension" |
| 4691 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4692 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4693 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4694 | run_test "Max fragment length: client 2048, server 4096" \ |
| 4695 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4696 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4697 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4698 | -c "Maximum incoming record payload length is 2048" \ |
| 4699 | -c "Maximum outgoing record payload length is 2048" \ |
| 4700 | -s "Maximum incoming record payload length is 2048" \ |
| 4701 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4702 | -c "client hello, adding max_fragment_length extension" \ |
| 4703 | -s "found max fragment length extension" \ |
| 4704 | -s "server hello, max_fragment_length extension" \ |
| 4705 | -c "found max_fragment_length extension" |
| 4706 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4707 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4708 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4709 | run_test "Max fragment length: client 4096, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4710 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4711 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4712 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4713 | -c "Maximum incoming record payload length is 4096" \ |
| 4714 | -c "Maximum outgoing record payload length is 4096" \ |
| 4715 | -s "Maximum incoming record payload length is 4096" \ |
| 4716 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4717 | -c "client hello, adding max_fragment_length extension" \ |
| 4718 | -s "found max fragment length extension" \ |
| 4719 | -s "server hello, max_fragment_length extension" \ |
| 4720 | -c "found max_fragment_length extension" |
| 4721 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4722 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4723 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4724 | run_test "Max fragment length: client 4096, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4725 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4726 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4727 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4728 | -c "Maximum incoming record payload length is 4096" \ |
| 4729 | -c "Maximum outgoing record payload length is 4096" \ |
| 4730 | -s "Maximum incoming record payload length is 4096" \ |
| 4731 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4732 | -c "client hello, adding max_fragment_length extension" \ |
| 4733 | -s "found max fragment length extension" \ |
| 4734 | -s "server hello, max_fragment_length extension" \ |
| 4735 | -c "found max_fragment_length extension" |
| 4736 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4737 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4738 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4739 | run_test "Max fragment length: client 4096, server 2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4740 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4741 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4742 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4743 | -c "Maximum incoming record payload length is 4096" \ |
| 4744 | -c "Maximum outgoing record payload length is 4096" \ |
| 4745 | -s "Maximum incoming record payload length is 4096" \ |
| 4746 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4747 | -c "client hello, adding max_fragment_length extension" \ |
| 4748 | -s "found max fragment length extension" \ |
| 4749 | -s "server hello, max_fragment_length extension" \ |
| 4750 | -c "found max_fragment_length extension" |
| 4751 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4752 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4753 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4754 | run_test "Max fragment length: used by server" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4755 | "$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] | 4756 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4757 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4758 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4759 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4760 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4761 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4762 | -C "client hello, adding max_fragment_length extension" \ |
| 4763 | -S "found max fragment length extension" \ |
| 4764 | -S "server hello, max_fragment_length extension" \ |
| 4765 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4766 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4767 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4768 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4769 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4770 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4771 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4772 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4773 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4774 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4775 | -c "Maximum incoming record payload length is 4096" \ |
| 4776 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4777 | -c "client hello, adding 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 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4781 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4782 | run_test "Max fragment length: client, message just fits" \ |
| 4783 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4784 | "$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] | 4785 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4786 | -c "Maximum incoming record payload length is 2048" \ |
| 4787 | -c "Maximum outgoing record payload length is 2048" \ |
| 4788 | -s "Maximum incoming record payload length is 2048" \ |
| 4789 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [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 | -c "2048 bytes written in 1 fragments" \ |
| 4795 | -s "2048 bytes read" |
| 4796 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4797 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4798 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4799 | run_test "Max fragment length: client, larger message" \ |
| 4800 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4801 | "$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] | 4802 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4803 | -c "Maximum incoming record payload length is 2048" \ |
| 4804 | -c "Maximum outgoing record payload length is 2048" \ |
| 4805 | -s "Maximum incoming record payload length is 2048" \ |
| 4806 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4807 | -c "client hello, adding max_fragment_length extension" \ |
| 4808 | -s "found max fragment length extension" \ |
| 4809 | -s "server hello, max_fragment_length extension" \ |
| 4810 | -c "found max_fragment_length extension" \ |
| 4811 | -c "2345 bytes written in 2 fragments" \ |
| 4812 | -s "2048 bytes read" \ |
| 4813 | -s "297 bytes read" |
| 4814 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4815 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4816 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4817 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4818 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4819 | "$P_SRV debug_level=3 dtls=1" \ |
| 4820 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4821 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4822 | -c "Maximum incoming record payload length is 2048" \ |
| 4823 | -c "Maximum outgoing record payload length is 2048" \ |
| 4824 | -s "Maximum incoming record payload length is 2048" \ |
| 4825 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4826 | -c "client hello, adding max_fragment_length extension" \ |
| 4827 | -s "found max fragment length extension" \ |
| 4828 | -s "server hello, max_fragment_length extension" \ |
| 4829 | -c "found max_fragment_length extension" \ |
| 4830 | -c "fragment larger than.*maximum" |
| 4831 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4832 | # Tests for Record Size Limit extension |
| 4833 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4834 | requires_gnutls_tls1_3 |
| 4835 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4836 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 4837 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4838 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4839 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4840 | 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] | 4841 | "$P_SRV debug_level=3 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4842 | "$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] | 4843 | 0 \ |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4844 | -s "RecordSizeLimit: 16385 Bytes" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4845 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4846 | -s "Maximum outgoing record payload length is 16383" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4847 | -s "bytes written in 1 fragments" |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4848 | |
| 4849 | requires_gnutls_tls1_3 |
| 4850 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4851 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 4852 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4853 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4854 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4855 | 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] | 4856 | "$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] | 4857 | "$P_CLI debug_level=4 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4858 | 0 \ |
Yanray Wang | 42017cd | 2023-11-08 11:15:23 +0800 | [diff] [blame] | 4859 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 4860 | -c "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 4861 | -c "EncryptedExtensions: record_size_limit(28) extension received." \ |
Yanray Wang | 42017cd | 2023-11-08 11:15:23 +0800 | [diff] [blame] | 4862 | -c "RecordSizeLimit: 16385 Bytes" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4863 | |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 4864 | # In the following tests, --recordsize is the value used by the G_NEXT_CLI (3.7.2) to configure the |
| 4865 | # maximum record size using gnutls_record_set_max_size() |
| 4866 | # (https://gnutls.org/reference/gnutls-gnutls.html#gnutls-record-set-max-size). |
| 4867 | # There is currently a lower limit of 512, caused by gnutls_record_set_max_size() |
| 4868 | # not respecting the "%ALLOW_SMALL_RECORDS" priority string and not using the |
| 4869 | # more recent function gnutls_record_set_max_recv_size() |
| 4870 | # (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] | 4871 | # There is currently an upper limit of 4096, caused by the cli arg parser: |
| 4872 | # 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] | 4873 | # Thus, these tests are currently limited to the value range 512-4096. |
| 4874 | # Also, the value sent in the extension will be one larger than the value |
| 4875 | # set at the command line: |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4876 | # 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] | 4877 | |
| 4878 | # 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] | 4879 | # so for 513 record size limit tests we use preshared key to avoid sending |
| 4880 | # the certificate. |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4881 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4882 | requires_gnutls_tls1_3 |
| 4883 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4884 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 4885 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4886 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4887 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4888 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 1 fragment" \ |
| 4889 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4890 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4891 | response_size=256" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4892 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4893 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4894 | 0 \ |
| 4895 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4896 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4897 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4898 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4899 | -s "Maximum outgoing record payload length is 511" \ |
| 4900 | -s "256 bytes written in 1 fragments" |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4901 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4902 | requires_gnutls_tls1_3 |
| 4903 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4904 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 4905 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4906 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4907 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4908 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 2 fragments" \ |
| 4909 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4910 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4911 | response_size=768" \ |
| 4912 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4913 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
| 4914 | 0 \ |
| 4915 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4916 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4917 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4918 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4919 | -s "Maximum outgoing record payload length is 511" \ |
| 4920 | -s "768 bytes written in 2 fragments" |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4921 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4922 | requires_gnutls_tls1_3 |
| 4923 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4924 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 4925 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4926 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4927 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4928 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 3 fragments" \ |
| 4929 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4930 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4931 | response_size=1280" \ |
| 4932 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4933 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
| 4934 | 0 \ |
| 4935 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4936 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4937 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4938 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4939 | -s "Maximum outgoing record payload length is 511" \ |
| 4940 | -s "1280 bytes written in 3 fragments" |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4941 | |
| 4942 | requires_gnutls_tls1_3 |
| 4943 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4944 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 4945 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4946 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4947 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4948 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 1 fragment" \ |
| 4949 | "$P_SRV debug_level=3 force_version=tls13 response_size=512" \ |
| 4950 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 4951 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4952 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 4953 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 4954 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4955 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4956 | -s "Maximum outgoing record payload length is 1023" \ |
| 4957 | -s "512 bytes written in 1 fragments" |
| 4958 | |
| 4959 | requires_gnutls_tls1_3 |
| 4960 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4961 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 4962 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4963 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4964 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4965 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 2 fragments" \ |
| 4966 | "$P_SRV debug_level=3 force_version=tls13 response_size=1536" \ |
| 4967 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 4968 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4969 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 4970 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 4971 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4972 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4973 | -s "Maximum outgoing record payload length is 1023" \ |
| 4974 | -s "1536 bytes written in 2 fragments" |
| 4975 | |
| 4976 | requires_gnutls_tls1_3 |
| 4977 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4978 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 4979 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4980 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4981 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4982 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 3 fragments" \ |
| 4983 | "$P_SRV debug_level=3 force_version=tls13 response_size=2560" \ |
| 4984 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 4985 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4986 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 4987 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 4988 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4989 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4990 | -s "Maximum outgoing record payload length is 1023" \ |
| 4991 | -s "2560 bytes written in 3 fragments" |
| 4992 | |
| 4993 | requires_gnutls_tls1_3 |
| 4994 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4995 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 4996 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4997 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4998 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4999 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 1 fragment" \ |
| 5000 | "$P_SRV debug_level=3 force_version=tls13 response_size=2048" \ |
| 5001 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5002 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5003 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5004 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5005 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5006 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5007 | -s "Maximum outgoing record payload length is 4095" \ |
| 5008 | -s "2048 bytes written in 1 fragments" |
| 5009 | |
| 5010 | requires_gnutls_tls1_3 |
| 5011 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5012 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5013 | requires_config_enabled 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 (4096), 2 fragments" \ |
| 5017 | "$P_SRV debug_level=3 force_version=tls13 response_size=6144" \ |
| 5018 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5019 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5020 | -s "RecordSizeLimit: 4096 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 4095" \ |
| 5025 | -s "6144 bytes written in 2 fragments" |
| 5026 | |
| 5027 | requires_gnutls_tls1_3 |
| 5028 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5029 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5030 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5031 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5032 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5033 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 3 fragments" \ |
| 5034 | "$P_SRV debug_level=3 force_version=tls13 response_size=10240" \ |
| 5035 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5036 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5037 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5038 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5039 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5040 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5041 | -s "Maximum outgoing record payload length is 4095" \ |
| 5042 | -s "10240 bytes written in 3 fragments" |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 5043 | |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5044 | requires_gnutls_tls1_3 |
| 5045 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5046 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5047 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5048 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5049 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5050 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 1 fragment" \ |
| 5051 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5052 | "$P_CLI debug_level=4 force_version=tls13 request_size=256" \ |
| 5053 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5054 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5055 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5056 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5057 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5058 | -c "Maximum outgoing record payload length is 511" \ |
| 5059 | -c "256 bytes written in 1 fragments" |
| 5060 | |
| 5061 | requires_gnutls_tls1_3 |
| 5062 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5063 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5064 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5065 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5066 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5067 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 2 fragments" \ |
| 5068 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5069 | "$P_CLI debug_level=4 force_version=tls13 request_size=768" \ |
| 5070 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5071 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5072 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5073 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5074 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5075 | -c "Maximum outgoing record payload length is 511" \ |
| 5076 | -c "768 bytes written in 2 fragments" |
| 5077 | |
| 5078 | requires_gnutls_tls1_3 |
| 5079 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5080 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5081 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5082 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5083 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5084 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 3 fragments" \ |
| 5085 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5086 | "$P_CLI debug_level=4 force_version=tls13 request_size=1280" \ |
| 5087 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5088 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5089 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5090 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5091 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5092 | -c "Maximum outgoing record payload length is 511" \ |
| 5093 | -c "1280 bytes written in 3 fragments" |
| 5094 | |
| 5095 | requires_gnutls_tls1_3 |
| 5096 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5097 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5098 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5099 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5100 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5101 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 1 fragment" \ |
| 5102 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5103 | "$P_CLI debug_level=4 force_version=tls13 request_size=512" \ |
| 5104 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5105 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5106 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5107 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5108 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5109 | -c "Maximum outgoing record payload length is 1023" \ |
| 5110 | -c "512 bytes written in 1 fragments" |
| 5111 | |
| 5112 | requires_gnutls_tls1_3 |
| 5113 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5114 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5115 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5116 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5117 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5118 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 2 fragments" \ |
| 5119 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5120 | "$P_CLI debug_level=4 force_version=tls13 request_size=1536" \ |
| 5121 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5122 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5123 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5124 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5125 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5126 | -c "Maximum outgoing record payload length is 1023" \ |
| 5127 | -c "1536 bytes written in 2 fragments" |
| 5128 | |
| 5129 | requires_gnutls_tls1_3 |
| 5130 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5131 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5132 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5133 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5134 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5135 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 3 fragments" \ |
| 5136 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5137 | "$P_CLI debug_level=4 force_version=tls13 request_size=2560" \ |
| 5138 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5139 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5140 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5141 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5142 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5143 | -c "Maximum outgoing record payload length is 1023" \ |
| 5144 | -c "2560 bytes written in 3 fragments" |
| 5145 | |
| 5146 | requires_gnutls_tls1_3 |
| 5147 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5148 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5149 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5150 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5151 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5152 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 1 fragment" \ |
| 5153 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5154 | "$P_CLI debug_level=4 force_version=tls13 request_size=2048" \ |
| 5155 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5156 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5157 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5158 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5159 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5160 | -c "Maximum outgoing record payload length is 4095" \ |
| 5161 | -c "2048 bytes written in 1 fragments" |
| 5162 | |
| 5163 | requires_gnutls_tls1_3 |
| 5164 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5165 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5166 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5167 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5168 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5169 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 2 fragments" \ |
| 5170 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5171 | "$P_CLI debug_level=4 force_version=tls13 request_size=6144" \ |
| 5172 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5173 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5174 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5175 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5176 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5177 | -c "Maximum outgoing record payload length is 4095" \ |
| 5178 | -c "6144 bytes written in 2 fragments" |
| 5179 | |
| 5180 | requires_gnutls_tls1_3 |
| 5181 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5182 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5183 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5184 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5185 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5186 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 3 fragments" \ |
| 5187 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5188 | "$P_CLI debug_level=4 force_version=tls13 request_size=10240" \ |
| 5189 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5190 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5191 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5192 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5193 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5194 | -c "Maximum outgoing record payload length is 4095" \ |
| 5195 | -c "10240 bytes written in 3 fragments" |
| 5196 | |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5197 | # TODO: For time being, we send fixed value of RecordSizeLimit defined by |
| 5198 | # MBEDTLS_SSL_IN_CONTENT_LEN. Once we support variable buffer length of |
| 5199 | # RecordSizeLimit, we need to modify value of RecordSizeLimit in below test. |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5200 | requires_config_value_equals "MBEDTLS_SSL_IN_CONTENT_LEN" 16384 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5201 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5202 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5203 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5204 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5205 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5206 | 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] | 5207 | "$P_SRV debug_level=4 force_version=tls13" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5208 | "$P_CLI debug_level=4" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5209 | 0 \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5210 | -c "Sent RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5211 | -c "RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5212 | -s "RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5213 | -s "Sent RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5214 | -s "Maximum outgoing record payload length is 16383" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5215 | -s "Maximum incoming record payload length is 16384" |
| 5216 | |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 5217 | # End of Record size limit tests |
| 5218 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5219 | # Tests for renegotiation |
| 5220 | |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5221 | # G_NEXT_SRV is used in renegotiation tests becuase of the increased |
| 5222 | # extensions limit since we exceed the limit in G_SRV when we send |
| 5223 | # TLS 1.3 extensions in the initial handshake. |
| 5224 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5225 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5226 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5227 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5228 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5229 | 0 \ |
| 5230 | -C "client hello, adding renegotiation extension" \ |
| 5231 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5232 | -S "found renegotiation extension" \ |
| 5233 | -s "server hello, secure renegotiation extension" \ |
| 5234 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5235 | -C "=> renegotiate" \ |
| 5236 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5237 | -S "write hello request" |
| 5238 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5239 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5240 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5241 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5242 | "$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] | 5243 | 0 \ |
| 5244 | -c "client hello, adding renegotiation extension" \ |
| 5245 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5246 | -s "found renegotiation extension" \ |
| 5247 | -s "server hello, secure renegotiation extension" \ |
| 5248 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5249 | -c "=> renegotiate" \ |
| 5250 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5251 | -S "write hello request" |
| 5252 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5253 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5254 | run_test "Renegotiation: server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5255 | "$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] | 5256 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5257 | 0 \ |
| 5258 | -c "client hello, adding renegotiation extension" \ |
| 5259 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5260 | -s "found renegotiation extension" \ |
| 5261 | -s "server hello, secure renegotiation extension" \ |
| 5262 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5263 | -c "=> renegotiate" \ |
| 5264 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5265 | -s "write hello request" |
| 5266 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5267 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 5268 | # 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] | 5269 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5270 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5271 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 5272 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5273 | "$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] | 5274 | 0 \ |
| 5275 | -c "client hello, adding renegotiation extension" \ |
| 5276 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5277 | -s "found renegotiation extension" \ |
| 5278 | -s "server hello, secure renegotiation extension" \ |
| 5279 | -c "found renegotiation extension" \ |
| 5280 | -c "=> renegotiate" \ |
| 5281 | -s "=> renegotiate" \ |
| 5282 | -S "write hello request" \ |
| 5283 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 5284 | |
| 5285 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 5286 | # 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] | 5287 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5288 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5289 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5290 | "$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] | 5291 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 5292 | 0 \ |
| 5293 | -c "client hello, adding renegotiation extension" \ |
| 5294 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5295 | -s "found renegotiation extension" \ |
| 5296 | -s "server hello, secure renegotiation extension" \ |
| 5297 | -c "found renegotiation extension" \ |
| 5298 | -c "=> renegotiate" \ |
| 5299 | -s "=> renegotiate" \ |
| 5300 | -s "write hello request" \ |
| 5301 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 5302 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5303 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5304 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5305 | "$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] | 5306 | "$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] | 5307 | 0 \ |
| 5308 | -c "client hello, adding renegotiation extension" \ |
| 5309 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5310 | -s "found renegotiation extension" \ |
| 5311 | -s "server hello, secure renegotiation extension" \ |
| 5312 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5313 | -c "=> renegotiate" \ |
| 5314 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5315 | -s "write hello request" |
| 5316 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5317 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5318 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 5319 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5320 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5321 | "$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] | 5322 | "$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" \ |
| 5323 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 5324 | -c "Maximum incoming record payload length is 2048" \ |
| 5325 | -c "Maximum outgoing record payload length is 2048" \ |
| 5326 | -s "Maximum incoming record payload length is 2048" \ |
| 5327 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5328 | -c "client hello, adding max_fragment_length extension" \ |
| 5329 | -s "found max fragment length extension" \ |
| 5330 | -s "server hello, max_fragment_length extension" \ |
| 5331 | -c "found max_fragment_length extension" \ |
| 5332 | -c "client hello, adding renegotiation extension" \ |
| 5333 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5334 | -s "found renegotiation extension" \ |
| 5335 | -s "server hello, secure renegotiation extension" \ |
| 5336 | -c "found renegotiation extension" \ |
| 5337 | -c "=> renegotiate" \ |
| 5338 | -s "=> renegotiate" \ |
| 5339 | -s "write hello request" |
| 5340 | |
| 5341 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5342 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5343 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5344 | "$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] | 5345 | 1 \ |
| 5346 | -c "client hello, adding renegotiation extension" \ |
| 5347 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5348 | -S "found renegotiation extension" \ |
| 5349 | -s "server hello, secure renegotiation extension" \ |
| 5350 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5351 | -c "=> renegotiate" \ |
| 5352 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5353 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 5354 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5355 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5356 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5357 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5358 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5359 | "$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] | 5360 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5361 | 0 \ |
| 5362 | -C "client hello, adding renegotiation extension" \ |
| 5363 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5364 | -S "found renegotiation extension" \ |
| 5365 | -s "server hello, secure renegotiation extension" \ |
| 5366 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5367 | -C "=> renegotiate" \ |
| 5368 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5369 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 5370 | -S "SSL - An unexpected message was received from our peer" \ |
| 5371 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5372 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5373 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5374 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5375 | "$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] | 5376 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5377 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5378 | 0 \ |
| 5379 | -C "client hello, adding renegotiation extension" \ |
| 5380 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5381 | -S "found renegotiation extension" \ |
| 5382 | -s "server hello, secure renegotiation extension" \ |
| 5383 | -c "found renegotiation extension" \ |
| 5384 | -C "=> renegotiate" \ |
| 5385 | -S "=> renegotiate" \ |
| 5386 | -s "write hello request" \ |
| 5387 | -S "SSL - An unexpected message was received from our peer" \ |
| 5388 | -S "failed" |
| 5389 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5390 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5391 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5392 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5393 | "$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] | 5394 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5395 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5396 | 0 \ |
| 5397 | -C "client hello, adding renegotiation extension" \ |
| 5398 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5399 | -S "found renegotiation extension" \ |
| 5400 | -s "server hello, secure renegotiation extension" \ |
| 5401 | -c "found renegotiation extension" \ |
| 5402 | -C "=> renegotiate" \ |
| 5403 | -S "=> renegotiate" \ |
| 5404 | -s "write hello request" \ |
| 5405 | -S "SSL - An unexpected message was received from our peer" \ |
| 5406 | -S "failed" |
| 5407 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5408 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5409 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5410 | "$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] | 5411 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5412 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5413 | 0 \ |
| 5414 | -C "client hello, adding renegotiation extension" \ |
| 5415 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5416 | -S "found renegotiation extension" \ |
| 5417 | -s "server hello, secure renegotiation extension" \ |
| 5418 | -c "found renegotiation extension" \ |
| 5419 | -C "=> renegotiate" \ |
| 5420 | -S "=> renegotiate" \ |
| 5421 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5422 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5423 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5424 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5425 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5426 | "$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] | 5427 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5428 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5429 | 0 \ |
| 5430 | -c "client hello, adding renegotiation extension" \ |
| 5431 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5432 | -s "found renegotiation extension" \ |
| 5433 | -s "server hello, secure renegotiation extension" \ |
| 5434 | -c "found renegotiation extension" \ |
| 5435 | -c "=> renegotiate" \ |
| 5436 | -s "=> renegotiate" \ |
| 5437 | -s "write hello request" \ |
| 5438 | -S "SSL - An unexpected message was received from our peer" \ |
| 5439 | -S "failed" |
| 5440 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5441 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5442 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5443 | "$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] | 5444 | "$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] | 5445 | 0 \ |
| 5446 | -C "client hello, adding renegotiation extension" \ |
| 5447 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5448 | -S "found renegotiation extension" \ |
| 5449 | -s "server hello, secure renegotiation extension" \ |
| 5450 | -c "found renegotiation extension" \ |
| 5451 | -S "record counter limit reached: renegotiate" \ |
| 5452 | -C "=> renegotiate" \ |
| 5453 | -S "=> renegotiate" \ |
| 5454 | -S "write hello request" \ |
| 5455 | -S "SSL - An unexpected message was received from our peer" \ |
| 5456 | -S "failed" |
| 5457 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 5458 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5459 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5460 | run_test "Renegotiation: periodic, just above period" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5461 | "$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] | 5462 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5463 | 0 \ |
| 5464 | -c "client hello, adding renegotiation extension" \ |
| 5465 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5466 | -s "found renegotiation extension" \ |
| 5467 | -s "server hello, secure renegotiation extension" \ |
| 5468 | -c "found renegotiation extension" \ |
| 5469 | -s "record counter limit reached: renegotiate" \ |
| 5470 | -c "=> renegotiate" \ |
| 5471 | -s "=> renegotiate" \ |
| 5472 | -s "write hello request" \ |
| 5473 | -S "SSL - An unexpected message was received from our peer" \ |
| 5474 | -S "failed" |
| 5475 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5476 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5477 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5478 | "$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] | 5479 | "$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] | 5480 | 0 \ |
| 5481 | -c "client hello, adding renegotiation extension" \ |
| 5482 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5483 | -s "found renegotiation extension" \ |
| 5484 | -s "server hello, secure renegotiation extension" \ |
| 5485 | -c "found renegotiation extension" \ |
| 5486 | -s "record counter limit reached: renegotiate" \ |
| 5487 | -c "=> renegotiate" \ |
| 5488 | -s "=> renegotiate" \ |
| 5489 | -s "write hello request" \ |
| 5490 | -S "SSL - An unexpected message was received from our peer" \ |
| 5491 | -S "failed" |
| 5492 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5493 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5494 | run_test "Renegotiation: periodic, above period, disabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5495 | "$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] | 5496 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 5497 | 0 \ |
| 5498 | -C "client hello, adding renegotiation extension" \ |
| 5499 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5500 | -S "found renegotiation extension" \ |
| 5501 | -s "server hello, secure renegotiation extension" \ |
| 5502 | -c "found renegotiation extension" \ |
| 5503 | -S "record counter limit reached: renegotiate" \ |
| 5504 | -C "=> renegotiate" \ |
| 5505 | -S "=> renegotiate" \ |
| 5506 | -S "write hello request" \ |
| 5507 | -S "SSL - An unexpected message was received from our peer" \ |
| 5508 | -S "failed" |
| 5509 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5510 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5511 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5512 | "$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] | 5513 | "$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] | 5514 | 0 \ |
| 5515 | -c "client hello, adding renegotiation extension" \ |
| 5516 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5517 | -s "found renegotiation extension" \ |
| 5518 | -s "server hello, secure renegotiation extension" \ |
| 5519 | -c "found renegotiation extension" \ |
| 5520 | -c "=> renegotiate" \ |
| 5521 | -s "=> renegotiate" \ |
| 5522 | -S "write hello request" |
| 5523 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5524 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5525 | run_test "Renegotiation: nbio, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5526 | "$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] | 5527 | "$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] | 5528 | 0 \ |
| 5529 | -c "client hello, adding renegotiation extension" \ |
| 5530 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5531 | -s "found renegotiation extension" \ |
| 5532 | -s "server hello, secure renegotiation extension" \ |
| 5533 | -c "found renegotiation extension" \ |
| 5534 | -c "=> renegotiate" \ |
| 5535 | -s "=> renegotiate" \ |
| 5536 | -s "write hello request" |
| 5537 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5538 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5539 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5540 | run_test "Renegotiation: openssl server, client-initiated" \ |
Gilles Peskine | 56ee69d | 2024-09-06 13:52:14 +0200 | [diff] [blame] | 5541 | "$O_SRV -www $OPENSSL_S_SERVER_CLIENT_RENEGOTIATION -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5542 | "$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] | 5543 | 0 \ |
| 5544 | -c "client hello, adding renegotiation extension" \ |
| 5545 | -c "found renegotiation extension" \ |
| 5546 | -c "=> renegotiate" \ |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5547 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5548 | -C "error" \ |
| 5549 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5550 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5551 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5552 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5553 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5554 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5555 | "$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] | 5556 | "$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] | 5557 | 0 \ |
| 5558 | -c "client hello, adding renegotiation extension" \ |
| 5559 | -c "found renegotiation extension" \ |
| 5560 | -c "=> renegotiate" \ |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5561 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5562 | -C "error" \ |
| 5563 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5564 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5565 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5566 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5567 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5568 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5569 | "$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] | 5570 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5571 | 1 \ |
| 5572 | -c "client hello, adding renegotiation extension" \ |
| 5573 | -C "found renegotiation extension" \ |
| 5574 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5575 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5576 | -c "error" \ |
| 5577 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5578 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5579 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5580 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5581 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5582 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5583 | "$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] | 5584 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5585 | allow_legacy=0" \ |
| 5586 | 1 \ |
| 5587 | -c "client hello, adding renegotiation extension" \ |
| 5588 | -C "found renegotiation extension" \ |
| 5589 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5590 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5591 | -c "error" \ |
| 5592 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5593 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5594 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5595 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5596 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5597 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5598 | "$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] | 5599 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5600 | allow_legacy=1" \ |
| 5601 | 0 \ |
| 5602 | -c "client hello, adding renegotiation extension" \ |
| 5603 | -C "found renegotiation extension" \ |
| 5604 | -c "=> renegotiate" \ |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5605 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5606 | -C "error" \ |
| 5607 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5608 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5609 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5610 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 5611 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 5612 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 5613 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5614 | 0 \ |
| 5615 | -c "client hello, adding renegotiation extension" \ |
| 5616 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5617 | -s "found renegotiation extension" \ |
| 5618 | -s "server hello, secure renegotiation extension" \ |
| 5619 | -c "found renegotiation extension" \ |
| 5620 | -c "=> renegotiate" \ |
| 5621 | -s "=> renegotiate" \ |
| 5622 | -S "write hello request" |
| 5623 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5624 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5625 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5626 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 5627 | "$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] | 5628 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 5629 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5630 | 0 \ |
| 5631 | -c "client hello, adding renegotiation extension" \ |
| 5632 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5633 | -s "found renegotiation extension" \ |
| 5634 | -s "server hello, secure renegotiation extension" \ |
| 5635 | -c "found renegotiation extension" \ |
| 5636 | -c "=> renegotiate" \ |
| 5637 | -s "=> renegotiate" \ |
| 5638 | -s "write hello request" |
| 5639 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5640 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5641 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5642 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 5643 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 5644 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 5645 | 0 \ |
| 5646 | -c "client hello, adding renegotiation extension" \ |
| 5647 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5648 | -s "found renegotiation extension" \ |
| 5649 | -s "server hello, secure renegotiation extension" \ |
| 5650 | -s "record counter limit reached: renegotiate" \ |
| 5651 | -c "=> renegotiate" \ |
| 5652 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5653 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5654 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5655 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5656 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5657 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5658 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5659 | "$G_NEXT_SRV -u --mtu 4096" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5660 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5661 | 0 \ |
| 5662 | -c "client hello, adding renegotiation extension" \ |
| 5663 | -c "found renegotiation extension" \ |
| 5664 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5665 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5666 | -C "error" \ |
| 5667 | -s "Extra-header:" |
| 5668 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5669 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5670 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5671 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5672 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5673 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5674 | run_test "Renego ext: gnutls server strict, client default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5675 | "$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] | 5676 | "$P_CLI debug_level=3" \ |
| 5677 | 0 \ |
| 5678 | -c "found renegotiation extension" \ |
| 5679 | -C "error" \ |
| 5680 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5681 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5682 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5683 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5684 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5685 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5686 | "$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] | 5687 | "$P_CLI debug_level=3" \ |
| 5688 | 0 \ |
| 5689 | -C "found renegotiation extension" \ |
| 5690 | -C "error" \ |
| 5691 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5692 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5693 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5694 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5695 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5696 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5697 | "$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] | 5698 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 5699 | 1 \ |
| 5700 | -C "found renegotiation extension" \ |
| 5701 | -c "error" \ |
| 5702 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5703 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5704 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5705 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5706 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5707 | run_test "Renego ext: gnutls client strict, server default" \ |
| 5708 | "$P_SRV debug_level=3" \ |
Gilles Peskine | 01fde2c | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5709 | "$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] | 5710 | 0 \ |
| 5711 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5712 | -s "server hello, secure renegotiation extension" |
| 5713 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5714 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5715 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5716 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5717 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 5718 | "$P_SRV debug_level=3" \ |
Gilles Peskine | 01fde2c | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5719 | "$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] | 5720 | 0 \ |
| 5721 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5722 | -S "server hello, secure renegotiation extension" |
| 5723 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5724 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5725 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5726 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5727 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 5728 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Gilles Peskine | 01fde2c | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5729 | "$G_CLI --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5730 | 1 \ |
| 5731 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5732 | -S "server hello, secure renegotiation extension" |
| 5733 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5734 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 5735 | |
| 5736 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5737 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5738 | run_test "DER format: no trailing bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5739 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der0.crt \ |
| 5740 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5741 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5742 | 0 \ |
| 5743 | -c "Handshake was completed" \ |
| 5744 | |
| 5745 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5746 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5747 | run_test "DER format: with a trailing zero byte" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5748 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der1a.crt \ |
| 5749 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5750 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5751 | 0 \ |
| 5752 | -c "Handshake was completed" \ |
| 5753 | |
| 5754 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5755 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5756 | run_test "DER format: with a trailing random byte" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5757 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der1b.crt \ |
| 5758 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5759 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5760 | 0 \ |
| 5761 | -c "Handshake was completed" \ |
| 5762 | |
| 5763 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5764 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5765 | run_test "DER format: with 2 trailing random bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5766 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der2.crt \ |
| 5767 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5768 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5769 | 0 \ |
| 5770 | -c "Handshake was completed" \ |
| 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: with 4 trailing random bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5775 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der4.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 8 trailing random bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5784 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der8.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 9 trailing random bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5793 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der9.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 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5799 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 5800 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5801 | |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5802 | # The next 4 cases test the 3 auth modes with a badly signed server cert. |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5803 | run_test "Authentication: server badcert, client required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5804 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5805 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5806 | "$P_CLI debug_level=3 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5807 | 1 \ |
| 5808 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5809 | -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] | 5810 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5811 | -c "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5812 | -c "X509 - Certificate verification failed" |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5813 | # MBEDTLS_X509_BADCERT_NOT_TRUSTED -> MBEDTLS_SSL_ALERT_MSG_UNKNOWN_CA |
| 5814 | # We don't check that the server receives the alert because it might |
| 5815 | # detect that its write end of the connection is closed and abort |
| 5816 | # before reading the alert message. |
| 5817 | |
| 5818 | run_test "Authentication: server badcert, client required (1.2)" \ |
| 5819 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5820 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 5821 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=required" \ |
| 5822 | 1 \ |
| 5823 | -c "x509_verify_cert() returned" \ |
| 5824 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5825 | -c "! mbedtls_ssl_handshake returned" \ |
| 5826 | -c "send alert level=2 message=48" \ |
| 5827 | -c "X509 - Certificate verification failed" |
| 5828 | # 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] | 5829 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5830 | run_test "Authentication: server badcert, client optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5831 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5832 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 58ab9ba | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 5833 | "$P_CLI force_version=tls13 debug_level=3 auth_mode=optional" \ |
| 5834 | 0 \ |
| 5835 | -c "x509_verify_cert() returned" \ |
| 5836 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5837 | -C "! mbedtls_ssl_handshake returned" \ |
| 5838 | -C "send alert level=2 message=48" \ |
| 5839 | -C "X509 - Certificate verification failed" |
| 5840 | |
| 5841 | run_test "Authentication: server badcert, client optional (1.2)" \ |
| 5842 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5843 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5844 | "$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] | 5845 | 0 \ |
| 5846 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5847 | -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] | 5848 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5849 | -C "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5850 | -C "X509 - Certificate verification failed" |
| 5851 | |
Manuel Pégourié-Gonnard | 946d14a | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 5852 | run_test "Authentication: server badcert, client none" \ |
| 5853 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5854 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 6901504 | 2024-08-14 10:44:02 +0200 | [diff] [blame] | 5855 | "$P_CLI debug_level=3 auth_mode=none" \ |
| 5856 | 0 \ |
| 5857 | -C "x509_verify_cert() returned" \ |
| 5858 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5859 | -C "! mbedtls_ssl_handshake returned" \ |
| 5860 | -C "send alert level=2 message=48" \ |
| 5861 | -C "X509 - Certificate verification failed" |
| 5862 | |
| 5863 | run_test "Authentication: server badcert, client none (1.2)" \ |
| 5864 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5865 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5866 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 946d14a | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 5867 | 0 \ |
| 5868 | -C "x509_verify_cert() returned" \ |
| 5869 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5870 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5871 | -C "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 946d14a | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 5872 | -C "X509 - Certificate verification failed" |
| 5873 | |
Manuel Pégourié-Gonnard | 18dd213 | 2024-08-14 10:34:53 +0200 | [diff] [blame] | 5874 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 5875 | "$P_SRV" \ |
| 5876 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5877 | 1 \ |
| 5878 | -c "x509_verify_cert() returned" \ |
| 5879 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5880 | -c "! Certificate verification flags"\ |
| 5881 | -c "! mbedtls_ssl_handshake returned" \ |
| 5882 | -c "SSL - No CA Chain is set, but required to operate" |
| 5883 | |
| 5884 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 5885 | run_test "Authentication: server goodcert, client required, no trusted CA (1.2)" \ |
| 5886 | "$P_SRV force_version=tls12" \ |
| 5887 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5888 | 1 \ |
| 5889 | -c "x509_verify_cert() returned" \ |
| 5890 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5891 | -c "! Certificate verification flags"\ |
| 5892 | -c "! mbedtls_ssl_handshake returned" \ |
| 5893 | -c "SSL - No CA Chain is set, but required to operate" |
Manuel Pégourié-Gonnard | 58ab9ba | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 5894 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5895 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 5896 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | 58ab9ba | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 5897 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 5898 | 0 \ |
| 5899 | -c "x509_verify_cert() returned" \ |
| 5900 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5901 | -c "! Certificate verification flags"\ |
| 5902 | -C "! mbedtls_ssl_handshake returned" \ |
| 5903 | -C "X509 - Certificate verification failed" \ |
| 5904 | -C "SSL - No CA Chain is set, but required to operate" |
| 5905 | |
| 5906 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 5907 | run_test "Authentication: server goodcert, client optional, no trusted CA (1.2)" \ |
| 5908 | "$P_SRV" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5909 | "$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] | 5910 | 0 \ |
| 5911 | -c "x509_verify_cert() returned" \ |
| 5912 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5913 | -c "! Certificate verification flags"\ |
| 5914 | -C "! mbedtls_ssl_handshake returned" \ |
| 5915 | -C "X509 - Certificate verification failed" \ |
| 5916 | -C "SSL - No CA Chain is set, but required to operate" |
| 5917 | |
Manuel Pégourié-Gonnard | 6901504 | 2024-08-14 10:44:02 +0200 | [diff] [blame] | 5918 | run_test "Authentication: server goodcert, client none, no trusted CA" \ |
| 5919 | "$P_SRV" \ |
| 5920 | "$P_CLI debug_level=3 auth_mode=none ca_file=none ca_path=none" \ |
| 5921 | 0 \ |
| 5922 | -C "x509_verify_cert() returned" \ |
| 5923 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5924 | -C "! Certificate verification flags"\ |
| 5925 | -C "! mbedtls_ssl_handshake returned" \ |
| 5926 | -C "X509 - Certificate verification failed" \ |
| 5927 | -C "SSL - No CA Chain is set, but required to operate" |
| 5928 | |
| 5929 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 5930 | run_test "Authentication: server goodcert, client none, no trusted CA (1.2)" \ |
| 5931 | "$P_SRV" \ |
| 5932 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=none ca_file=none ca_path=none" \ |
| 5933 | 0 \ |
| 5934 | -C "x509_verify_cert() returned" \ |
| 5935 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5936 | -C "! Certificate verification flags"\ |
| 5937 | -C "! mbedtls_ssl_handshake returned" \ |
| 5938 | -C "X509 - Certificate verification failed" \ |
| 5939 | -C "SSL - No CA Chain is set, but required to operate" |
Manuel Pégourié-Gonnard | a6397f0 | 2024-08-05 11:10:47 +0200 | [diff] [blame] | 5940 | |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 5941 | # The next few tests check what happens if the server has a valid certificate |
| 5942 | # that does not match its name (impersonation). |
| 5943 | |
| 5944 | run_test "Authentication: hostname match, client required" \ |
| 5945 | "$P_SRV" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 5946 | "$P_CLI auth_mode=required server_name=localhost debug_level=2" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 5947 | 0 \ |
| 5948 | -C "does not match with the expected CN" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 5949 | -C "Certificate verification without having set hostname" \ |
| 5950 | -C "Certificate verification without CN verification" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 5951 | -C "x509_verify_cert() returned -" \ |
| 5952 | -C "! mbedtls_ssl_handshake returned" \ |
| 5953 | -C "X509 - Certificate verification failed" |
| 5954 | |
| 5955 | run_test "Authentication: hostname mismatch (wrong), client required" \ |
| 5956 | "$P_SRV" \ |
| 5957 | "$P_CLI auth_mode=required server_name=wrong-name debug_level=1" \ |
| 5958 | 1 \ |
| 5959 | -c "does not match with the expected CN" \ |
| 5960 | -c "x509_verify_cert() returned -" \ |
| 5961 | -c "! mbedtls_ssl_handshake returned" \ |
| 5962 | -c "X509 - Certificate verification failed" |
| 5963 | |
| 5964 | run_test "Authentication: hostname mismatch (empty), client required" \ |
| 5965 | "$P_SRV" \ |
| 5966 | "$P_CLI auth_mode=required server_name= debug_level=1" \ |
| 5967 | 1 \ |
| 5968 | -c "does not match with the expected CN" \ |
| 5969 | -c "x509_verify_cert() returned -" \ |
| 5970 | -c "! mbedtls_ssl_handshake returned" \ |
| 5971 | -c "X509 - Certificate verification failed" |
| 5972 | |
| 5973 | run_test "Authentication: hostname mismatch (truncated), client required" \ |
| 5974 | "$P_SRV" \ |
| 5975 | "$P_CLI auth_mode=required server_name=localhos debug_level=1" \ |
| 5976 | 1 \ |
| 5977 | -c "does not match with the expected CN" \ |
| 5978 | -c "x509_verify_cert() returned -" \ |
| 5979 | -c "! mbedtls_ssl_handshake returned" \ |
| 5980 | -c "X509 - Certificate verification failed" |
| 5981 | |
| 5982 | run_test "Authentication: hostname mismatch (last char), client required" \ |
| 5983 | "$P_SRV" \ |
| 5984 | "$P_CLI auth_mode=required server_name=localhoss debug_level=1" \ |
| 5985 | 1 \ |
| 5986 | -c "does not match with the expected CN" \ |
| 5987 | -c "x509_verify_cert() returned -" \ |
| 5988 | -c "! mbedtls_ssl_handshake returned" \ |
| 5989 | -c "X509 - Certificate verification failed" |
| 5990 | |
| 5991 | run_test "Authentication: hostname mismatch (trailing), client required" \ |
| 5992 | "$P_SRV" \ |
| 5993 | "$P_CLI auth_mode=required server_name=localhostt debug_level=1" \ |
| 5994 | 1 \ |
| 5995 | -c "does not match with the expected CN" \ |
| 5996 | -c "x509_verify_cert() returned -" \ |
| 5997 | -c "! mbedtls_ssl_handshake returned" \ |
| 5998 | -c "X509 - Certificate verification failed" |
| 5999 | |
| 6000 | run_test "Authentication: hostname mismatch, client optional" \ |
| 6001 | "$P_SRV" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6002 | "$P_CLI auth_mode=optional server_name=wrong-name debug_level=2" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6003 | 0 \ |
| 6004 | -c "does not match with the expected CN" \ |
| 6005 | -c "x509_verify_cert() returned -" \ |
| 6006 | -C "X509 - Certificate verification failed" |
| 6007 | |
| 6008 | run_test "Authentication: hostname mismatch, client none" \ |
| 6009 | "$P_SRV" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6010 | "$P_CLI auth_mode=none server_name=wrong-name debug_level=2" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6011 | 0 \ |
| 6012 | -C "does not match with the expected CN" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6013 | -C "Certificate verification without having set hostname" \ |
| 6014 | -C "Certificate verification without CN verification" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6015 | -C "x509_verify_cert() returned -" \ |
| 6016 | -C "X509 - Certificate verification failed" |
| 6017 | |
| 6018 | run_test "Authentication: hostname null, client required" \ |
| 6019 | "$P_SRV" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6020 | "$P_CLI auth_mode=required set_hostname=NULL debug_level=2" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6021 | 0 \ |
| 6022 | -C "does not match with the expected CN" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6023 | -C "Certificate verification without having set hostname" \ |
| 6024 | -c "Certificate verification without CN verification" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6025 | -C "x509_verify_cert() returned -" \ |
| 6026 | -C "! mbedtls_ssl_handshake returned" \ |
| 6027 | -C "X509 - Certificate verification failed" |
| 6028 | |
| 6029 | run_test "Authentication: hostname null, client optional" \ |
| 6030 | "$P_SRV" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6031 | "$P_CLI auth_mode=optional set_hostname=NULL debug_level=2" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6032 | 0 \ |
| 6033 | -C "does not match with the expected CN" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6034 | -C "Certificate verification without having set hostname" \ |
| 6035 | -c "Certificate verification without CN verification" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6036 | -C "x509_verify_cert() returned -" \ |
| 6037 | -C "X509 - Certificate verification failed" |
| 6038 | |
| 6039 | run_test "Authentication: hostname null, client none" \ |
| 6040 | "$P_SRV" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6041 | "$P_CLI auth_mode=none set_hostname=NULL debug_level=2" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6042 | 0 \ |
| 6043 | -C "does not match with the expected CN" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6044 | -C "Certificate verification without having set hostname" \ |
| 6045 | -C "Certificate verification without CN verification" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6046 | -C "x509_verify_cert() returned -" \ |
| 6047 | -C "X509 - Certificate verification failed" |
| 6048 | |
| 6049 | run_test "Authentication: hostname unset, client required" \ |
| 6050 | "$P_SRV" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6051 | "$P_CLI auth_mode=required set_hostname=no debug_level=2" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6052 | 0 \ |
| 6053 | -C "does not match with the expected CN" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6054 | -c "Certificate verification without having set hostname" \ |
| 6055 | -c "Certificate verification without CN verification" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6056 | -C "x509_verify_cert() returned -" \ |
| 6057 | -C "! mbedtls_ssl_handshake returned" \ |
| 6058 | -C "X509 - Certificate verification failed" |
| 6059 | |
| 6060 | run_test "Authentication: hostname unset, client optional" \ |
| 6061 | "$P_SRV" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6062 | "$P_CLI auth_mode=optional set_hostname=no debug_level=2" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6063 | 0 \ |
| 6064 | -C "does not match with the expected CN" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6065 | -c "Certificate verification without having set hostname" \ |
| 6066 | -c "Certificate verification without CN verification" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6067 | -C "x509_verify_cert() returned -" \ |
| 6068 | -C "X509 - Certificate verification failed" |
| 6069 | |
| 6070 | run_test "Authentication: hostname unset, client none" \ |
| 6071 | "$P_SRV" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6072 | "$P_CLI auth_mode=none set_hostname=no debug_level=2" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6073 | 0 \ |
| 6074 | -C "does not match with the expected CN" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6075 | -C "Certificate verification without having set hostname" \ |
| 6076 | -C "Certificate verification without CN verification" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6077 | -C "x509_verify_cert() returned -" \ |
| 6078 | -C "X509 - Certificate verification failed" |
| 6079 | |
| 6080 | run_test "Authentication: hostname unset, client default, server picks cert, 1.2" \ |
| 6081 | "$P_SRV force_version=tls12 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6082 | "$P_CLI psk=73776f726466697368 psk_identity=foo set_hostname=no debug_level=2" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6083 | 0 \ |
| 6084 | -C "does not match with the expected CN" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6085 | -c "Certificate verification without having set hostname" \ |
| 6086 | -c "Certificate verification without CN verification" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6087 | -C "x509_verify_cert() returned -" \ |
| 6088 | -C "X509 - Certificate verification failed" |
| 6089 | |
| 6090 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6091 | run_test "Authentication: hostname unset, client default, server picks cert, 1.3" \ |
| 6092 | "$P_SRV force_version=tls13 tls13_kex_modes=ephemeral" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6093 | "$P_CLI psk=73776f726466697368 psk_identity=foo set_hostname=no debug_level=2" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6094 | 0 \ |
| 6095 | -C "does not match with the expected CN" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6096 | -c "Certificate verification without having set hostname" \ |
| 6097 | -c "Certificate verification without CN verification" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6098 | -C "x509_verify_cert() returned -" \ |
| 6099 | -C "X509 - Certificate verification failed" |
| 6100 | |
| 6101 | run_test "Authentication: hostname unset, client default, server picks PSK, 1.2" \ |
| 6102 | "$P_SRV force_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=73776f726466697368 psk_identity=foo" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6103 | "$P_CLI psk=73776f726466697368 psk_identity=foo set_hostname=no debug_level=2" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6104 | 0 \ |
| 6105 | -C "does not match with the expected CN" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6106 | -C "Certificate verification without having set hostname" \ |
| 6107 | -C "Certificate verification without CN verification" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6108 | -C "x509_verify_cert() returned -" \ |
| 6109 | -C "X509 - Certificate verification failed" |
| 6110 | |
| 6111 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 6112 | run_test "Authentication: hostname unset, client default, server picks PSK, 1.3" \ |
| 6113 | "$P_SRV force_version=tls13 tls13_kex_modes=psk psk=73776f726466697368 psk_identity=foo" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6114 | "$P_CLI psk=73776f726466697368 psk_identity=foo set_hostname=no debug_level=2" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6115 | 0 \ |
| 6116 | -C "does not match with the expected CN" \ |
Gilles Peskine | 434016e | 2025-02-20 18:49:59 +0100 | [diff] [blame^] | 6117 | -C "Certificate verification without having set hostname" \ |
| 6118 | -C "Certificate verification without CN verification" \ |
Gilles Peskine | e5054e4 | 2025-02-12 21:50:53 +0100 | [diff] [blame] | 6119 | -C "x509_verify_cert() returned -" \ |
| 6120 | -C "X509 - Certificate verification failed" |
| 6121 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 6122 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 6123 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 6124 | # the client informs the server about the supported curves - it does, though, in the |
| 6125 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 6126 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 6127 | # different means to have the server ignoring the client's supported curve list. |
| 6128 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 6129 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6130 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6131 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6132 | "$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] | 6133 | 1 \ |
| 6134 | -c "bad certificate (EC key curve)"\ |
| 6135 | -c "! Certificate verification flags"\ |
| 6136 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 6137 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 6138 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6139 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6140 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6141 | "$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] | 6142 | 1 \ |
| 6143 | -c "bad certificate (EC key curve)"\ |
| 6144 | -c "! Certificate verification flags"\ |
| 6145 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 6146 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6147 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6148 | run_test "Authentication: client SHA256, server required" \ |
| 6149 | "$P_SRV auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6150 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6151 | key_file=$DATA_FILES_PATH/server6.key \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6152 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 6153 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6154 | -c "Supported Signature Algorithm found: 04 " \ |
| 6155 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6156 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6157 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6158 | run_test "Authentication: client SHA384, server required" \ |
| 6159 | "$P_SRV auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6160 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6161 | key_file=$DATA_FILES_PATH/server6.key \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6162 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 6163 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6164 | -c "Supported Signature Algorithm found: 04 " \ |
| 6165 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6166 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6167 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 6168 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 6169 | "$P_CLI debug_level=3 crt_file=none \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6170 | key_file=$DATA_FILES_PATH/server5.key" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6171 | 1 \ |
| 6172 | -S "skip write certificate request" \ |
| 6173 | -C "skip parse certificate request" \ |
| 6174 | -c "got a certificate request" \ |
| 6175 | -c "= write certificate$" \ |
| 6176 | -C "skip write certificate$" \ |
| 6177 | -S "x509_verify_cert() returned" \ |
Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 6178 | -s "peer has no certificate" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6179 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6180 | -s "No client certification received from the client, but required by the authentication mode" |
| 6181 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6182 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6183 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6184 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6185 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6186 | 1 \ |
| 6187 | -S "skip write certificate request" \ |
| 6188 | -C "skip parse certificate request" \ |
| 6189 | -c "got a certificate request" \ |
| 6190 | -C "skip write certificate" \ |
| 6191 | -C "skip write certificate verify" \ |
| 6192 | -S "skip parse certificate verify" \ |
| 6193 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6194 | -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] | 6195 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 6196 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6197 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 6198 | # We don't check that the client receives the alert because it might |
| 6199 | # detect that its write end of the connection is closed and abort |
| 6200 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6201 | |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 6202 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6203 | "$P_SRV debug_level=3 auth_mode=required ca_file=$DATA_FILES_PATH/server5-selfsigned.crt" \ |
| 6204 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6205 | key_file=$DATA_FILES_PATH/server5.key" \ |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 6206 | 0 \ |
| 6207 | -S "skip write certificate request" \ |
| 6208 | -C "skip parse certificate request" \ |
| 6209 | -c "got a certificate request" \ |
| 6210 | -C "skip write certificate" \ |
| 6211 | -C "skip write certificate verify" \ |
| 6212 | -S "skip parse certificate verify" \ |
| 6213 | -S "x509_verify_cert() returned" \ |
| 6214 | -S "! The certificate is not correctly signed" \ |
| 6215 | -S "X509 - Certificate verification failed" |
| 6216 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6217 | run_test "Authentication: client cert not trusted, server required" \ |
| 6218 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6219 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6220 | key_file=$DATA_FILES_PATH/server5.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6221 | 1 \ |
| 6222 | -S "skip write certificate request" \ |
| 6223 | -C "skip parse certificate request" \ |
| 6224 | -c "got a certificate request" \ |
| 6225 | -C "skip write certificate" \ |
| 6226 | -C "skip write certificate verify" \ |
| 6227 | -S "skip parse certificate verify" \ |
| 6228 | -s "x509_verify_cert() returned" \ |
| 6229 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6230 | -s "! mbedtls_ssl_handshake returned" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6231 | -s "X509 - Certificate verification failed" |
| 6232 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6233 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6234 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6235 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6236 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6237 | 0 \ |
| 6238 | -S "skip write certificate request" \ |
| 6239 | -C "skip parse certificate request" \ |
| 6240 | -c "got a certificate request" \ |
| 6241 | -C "skip write certificate" \ |
| 6242 | -C "skip write certificate verify" \ |
| 6243 | -S "skip parse certificate verify" \ |
| 6244 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6245 | -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] | 6246 | -S "! mbedtls_ssl_handshake returned" \ |
| 6247 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6248 | -S "X509 - Certificate verification failed" |
| 6249 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6250 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6251 | "$P_SRV debug_level=3 auth_mode=none" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6252 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6253 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6254 | 0 \ |
| 6255 | -s "skip write certificate request" \ |
| 6256 | -C "skip parse certificate request" \ |
| 6257 | -c "got no certificate request" \ |
| 6258 | -c "skip write certificate" \ |
| 6259 | -c "skip write certificate verify" \ |
| 6260 | -s "skip parse certificate verify" \ |
| 6261 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6262 | -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] | 6263 | -S "! mbedtls_ssl_handshake returned" \ |
| 6264 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6265 | -S "X509 - Certificate verification failed" |
| 6266 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6267 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6268 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 6269 | "$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] | 6270 | 0 \ |
| 6271 | -S "skip write certificate request" \ |
| 6272 | -C "skip parse certificate request" \ |
| 6273 | -c "got a certificate request" \ |
| 6274 | -C "skip write certificate$" \ |
| 6275 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6276 | -c "skip write certificate verify" \ |
| 6277 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6278 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6279 | -S "! mbedtls_ssl_handshake returned" \ |
| 6280 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6281 | -S "X509 - Certificate verification failed" |
| 6282 | |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 6283 | requires_openssl_tls1_3_with_compatible_ephemeral |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6284 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6285 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6286 | "$O_NEXT_CLI_NO_CERT -no_middlebox" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6287 | 0 \ |
| 6288 | -S "skip write certificate request" \ |
| 6289 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6290 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6291 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6292 | -S "X509 - Certificate verification failed" |
| 6293 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6294 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6295 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6296 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6297 | "$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] | 6298 | 0 \ |
| 6299 | -C "skip parse certificate request" \ |
| 6300 | -c "got a certificate request" \ |
| 6301 | -C "skip write certificate$" \ |
| 6302 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6303 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6304 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6305 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6306 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6307 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6308 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 6309 | 1 \ |
| 6310 | -C "skip parse certificate request" \ |
| 6311 | -c "got a certificate request" \ |
| 6312 | -C "skip write certificate$" \ |
| 6313 | -c "skip write certificate verify" \ |
| 6314 | -c "! mbedtls_ssl_handshake returned" |
| 6315 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 6316 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 6317 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 6318 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 6319 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 6320 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 6321 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 6322 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 6323 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 6324 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 6325 | # 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] | 6326 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6327 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6328 | run_test "Authentication: server max_int chain, client default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6329 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6330 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
| 6331 | "$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] | 6332 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6333 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6334 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6335 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6336 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6337 | run_test "Authentication: server max_int+1 chain, client default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6338 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6339 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6340 | "$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] | 6341 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6342 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6343 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6344 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6345 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6346 | run_test "Authentication: server max_int+1 chain, client optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6347 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6348 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 58ab9ba | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 6349 | "$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] | 6350 | auth_mode=optional" \ |
| 6351 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6352 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6353 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6354 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6355 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6356 | run_test "Authentication: server max_int+1 chain, client none" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6357 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6358 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6359 | "$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] | 6360 | auth_mode=none" \ |
| 6361 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6362 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6363 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6364 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6365 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6366 | run_test "Authentication: client max_int+1 chain, server default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6367 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt" \ |
| 6368 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6369 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6370 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6371 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6372 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6373 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6374 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6375 | run_test "Authentication: client max_int+1 chain, server optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6376 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=optional" \ |
| 6377 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6378 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6379 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6380 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6381 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6382 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6383 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6384 | run_test "Authentication: client max_int+1 chain, server required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6385 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
| 6386 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6387 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6388 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6389 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6390 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6391 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6392 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6393 | run_test "Authentication: client max_int chain, server required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6394 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
| 6395 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6396 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6397 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6398 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6399 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6400 | # Tests for CA list in CertificateRequest messages |
| 6401 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6402 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6403 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 6404 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6405 | "$P_CLI force_version=tls12 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6406 | key_file=$DATA_FILES_PATH/server6.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6407 | 0 \ |
| 6408 | -s "requested DN" |
| 6409 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6410 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6411 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 6412 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6413 | "$P_CLI force_version=tls12 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6414 | key_file=$DATA_FILES_PATH/server6.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6415 | 0 \ |
| 6416 | -S "requested DN" |
| 6417 | |
| 6418 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6419 | "$P_SRV force_version=tls12 debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6420 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6421 | key_file=$DATA_FILES_PATH/server5.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6422 | 1 \ |
| 6423 | -S "requested DN" \ |
| 6424 | -s "x509_verify_cert() returned" \ |
| 6425 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6426 | -s "! mbedtls_ssl_handshake returned" \ |
| 6427 | -c "! mbedtls_ssl_handshake returned" \ |
| 6428 | -s "X509 - Certificate verification failed" |
| 6429 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6430 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6431 | run_test "Authentication: send alt conf DN hints in CertificateRequest" \ |
| 6432 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6433 | crt_file2=$DATA_FILES_PATH/server1.crt \ |
| 6434 | key_file2=$DATA_FILES_PATH/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6435 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6436 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6437 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6438 | 0 \ |
| 6439 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 6440 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6441 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6442 | run_test "Authentication: send alt conf DN hints in CertificateRequest (2)" \ |
| 6443 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6444 | crt_file2=$DATA_FILES_PATH/server2.crt \ |
| 6445 | key_file2=$DATA_FILES_PATH/server2.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6446 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6447 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6448 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6449 | 0 \ |
| 6450 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" |
| 6451 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6452 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6453 | run_test "Authentication: send alt hs DN hints in CertificateRequest" \ |
| 6454 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6455 | crt_file2=$DATA_FILES_PATH/server1.crt \ |
| 6456 | key_file2=$DATA_FILES_PATH/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6457 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6458 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6459 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6460 | 0 \ |
| 6461 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 6462 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 6463 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 6464 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6465 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6466 | run_test "Authentication, CA callback: server badcert, client required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6467 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6468 | key_file=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6469 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6470 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6471 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6472 | -c "x509_verify_cert() returned" \ |
| 6473 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6474 | -c "! mbedtls_ssl_handshake returned" \ |
| 6475 | -c "X509 - Certificate verification failed" |
| 6476 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6477 | run_test "Authentication, CA callback: server badcert, client optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6478 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6479 | key_file=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6480 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6481 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6482 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6483 | -c "x509_verify_cert() returned" \ |
| 6484 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6485 | -C "! mbedtls_ssl_handshake returned" \ |
| 6486 | -C "X509 - Certificate verification failed" |
| 6487 | |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6488 | run_test "Authentication, CA callback: server badcert, client none" \ |
| 6489 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6490 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 6491 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=none" \ |
| 6492 | 0 \ |
| 6493 | -C "use CA callback for X.509 CRT verification" \ |
| 6494 | -C "x509_verify_cert() returned" \ |
| 6495 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6496 | -C "! mbedtls_ssl_handshake returned" \ |
| 6497 | -C "X509 - Certificate verification failed" |
| 6498 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6499 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 6500 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 6501 | # the client informs the server about the supported curves - it does, though, in the |
| 6502 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 6503 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 6504 | # different means to have the server ignoring the client's supported curve list. |
| 6505 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6506 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6507 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6508 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6509 | "$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] | 6510 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6511 | -c "use CA callback for X.509 CRT verification" \ |
| 6512 | -c "bad certificate (EC key curve)" \ |
| 6513 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6514 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 6515 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6516 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6517 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6518 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6519 | "$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] | 6520 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6521 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6522 | -c "bad certificate (EC key curve)"\ |
| 6523 | -c "! Certificate verification flags"\ |
| 6524 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 6525 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6526 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 7a442c9 | 2024-04-03 08:57:09 +0200 | [diff] [blame] | 6527 | run_test "Authentication, CA callback: client SHA384, server required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6528 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6529 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6530 | key_file=$DATA_FILES_PATH/server6.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6531 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 6532 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6533 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6534 | -c "Supported Signature Algorithm found: 04 " \ |
| 6535 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6536 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6537 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 7a442c9 | 2024-04-03 08:57:09 +0200 | [diff] [blame] | 6538 | run_test "Authentication, CA callback: client SHA256, server required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6539 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6540 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6541 | key_file=$DATA_FILES_PATH/server6.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6542 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 6543 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6544 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6545 | -c "Supported Signature Algorithm found: 04 " \ |
| 6546 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6547 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6548 | run_test "Authentication, CA callback: client badcert, server required" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6549 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6550 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6551 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6552 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6553 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6554 | -S "skip write certificate request" \ |
| 6555 | -C "skip parse certificate request" \ |
| 6556 | -c "got a certificate request" \ |
| 6557 | -C "skip write certificate" \ |
| 6558 | -C "skip write certificate verify" \ |
| 6559 | -S "skip parse certificate verify" \ |
| 6560 | -s "x509_verify_cert() returned" \ |
| 6561 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6562 | -s "! mbedtls_ssl_handshake returned" \ |
| 6563 | -s "send alert level=2 message=48" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6564 | -s "X509 - Certificate verification failed" |
| 6565 | # We don't check that the client receives the alert because it might |
| 6566 | # detect that its write end of the connection is closed and abort |
| 6567 | # before reading the alert message. |
| 6568 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6569 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6570 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6571 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6572 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6573 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6574 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6575 | -S "skip write certificate request" \ |
| 6576 | -C "skip parse certificate request" \ |
| 6577 | -c "got a certificate request" \ |
| 6578 | -C "skip write certificate" \ |
| 6579 | -C "skip write certificate verify" \ |
| 6580 | -S "skip parse certificate verify" \ |
| 6581 | -s "x509_verify_cert() returned" \ |
| 6582 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6583 | -s "! mbedtls_ssl_handshake returned" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6584 | -s "X509 - Certificate verification failed" |
| 6585 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6586 | run_test "Authentication, CA callback: client badcert, server optional" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6587 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6588 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6589 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6590 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6591 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6592 | -S "skip write certificate request" \ |
| 6593 | -C "skip parse certificate request" \ |
| 6594 | -c "got a certificate request" \ |
| 6595 | -C "skip write certificate" \ |
| 6596 | -C "skip write certificate verify" \ |
| 6597 | -S "skip parse certificate verify" \ |
| 6598 | -s "x509_verify_cert() returned" \ |
| 6599 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6600 | -S "! mbedtls_ssl_handshake returned" \ |
| 6601 | -C "! mbedtls_ssl_handshake returned" \ |
| 6602 | -S "X509 - Certificate verification failed" |
| 6603 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6604 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6605 | requires_full_size_output_buffer |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6606 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6607 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6608 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6609 | "$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] | 6610 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6611 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6612 | -C "X509 - A fatal error occurred" |
| 6613 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6614 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6615 | requires_full_size_output_buffer |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6616 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6617 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6618 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6619 | "$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] | 6620 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6621 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6622 | -c "X509 - A fatal error occurred" |
| 6623 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6624 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6625 | requires_full_size_output_buffer |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6626 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6627 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6628 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6629 | "$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] | 6630 | debug_level=3 auth_mode=optional" \ |
| 6631 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6632 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6633 | -c "X509 - A fatal error occurred" |
| 6634 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6635 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6636 | requires_full_size_output_buffer |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6637 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6638 | "$P_SRV ca_callback=1 debug_level=3 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6639 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6640 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6641 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6642 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6643 | -s "X509 - A fatal error occurred" |
| 6644 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6645 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6646 | requires_full_size_output_buffer |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6647 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6648 | "$P_SRV ca_callback=1 debug_level=3 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6649 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6650 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6651 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6652 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6653 | -s "X509 - A fatal error occurred" |
| 6654 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6655 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6656 | requires_full_size_output_buffer |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6657 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6658 | "$P_SRV ca_callback=1 debug_level=3 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6659 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6660 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6661 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6662 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6663 | -S "X509 - A fatal error occurred" |
| 6664 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 6665 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6666 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6667 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6668 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6669 | "$P_SRV force_version=tls12 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 6670 | key_file=$DATA_FILES_PATH/server5.key \ |
| 6671 | crt_file2=$DATA_FILES_PATH/server5-sha1.crt \ |
| 6672 | key_file2=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6673 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6674 | 0 \ |
| 6675 | -c "signed using.*ECDSA with SHA256" \ |
| 6676 | -C "signed using.*ECDSA with SHA1" |
| 6677 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6678 | # tests for SNI |
| 6679 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6680 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6681 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6682 | "$P_SRV debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6683 | 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] | 6684 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6685 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6686 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6687 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6688 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6689 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6690 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6691 | "$P_SRV debug_level=3 \ |
David Horstmann | 184c4f0 | 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 | 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] | 6694 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6695 | 0 \ |
| 6696 | -s "parse ServerName extension" \ |
| 6697 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6698 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6699 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6700 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6701 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6702 | "$P_SRV debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6703 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6704 | 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] | 6705 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6706 | 0 \ |
| 6707 | -s "parse ServerName extension" \ |
| 6708 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6709 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6710 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6711 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6712 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6713 | "$P_SRV debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6714 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6715 | 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] | 6716 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6717 | 1 \ |
| 6718 | -s "parse ServerName extension" \ |
| 6719 | -s "ssl_sni_wrapper() returned" \ |
| 6720 | -s "mbedtls_ssl_handshake returned" \ |
| 6721 | -c "mbedtls_ssl_handshake returned" \ |
| 6722 | -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] | 6723 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6724 | run_test "SNI: client auth no override: optional" \ |
| 6725 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 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,-,-,-" \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6728 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6729 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6730 | -S "skip write certificate request" \ |
| 6731 | -C "skip parse certificate request" \ |
| 6732 | -c "got a certificate request" \ |
| 6733 | -C "skip write certificate" \ |
| 6734 | -C "skip write certificate verify" \ |
| 6735 | -S "skip parse certificate verify" |
| 6736 | |
| 6737 | run_test "SNI: client auth override: none -> optional" \ |
| 6738 | "$P_SRV debug_level=3 auth_mode=none \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6739 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6740 | 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] | 6741 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6742 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6743 | -S "skip write certificate request" \ |
| 6744 | -C "skip parse certificate request" \ |
| 6745 | -c "got a certificate request" \ |
| 6746 | -C "skip write certificate" \ |
| 6747 | -C "skip write certificate verify" \ |
| 6748 | -S "skip parse certificate verify" |
| 6749 | |
| 6750 | run_test "SNI: client auth override: optional -> none" \ |
| 6751 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6752 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6753 | 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] | 6754 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6755 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6756 | -s "skip write certificate request" \ |
| 6757 | -C "skip parse certificate request" \ |
| 6758 | -c "got no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 6759 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6760 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6761 | run_test "SNI: CA no override" \ |
| 6762 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6763 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6764 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6765 | 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] | 6766 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6767 | 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] | 6768 | 1 \ |
| 6769 | -S "skip write certificate request" \ |
| 6770 | -C "skip parse certificate request" \ |
| 6771 | -c "got a certificate request" \ |
| 6772 | -C "skip write certificate" \ |
| 6773 | -C "skip write certificate verify" \ |
| 6774 | -S "skip parse certificate verify" \ |
| 6775 | -s "x509_verify_cert() returned" \ |
| 6776 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6777 | -S "The certificate has been revoked (is on a CRL)" |
| 6778 | |
| 6779 | run_test "SNI: CA override" \ |
| 6780 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6781 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6782 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6783 | 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] | 6784 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6785 | 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] | 6786 | 0 \ |
| 6787 | -S "skip write certificate request" \ |
| 6788 | -C "skip parse certificate request" \ |
| 6789 | -c "got a certificate request" \ |
| 6790 | -C "skip write certificate" \ |
| 6791 | -C "skip write certificate verify" \ |
| 6792 | -S "skip parse certificate verify" \ |
| 6793 | -S "x509_verify_cert() returned" \ |
| 6794 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6795 | -S "The certificate has been revoked (is on a CRL)" |
| 6796 | |
| 6797 | run_test "SNI: CA override with CRL" \ |
| 6798 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6799 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6800 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6801 | 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] | 6802 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6803 | 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] | 6804 | 1 \ |
| 6805 | -S "skip write certificate request" \ |
| 6806 | -C "skip parse certificate request" \ |
| 6807 | -c "got a certificate request" \ |
| 6808 | -C "skip write certificate" \ |
| 6809 | -C "skip write certificate verify" \ |
| 6810 | -S "skip parse certificate verify" \ |
| 6811 | -s "x509_verify_cert() returned" \ |
| 6812 | -S "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2ffa53a | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6813 | -s "send alert level=2 message=44" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6814 | -s "The certificate has been revoked (is on a CRL)" |
Manuel Pégourié-Gonnard | 2ffa53a | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6815 | # MBEDTLS_X509_BADCERT_REVOKED -> MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6816 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6817 | # Tests for SNI and DTLS |
| 6818 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6819 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6821 | run_test "SNI: DTLS, no SNI callback" \ |
| 6822 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6823 | 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] | 6824 | "$P_CLI server_name=localhost dtls=1" \ |
| 6825 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6826 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6827 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6828 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6829 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6830 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6831 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6832 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6833 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6834 | 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] | 6835 | "$P_CLI server_name=localhost dtls=1" \ |
| 6836 | 0 \ |
| 6837 | -s "parse ServerName extension" \ |
| 6838 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6839 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6840 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6841 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6842 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6843 | run_test "SNI: DTLS, matching cert 2" \ |
| 6844 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6845 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6846 | 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] | 6847 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 6848 | 0 \ |
| 6849 | -s "parse ServerName extension" \ |
| 6850 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6851 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6852 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6853 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6854 | run_test "SNI: DTLS, no matching cert" \ |
| 6855 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6856 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6857 | 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] | 6858 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 6859 | 1 \ |
| 6860 | -s "parse ServerName extension" \ |
| 6861 | -s "ssl_sni_wrapper() returned" \ |
| 6862 | -s "mbedtls_ssl_handshake returned" \ |
| 6863 | -c "mbedtls_ssl_handshake returned" \ |
| 6864 | -c "SSL - A fatal alert message was received from our peer" |
| 6865 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6866 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6867 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 6868 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6869 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6870 | 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] | 6871 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6872 | 0 \ |
| 6873 | -S "skip write certificate request" \ |
| 6874 | -C "skip parse certificate request" \ |
| 6875 | -c "got a certificate request" \ |
| 6876 | -C "skip write certificate" \ |
| 6877 | -C "skip write certificate verify" \ |
| 6878 | -S "skip parse certificate verify" |
| 6879 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6880 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6881 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 6882 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6883 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6884 | 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] | 6885 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6886 | 0 \ |
| 6887 | -S "skip write certificate request" \ |
| 6888 | -C "skip parse certificate request" \ |
| 6889 | -c "got a certificate request" \ |
| 6890 | -C "skip write certificate" \ |
| 6891 | -C "skip write certificate verify" \ |
| 6892 | -S "skip parse certificate verify" |
| 6893 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6895 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 6896 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6897 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6898 | 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] | 6899 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6900 | 0 \ |
| 6901 | -s "skip write certificate request" \ |
| 6902 | -C "skip parse certificate request" \ |
| 6903 | -c "got no certificate request" \ |
| 6904 | -c "skip write certificate" \ |
| 6905 | -c "skip write certificate verify" \ |
| 6906 | -s "skip parse certificate verify" |
| 6907 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6908 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6909 | run_test "SNI: DTLS, CA no override" \ |
| 6910 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6911 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6912 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6913 | 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] | 6914 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6915 | 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] | 6916 | 1 \ |
| 6917 | -S "skip write certificate request" \ |
| 6918 | -C "skip parse certificate request" \ |
| 6919 | -c "got a certificate request" \ |
| 6920 | -C "skip write certificate" \ |
| 6921 | -C "skip write certificate verify" \ |
| 6922 | -S "skip parse certificate verify" \ |
| 6923 | -s "x509_verify_cert() returned" \ |
| 6924 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6925 | -S "The certificate has been revoked (is on a CRL)" |
| 6926 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6927 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6928 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6929 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6930 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6931 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6932 | 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] | 6933 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6934 | 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] | 6935 | 0 \ |
| 6936 | -S "skip write certificate request" \ |
| 6937 | -C "skip parse certificate request" \ |
| 6938 | -c "got a certificate request" \ |
| 6939 | -C "skip write certificate" \ |
| 6940 | -C "skip write certificate verify" \ |
| 6941 | -S "skip parse certificate verify" \ |
| 6942 | -S "x509_verify_cert() returned" \ |
| 6943 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6944 | -S "The certificate has been revoked (is on a CRL)" |
| 6945 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6946 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6947 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6948 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6949 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key dtls=1 \ |
| 6950 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6951 | 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] | 6952 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6953 | 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] | 6954 | 1 \ |
| 6955 | -S "skip write certificate request" \ |
| 6956 | -C "skip parse certificate request" \ |
| 6957 | -c "got a certificate request" \ |
| 6958 | -C "skip write certificate" \ |
| 6959 | -C "skip write certificate verify" \ |
| 6960 | -S "skip parse certificate verify" \ |
| 6961 | -s "x509_verify_cert() returned" \ |
| 6962 | -S "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2ffa53a | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6963 | -s "send alert level=2 message=44" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6964 | -s "The certificate has been revoked (is on a CRL)" |
Manuel Pégourié-Gonnard | 2ffa53a | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6965 | # MBEDTLS_X509_BADCERT_REVOKED -> MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6966 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6967 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 6968 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6969 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6970 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6971 | "$P_CLI nbio=2 tickets=0" \ |
| 6972 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6973 | -S "mbedtls_ssl_handshake returned" \ |
| 6974 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6975 | -c "Read from server: .* bytes read" |
| 6976 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6977 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6978 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 6979 | "$P_CLI nbio=2 tickets=0" \ |
| 6980 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6981 | -S "mbedtls_ssl_handshake returned" \ |
| 6982 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6983 | -c "Read from server: .* bytes read" |
| 6984 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6985 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6986 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6987 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6988 | "$P_CLI nbio=2 tickets=1" \ |
| 6989 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6990 | -S "mbedtls_ssl_handshake returned" \ |
| 6991 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6992 | -c "Read from server: .* bytes read" |
| 6993 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6994 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6995 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6996 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6997 | "$P_CLI nbio=2 tickets=1" \ |
| 6998 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6999 | -S "mbedtls_ssl_handshake returned" \ |
| 7000 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 7001 | -c "Read from server: .* bytes read" |
| 7002 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7003 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7004 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7005 | 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] | 7006 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7007 | "$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] | 7008 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7009 | -S "mbedtls_ssl_handshake returned" \ |
| 7010 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 7011 | -c "Read from server: .* bytes read" |
| 7012 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7013 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7014 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 7015 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Norbert Fabritius | 4f1c927 | 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 "Non-blocking I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 7018 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 7019 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7020 | 0 \ |
| 7021 | -S "mbedtls_ssl_handshake returned" \ |
| 7022 | -C "mbedtls_ssl_handshake returned" \ |
| 7023 | -c "Read from server: .* bytes read" |
| 7024 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7025 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7026 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7027 | 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] | 7028 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7029 | "$P_CLI force_version=tls12 nbio=2 tickets=1 reconnect=1" \ |
| 7030 | 0 \ |
| 7031 | -S "mbedtls_ssl_handshake returned" \ |
| 7032 | -C "mbedtls_ssl_handshake returned" \ |
| 7033 | -c "Read from server: .* bytes read" |
| 7034 | |
| 7035 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7036 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 7037 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7038 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7039 | run_test "Non-blocking I/O: TLS 1.3 + ticket + resume" \ |
| 7040 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 7041 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 7042 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7043 | -S "mbedtls_ssl_handshake returned" \ |
| 7044 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 7045 | -c "Read from server: .* bytes read" |
| 7046 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7047 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7048 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 7049 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 7050 | "$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] | 7051 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7052 | -S "mbedtls_ssl_handshake returned" \ |
| 7053 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 7054 | -c "Read from server: .* bytes read" |
| 7055 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7056 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 7057 | |
| 7058 | run_test "Event-driven I/O: basic handshake" \ |
| 7059 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 7060 | "$P_CLI event=1 tickets=0" \ |
| 7061 | 0 \ |
| 7062 | -S "mbedtls_ssl_handshake returned" \ |
| 7063 | -C "mbedtls_ssl_handshake returned" \ |
| 7064 | -c "Read from server: .* bytes read" |
| 7065 | |
| 7066 | run_test "Event-driven I/O: client auth" \ |
| 7067 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 7068 | "$P_CLI event=1 tickets=0" \ |
| 7069 | 0 \ |
| 7070 | -S "mbedtls_ssl_handshake returned" \ |
| 7071 | -C "mbedtls_ssl_handshake returned" \ |
| 7072 | -c "Read from server: .* bytes read" |
| 7073 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7074 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7075 | run_test "Event-driven I/O: ticket" \ |
| 7076 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 7077 | "$P_CLI event=1 tickets=1" \ |
| 7078 | 0 \ |
| 7079 | -S "mbedtls_ssl_handshake returned" \ |
| 7080 | -C "mbedtls_ssl_handshake returned" \ |
| 7081 | -c "Read from server: .* bytes read" |
| 7082 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7083 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7084 | run_test "Event-driven I/O: ticket + client auth" \ |
| 7085 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 7086 | "$P_CLI event=1 tickets=1" \ |
| 7087 | 0 \ |
| 7088 | -S "mbedtls_ssl_handshake returned" \ |
| 7089 | -C "mbedtls_ssl_handshake returned" \ |
| 7090 | -c "Read from server: .* bytes read" |
| 7091 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7092 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7093 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7094 | 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] | 7095 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7096 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7097 | 0 \ |
| 7098 | -S "mbedtls_ssl_handshake returned" \ |
| 7099 | -C "mbedtls_ssl_handshake returned" \ |
| 7100 | -c "Read from server: .* bytes read" |
| 7101 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7102 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7103 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 7104 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7105 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7106 | run_test "Event-driven I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 7107 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 7108 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7109 | 0 \ |
| 7110 | -S "mbedtls_ssl_handshake returned" \ |
| 7111 | -C "mbedtls_ssl_handshake returned" \ |
| 7112 | -c "Read from server: .* bytes read" |
| 7113 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7114 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7115 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7116 | run_test "Event-driven I/O: TLS 1.2 + ticket + resume" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7117 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7118 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
| 7119 | 0 \ |
| 7120 | -S "mbedtls_ssl_handshake returned" \ |
| 7121 | -C "mbedtls_ssl_handshake returned" \ |
| 7122 | -c "Read from server: .* bytes read" |
| 7123 | |
| 7124 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7125 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 7126 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7127 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7128 | run_test "Event-driven I/O: TLS 1.3 + ticket + resume" \ |
| 7129 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 7130 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7131 | 0 \ |
| 7132 | -S "mbedtls_ssl_handshake returned" \ |
| 7133 | -C "mbedtls_ssl_handshake returned" \ |
| 7134 | -c "Read from server: .* bytes read" |
| 7135 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7136 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7137 | run_test "Event-driven I/O: session-id resume" \ |
| 7138 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 7139 | "$P_CLI force_version=tls12 event=1 tickets=0 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7140 | 0 \ |
| 7141 | -S "mbedtls_ssl_handshake returned" \ |
| 7142 | -C "mbedtls_ssl_handshake returned" \ |
| 7143 | -c "Read from server: .* bytes read" |
| 7144 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7145 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7146 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 7147 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 7148 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 7149 | 0 \ |
| 7150 | -c "Read from server: .* bytes read" |
| 7151 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7152 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7153 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 7154 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 7155 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 7156 | 0 \ |
| 7157 | -c "Read from server: .* bytes read" |
| 7158 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7159 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7160 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7161 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 7162 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 7163 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 7164 | 0 \ |
| 7165 | -c "Read from server: .* bytes read" |
| 7166 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7167 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7168 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7169 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 7170 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 7171 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 7172 | 0 \ |
| 7173 | -c "Read from server: .* bytes read" |
| 7174 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7175 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7176 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7177 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 7178 | "$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] | 7179 | "$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] | 7180 | 0 \ |
| 7181 | -c "Read from server: .* bytes read" |
| 7182 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7183 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7184 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7185 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 7186 | "$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] | 7187 | "$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] | 7188 | 0 \ |
| 7189 | -c "Read from server: .* bytes read" |
| 7190 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7191 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7192 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 7193 | "$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] | 7194 | "$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] | 7195 | 0 \ |
| 7196 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7197 | |
| 7198 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 7199 | # During session resumption, the client will send its ApplicationData record |
| 7200 | # within the same datagram as the Finished messages. In this situation, the |
| 7201 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 7202 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7203 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7204 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7205 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7206 | "$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] | 7207 | "$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] | 7208 | 0 \ |
| 7209 | -c "Read from server: .* bytes read" |
| 7210 | |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7211 | # Tests for version negotiation. Some information to ease the understanding |
| 7212 | # of the version negotiation test titles below: |
| 7213 | # . 1.2/1.3 means that only TLS 1.2/TLS 1.3 is enabled. |
| 7214 | # . 1.2+1.3 means that both TLS 1.2 and TLS 1.3 are enabled. |
| 7215 | # . 1.2+(1.3)/(1.2)+1.3 means that TLS 1.2/1.3 is enabled and that |
| 7216 | # TLS 1.3/1.2 may be enabled or not. |
| 7217 | # . max=1.2 means that both TLS 1.2 and TLS 1.3 are enabled at build time but |
| 7218 | # TLS 1.3 is disabled at runtime (maximum negotiable version is TLS 1.2). |
| 7219 | # . min=1.3 means that both TLS 1.2 and TLS 1.3 are enabled at build time but |
| 7220 | # TLS 1.2 is disabled at runtime (minimum negotiable version is TLS 1.3). |
| 7221 | |
Ronald Cron | fe18d8d | 2024-03-06 15:19:55 +0100 | [diff] [blame] | 7222 | # Tests for version negotiation, MbedTLS client and server |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7223 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7224 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7225 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7226 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7227 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7228 | 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] | 7229 | "$P_SRV" \ |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7230 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7231 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7232 | -S "mbedtls_ssl_handshake returned" \ |
| 7233 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7234 | -s "Protocol is TLSv1.2" \ |
| 7235 | -c "Protocol is TLSv1.2" |
| 7236 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7237 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7238 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7239 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7240 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7241 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7242 | run_test "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] | 7243 | "$P_SRV max_version=tls12" \ |
| 7244 | "$P_CLI max_version=tls12" \ |
| 7245 | 0 \ |
| 7246 | -S "mbedtls_ssl_handshake returned" \ |
| 7247 | -C "mbedtls_ssl_handshake returned" \ |
| 7248 | -s "Protocol is TLSv1.2" \ |
| 7249 | -c "Protocol is TLSv1.2" |
| 7250 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7251 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7252 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7253 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7254 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7255 | 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] | 7256 | "$P_SRV" \ |
| 7257 | "$P_CLI" \ |
| 7258 | 0 \ |
| 7259 | -S "mbedtls_ssl_handshake returned" \ |
| 7260 | -C "mbedtls_ssl_handshake returned" \ |
| 7261 | -s "Protocol is TLSv1.3" \ |
| 7262 | -c "Protocol is TLSv1.3" |
| 7263 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7264 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7265 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7266 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7267 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7268 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7269 | 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] | 7270 | "$P_SRV min_version=tls13" \ |
| 7271 | "$P_CLI min_version=tls13" \ |
| 7272 | 0 \ |
| 7273 | -S "mbedtls_ssl_handshake returned" \ |
| 7274 | -C "mbedtls_ssl_handshake returned" \ |
| 7275 | -s "Protocol is TLSv1.3" \ |
| 7276 | -c "Protocol is TLSv1.3" |
| 7277 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7278 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7279 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7280 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7281 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7282 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7283 | 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] | 7284 | "$P_SRV" \ |
| 7285 | "$P_CLI" \ |
| 7286 | 0 \ |
| 7287 | -S "mbedtls_ssl_handshake returned" \ |
| 7288 | -C "mbedtls_ssl_handshake returned" \ |
| 7289 | -s "Protocol is TLSv1.3" \ |
| 7290 | -c "Protocol is TLSv1.3" |
| 7291 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7292 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7293 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7294 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7295 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7296 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7297 | 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] | 7298 | "$P_SRV min_version=tls13" \ |
| 7299 | "$P_CLI" \ |
| 7300 | 0 \ |
| 7301 | -S "mbedtls_ssl_handshake returned" \ |
| 7302 | -C "mbedtls_ssl_handshake returned" \ |
| 7303 | -s "Protocol is TLSv1.3" \ |
| 7304 | -c "Protocol is TLSv1.3" |
| 7305 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7306 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7307 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7308 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7309 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7310 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7311 | 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] | 7312 | "$P_SRV max_version=tls12" \ |
| 7313 | "$P_CLI" \ |
| 7314 | 0 \ |
| 7315 | -S "mbedtls_ssl_handshake returned" \ |
| 7316 | -C "mbedtls_ssl_handshake returned" \ |
| 7317 | -s "Protocol is TLSv1.2" \ |
| 7318 | -c "Protocol is TLSv1.2" |
| 7319 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7320 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7321 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7322 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7323 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7324 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7325 | 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] | 7326 | "$P_SRV" \ |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7327 | "$P_CLI max_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7328 | 0 \ |
| 7329 | -S "mbedtls_ssl_handshake returned" \ |
| 7330 | -C "mbedtls_ssl_handshake returned" \ |
| 7331 | -s "Protocol is TLSv1.2" \ |
| 7332 | -c "Protocol is TLSv1.2" |
| 7333 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7334 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7335 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7336 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7337 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7338 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7339 | 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] | 7340 | "$P_SRV" \ |
| 7341 | "$P_CLI min_version=tls13" \ |
| 7342 | 0 \ |
| 7343 | -S "mbedtls_ssl_handshake returned" \ |
| 7344 | -C "mbedtls_ssl_handshake returned" \ |
| 7345 | -s "Protocol is TLSv1.3" \ |
| 7346 | -c "Protocol is TLSv1.3" |
| 7347 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7348 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7349 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7350 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7351 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7352 | 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] | 7353 | "$P_SRV min_version=tls13" \ |
| 7354 | "$P_CLI max_version=tls12" \ |
| 7355 | 1 \ |
| 7356 | -s "Handshake protocol not within min/max boundaries" \ |
| 7357 | -S "Protocol is TLSv1.2" \ |
| 7358 | -C "Protocol is TLSv1.2" \ |
| 7359 | -S "Protocol is TLSv1.3" \ |
| 7360 | -C "Protocol is TLSv1.3" |
Ronald Cron | fe18d8d | 2024-03-06 15:19:55 +0100 | [diff] [blame] | 7361 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7362 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7363 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7364 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7365 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7366 | 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] | 7367 | "$P_SRV max_version=tls12" \ |
| 7368 | "$P_CLI min_version=tls13" \ |
| 7369 | 1 \ |
| 7370 | -s "The handshake negotiation failed" \ |
| 7371 | -S "Protocol is TLSv1.2" \ |
| 7372 | -C "Protocol is TLSv1.2" \ |
| 7373 | -S "Protocol is TLSv1.3" \ |
| 7374 | -C "Protocol is TLSv1.3" |
| 7375 | |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7376 | # Tests of version negotiation on server side against GnuTLS client |
| 7377 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7378 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7379 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7380 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7381 | 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] | 7382 | "$P_SRV" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7383 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7384 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7385 | -S "mbedtls_ssl_handshake returned" \ |
| 7386 | -s "Protocol is TLSv1.2" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7387 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7388 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7389 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7390 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7391 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7392 | 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] | 7393 | "$P_SRV max_version=tls12" \ |
| 7394 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7395 | 0 \ |
| 7396 | -S "mbedtls_ssl_handshake returned" \ |
| 7397 | -s "Protocol is TLSv1.2" |
| 7398 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7399 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7400 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7401 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7402 | 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] | 7403 | "$P_SRV" \ |
| 7404 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7405 | 0 \ |
| 7406 | -S "mbedtls_ssl_handshake returned" \ |
| 7407 | -s "Protocol is TLSv1.3" |
| 7408 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7409 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7410 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7411 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7412 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7413 | 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] | 7414 | "$P_SRV min_version=tls13" \ |
| 7415 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7416 | 0 \ |
| 7417 | -S "mbedtls_ssl_handshake returned" \ |
| 7418 | -s "Protocol is TLSv1.3" |
| 7419 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7420 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7421 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7422 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7423 | 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] | 7424 | "$P_SRV" \ |
| 7425 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7426 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7427 | -S "mbedtls_ssl_handshake returned" \ |
| 7428 | -s "Protocol is TLSv1.3" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7429 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7430 | requires_gnutls_next_disable_tls13_compat |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7431 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7432 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7433 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7434 | 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] | 7435 | "$P_SRV" \ |
| 7436 | "$G_NEXT_CLI localhost --priority=NORMAL:%DISABLE_TLS13_COMPAT_MODE" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7437 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7438 | -S "mbedtls_ssl_handshake returned" \ |
| 7439 | -s "Protocol is TLSv1.3" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7440 | |
| 7441 | # GnuTLS can be setup to send a ClientHello containing a supported versions |
| 7442 | # extension proposing TLS 1.2 (preferred) and then TLS 1.3. In that case, |
| 7443 | # a TLS 1.3 and TLS 1.2 capable server is supposed to negotiate TLS 1.2 and |
| 7444 | # to indicate in the ServerHello that it downgrades from TLS 1.3. The GnuTLS |
| 7445 | # client then detects the downgrade indication and aborts the handshake even |
| 7446 | # if TLS 1.2 was its preferred version. Keeping the test even if the |
| 7447 | # handshake fails eventually as it exercices parts of the Mbed TLS |
| 7448 | # implementation that are otherwise not exercised. |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7449 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7450 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7451 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7452 | 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] | 7453 | "$P_SRV" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7454 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3" \ |
| 7455 | 1 \ |
| 7456 | -c "Detected downgrade to TLS 1.2 from TLS 1.3" |
| 7457 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7458 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7459 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7460 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7461 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7462 | 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] | 7463 | "$P_SRV min_version=tls13" \ |
| 7464 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7465 | 0 \ |
| 7466 | -S "mbedtls_ssl_handshake returned" \ |
| 7467 | -s "Protocol is TLSv1.3" |
| 7468 | |
| 7469 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7470 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7471 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7472 | 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] | 7473 | "$P_SRV" \ |
| 7474 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7475 | 0 \ |
| 7476 | -S "mbedtls_ssl_handshake returned" \ |
| 7477 | -s "Protocol is TLSv1.2" |
| 7478 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7479 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7480 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7481 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7482 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7483 | 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] | 7484 | "$P_SRV max_version=tls12" \ |
| 7485 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7486 | 0 \ |
| 7487 | -S "mbedtls_ssl_handshake returned" \ |
| 7488 | -s "Protocol is TLSv1.2" |
| 7489 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7490 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7491 | 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] | 7492 | "$P_SRV" \ |
| 7493 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 7494 | 1 \ |
| 7495 | -s "Handshake protocol not within min/max boundaries" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7496 | -S "Protocol is TLSv1.0" |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7497 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7498 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7499 | 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] | 7500 | "$P_SRV" \ |
| 7501 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 7502 | 1 \ |
| 7503 | -s "Handshake protocol not within min/max boundaries" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7504 | -S "Protocol is TLSv1.1" |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7505 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7506 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7507 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7508 | 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] | 7509 | "$P_SRV" \ |
| 7510 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7511 | 1 \ |
| 7512 | -s "Handshake protocol not within min/max boundaries" \ |
| 7513 | -S "Protocol is TLSv1.2" |
| 7514 | |
| 7515 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7516 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7517 | 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] | 7518 | "$P_SRV" \ |
| 7519 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7520 | 1 \ |
| 7521 | -S "Handshake protocol not within min/max boundaries" \ |
| 7522 | -s "The handshake negotiation failed" \ |
| 7523 | -S "Protocol is TLSv1.3" |
| 7524 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7525 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7528 | 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] | 7529 | "$P_SRV min_version=tls13" \ |
| 7530 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7531 | 1 \ |
| 7532 | -s "Handshake protocol not within min/max boundaries" \ |
| 7533 | -S "Protocol is TLSv1.2" |
| 7534 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7535 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7536 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7537 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7538 | 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] | 7539 | "$P_SRV max_version=tls12" \ |
| 7540 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7541 | 1 \ |
| 7542 | -S "Handshake protocol not within min/max boundaries" \ |
| 7543 | -s "The handshake negotiation failed" \ |
| 7544 | -S "Protocol is TLSv1.3" |
| 7545 | |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7546 | # Tests of version negotiation on server side against OpenSSL client |
| 7547 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7548 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7549 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7550 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7551 | 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] | 7552 | "$P_SRV" \ |
| 7553 | "$O_NEXT_CLI -tls1_2" \ |
| 7554 | 0 \ |
| 7555 | -S "mbedtls_ssl_handshake returned" \ |
| 7556 | -s "Protocol is TLSv1.2" |
| 7557 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7558 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7559 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7560 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7561 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7562 | 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] | 7563 | "$P_SRV max_version=tls12" \ |
| 7564 | "$O_NEXT_CLI -tls1_2" \ |
| 7565 | 0 \ |
| 7566 | -S "mbedtls_ssl_handshake returned" \ |
| 7567 | -s "Protocol is TLSv1.2" |
| 7568 | |
| 7569 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7570 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7571 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7572 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7573 | 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] | 7574 | "$P_SRV" \ |
| 7575 | "$O_NEXT_CLI -tls1_3" \ |
| 7576 | 0 \ |
| 7577 | -S "mbedtls_ssl_handshake returned" \ |
| 7578 | -s "Protocol is TLSv1.3" |
| 7579 | |
| 7580 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7581 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7582 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7583 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7584 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7585 | 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] | 7586 | "$P_SRV min_version=tls13" \ |
| 7587 | "$O_NEXT_CLI -tls1_3" \ |
| 7588 | 0 \ |
| 7589 | -S "mbedtls_ssl_handshake returned" \ |
| 7590 | -s "Protocol is TLSv1.3" |
| 7591 | |
| 7592 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7593 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7594 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7595 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7596 | 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] | 7597 | "$P_SRV" \ |
| 7598 | "$O_NEXT_CLI" \ |
| 7599 | 0 \ |
| 7600 | -S "mbedtls_ssl_handshake returned" \ |
| 7601 | -s "Protocol is TLSv1.3" |
| 7602 | |
| 7603 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7604 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7605 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7606 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7607 | 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] | 7608 | "$P_SRV" \ |
| 7609 | "$O_NEXT_CLI -no_middlebox" \ |
| 7610 | 0 \ |
| 7611 | -S "mbedtls_ssl_handshake returned" \ |
| 7612 | -s "Protocol is TLSv1.3" |
| 7613 | |
| 7614 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7615 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7616 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7617 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7618 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7619 | 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] | 7620 | "$P_SRV min_version=tls13" \ |
| 7621 | "$O_NEXT_CLI" \ |
| 7622 | 0 \ |
| 7623 | -S "mbedtls_ssl_handshake returned" \ |
| 7624 | -s "Protocol is TLSv1.3" |
| 7625 | |
| 7626 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7627 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7628 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7629 | 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] | 7630 | "$P_SRV" \ |
| 7631 | "$O_NEXT_CLI" \ |
| 7632 | 0 \ |
| 7633 | -S "mbedtls_ssl_handshake returned" \ |
| 7634 | -s "Protocol is TLSv1.2" |
| 7635 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7636 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7637 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7638 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7639 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7640 | 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] | 7641 | "$P_SRV max_version=tls12" \ |
| 7642 | "$O_NEXT_CLI" \ |
| 7643 | 0 \ |
| 7644 | -S "mbedtls_ssl_handshake returned" \ |
| 7645 | -s "Protocol is TLSv1.2" |
| 7646 | |
| 7647 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7648 | 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] | 7649 | "$P_SRV" \ |
| 7650 | "$O_CLI -tls1" \ |
| 7651 | 1 \ |
| 7652 | -s "Handshake protocol not within min/max boundaries" \ |
| 7653 | -S "Protocol is TLSv1.0" |
| 7654 | |
| 7655 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7656 | 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] | 7657 | "$P_SRV" \ |
| 7658 | "$O_CLI -tls1_1" \ |
| 7659 | 1 \ |
| 7660 | -s "Handshake protocol not within min/max boundaries" \ |
| 7661 | -S "Protocol is TLSv1.1" |
| 7662 | |
| 7663 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7664 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7665 | 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] | 7666 | "$P_SRV" \ |
| 7667 | "$O_NEXT_CLI -tls1_2" \ |
| 7668 | 1 \ |
| 7669 | -s "Handshake protocol not within min/max boundaries" \ |
| 7670 | -S "Protocol is TLSv1.2" |
| 7671 | |
| 7672 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7673 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7674 | 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] | 7675 | "$P_SRV" \ |
| 7676 | "$O_NEXT_CLI -tls1_3" \ |
| 7677 | 1 \ |
| 7678 | -S "Handshake protocol not within min/max boundaries" \ |
| 7679 | -s "The handshake negotiation failed" \ |
| 7680 | -S "Protocol is TLSv1.3" |
| 7681 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7682 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7683 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7684 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7685 | 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] | 7686 | "$P_SRV min_version=tls13" \ |
| 7687 | "$O_NEXT_CLI -tls1_2" \ |
| 7688 | 1 \ |
| 7689 | -s "Handshake protocol not within min/max boundaries" \ |
| 7690 | -S "Protocol is TLSv1.2" |
| 7691 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7692 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7693 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7694 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7695 | 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] | 7696 | "$P_SRV max_version=tls12" \ |
| 7697 | "$O_NEXT_CLI -tls1_3" \ |
| 7698 | 1 \ |
| 7699 | -S "Handshake protocol not within min/max boundaries" \ |
| 7700 | -s "The handshake negotiation failed" \ |
| 7701 | -S "Protocol is TLSv1.3" |
| 7702 | |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7703 | # Tests of version negotiation on client side against GnuTLS and OpenSSL server |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7704 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7705 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7706 | run_test "Not supported version: srv max TLS 1.0" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7707 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 7708 | "$P_CLI" \ |
| 7709 | 1 \ |
| 7710 | -s "Error in protocol version" \ |
| 7711 | -c "Handshake protocol not within min/max boundaries" \ |
| 7712 | -S "Version: TLS1.0" \ |
| 7713 | -C "Protocol is TLSv1.0" |
| 7714 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7715 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7716 | run_test "Not supported version: srv max TLS 1.1" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7717 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 7718 | "$P_CLI" \ |
| 7719 | 1 \ |
| 7720 | -s "Error in protocol version" \ |
| 7721 | -c "Handshake protocol not within min/max boundaries" \ |
| 7722 | -S "Version: TLS1.1" \ |
| 7723 | -C "Protocol is TLSv1.1" |
| 7724 | |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7725 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7726 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7727 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7728 | skip_handshake_stage_check |
| 7729 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7730 | 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] | 7731 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \ |
| 7732 | "$P_CLI debug_level=4" \ |
| 7733 | 1 \ |
| 7734 | -s "Client's version: 3.3" \ |
| 7735 | -S "Version: TLS1.0" \ |
| 7736 | -C "Protocol is TLSv1.0" |
| 7737 | |
| 7738 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7739 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7740 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7741 | skip_handshake_stage_check |
| 7742 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7743 | 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] | 7744 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \ |
| 7745 | "$P_CLI debug_level=4" \ |
| 7746 | 1 \ |
| 7747 | -s "Client's version: 3.3" \ |
| 7748 | -S "Version: TLS1.1" \ |
| 7749 | -C "Protocol is TLSv1.1" |
| 7750 | |
| 7751 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7752 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7753 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7754 | skip_handshake_stage_check |
| 7755 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7756 | 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] | 7757 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \ |
| 7758 | "$P_CLI force_version=tls13 debug_level=4" \ |
| 7759 | 1 \ |
| 7760 | -s "Client's version: 3.3" \ |
| 7761 | -c "is a fatal alert message (msg 40)" \ |
| 7762 | -S "Version: TLS1.2" \ |
| 7763 | -C "Protocol is TLSv1.2" |
| 7764 | |
| 7765 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7766 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7767 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7768 | skip_handshake_stage_check |
| 7769 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7770 | 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] | 7771 | "$O_NEXT_SRV -msg -tls1" \ |
| 7772 | "$P_CLI debug_level=4" \ |
| 7773 | 1 \ |
| 7774 | -s "fatal protocol_version" \ |
| 7775 | -c "is a fatal alert message (msg 70)" \ |
| 7776 | -S "Version: TLS1.0" \ |
| 7777 | -C "Protocol : TLSv1.0" |
| 7778 | |
| 7779 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7780 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7781 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7782 | skip_handshake_stage_check |
| 7783 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7784 | 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] | 7785 | "$O_NEXT_SRV -msg -tls1_1" \ |
| 7786 | "$P_CLI debug_level=4" \ |
| 7787 | 1 \ |
| 7788 | -s "fatal protocol_version" \ |
| 7789 | -c "is a fatal alert message (msg 70)" \ |
| 7790 | -S "Version: TLS1.1" \ |
| 7791 | -C "Protocol : TLSv1.1" |
| 7792 | |
| 7793 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7794 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7795 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7796 | skip_handshake_stage_check |
| 7797 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7798 | 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] | 7799 | "$O_NEXT_SRV -msg -tls1_2" \ |
| 7800 | "$P_CLI force_version=tls13 debug_level=4" \ |
| 7801 | 1 \ |
| 7802 | -s "fatal protocol_version" \ |
| 7803 | -c "is a fatal alert message (msg 70)" \ |
| 7804 | -S "Version: TLS1.2" \ |
| 7805 | -C "Protocol : TLSv1.2" |
| 7806 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7807 | # Tests for ALPN extension |
| 7808 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7809 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7810 | "$P_SRV debug_level=3" \ |
| 7811 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7812 | 0 \ |
| 7813 | -C "client hello, adding alpn extension" \ |
| 7814 | -S "found alpn extension" \ |
| 7815 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7816 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7817 | -C "found alpn extension " \ |
| 7818 | -C "Application Layer Protocol is" \ |
| 7819 | -S "Application Layer Protocol is" |
| 7820 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7821 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7822 | "$P_SRV debug_level=3" \ |
| 7823 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7824 | 0 \ |
| 7825 | -c "client hello, adding alpn extension" \ |
| 7826 | -s "found alpn extension" \ |
| 7827 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7828 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7829 | -C "found alpn extension " \ |
| 7830 | -c "Application Layer Protocol is (none)" \ |
| 7831 | -S "Application Layer Protocol is" |
| 7832 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7833 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7834 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7835 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7836 | 0 \ |
| 7837 | -C "client hello, adding alpn extension" \ |
| 7838 | -S "found alpn extension" \ |
| 7839 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7840 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7841 | -C "found alpn extension " \ |
| 7842 | -C "Application Layer Protocol is" \ |
| 7843 | -s "Application Layer Protocol is (none)" |
| 7844 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7845 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7846 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7847 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7848 | 0 \ |
| 7849 | -c "client hello, adding alpn extension" \ |
| 7850 | -s "found alpn extension" \ |
| 7851 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7852 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7853 | -c "found alpn extension" \ |
| 7854 | -c "Application Layer Protocol is abc" \ |
| 7855 | -s "Application Layer Protocol is abc" |
| 7856 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7857 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7858 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7859 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7860 | 0 \ |
| 7861 | -c "client hello, adding alpn extension" \ |
| 7862 | -s "found alpn extension" \ |
| 7863 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7864 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7865 | -c "found alpn extension" \ |
| 7866 | -c "Application Layer Protocol is abc" \ |
| 7867 | -s "Application Layer Protocol is abc" |
| 7868 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7869 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7870 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7871 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7872 | 0 \ |
| 7873 | -c "client hello, adding alpn extension" \ |
| 7874 | -s "found alpn extension" \ |
| 7875 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7876 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7877 | -c "found alpn extension" \ |
| 7878 | -c "Application Layer Protocol is 1234" \ |
| 7879 | -s "Application Layer Protocol is 1234" |
| 7880 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7881 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7882 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 7883 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7884 | 1 \ |
| 7885 | -c "client hello, adding alpn extension" \ |
| 7886 | -s "found alpn extension" \ |
| 7887 | -c "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7888 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7889 | -C "found alpn extension" \ |
| 7890 | -C "Application Layer Protocol is 1234" \ |
| 7891 | -S "Application Layer Protocol is 1234" |
| 7892 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 7893 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7894 | # Tests for keyUsage in leaf certificates, part 1: |
| 7895 | # server-side certificate/suite selection |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7896 | # |
| 7897 | # This is only about 1.2 (for 1.3, all key exchanges use signatures). |
| 7898 | # In 4.0 this will probably go away as all TLS 1.2 key exchanges will use |
| 7899 | # 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] | 7900 | |
Valerio Setti | 98f348a | 2025-01-30 12:10:28 +0100 | [diff] [blame] | 7901 | run_test "keyUsage srv 1.2: RSA, digitalSignature -> ECDHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7902 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7903 | crt_file=$DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7904 | "$P_CLI" \ |
| 7905 | 0 \ |
Valerio Setti | 98f348a | 2025-01-30 12:10:28 +0100 | [diff] [blame] | 7906 | -c "Ciphersuite is TLS-ECDHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7907 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7908 | run_test "keyUsage srv 1.2: RSA, keyEncipherment -> RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7909 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7910 | crt_file=$DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7911 | "$P_CLI" \ |
| 7912 | 0 \ |
| 7913 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 7914 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7915 | run_test "keyUsage srv 1.2: RSA, keyAgreement -> fail" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7916 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7917 | crt_file=$DATA_FILES_PATH/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 7918 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7919 | 1 \ |
| 7920 | -C "Ciphersuite is " |
| 7921 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 7922 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7923 | run_test "keyUsage srv 1.2: ECC, digitalSignature -> ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7924 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7925 | crt_file=$DATA_FILES_PATH/server5.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7926 | "$P_CLI" \ |
| 7927 | 0 \ |
| 7928 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 7929 | |
| 7930 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7931 | run_test "keyUsage srv 1.2: ECC, keyAgreement -> ECDH-" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7932 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7933 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7934 | "$P_CLI" \ |
| 7935 | 0 \ |
| 7936 | -c "Ciphersuite is TLS-ECDH-" |
| 7937 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7938 | run_test "keyUsage srv 1.2: ECC, keyEncipherment -> fail" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7939 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7940 | crt_file=$DATA_FILES_PATH/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 7941 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7942 | 1 \ |
| 7943 | -C "Ciphersuite is " |
| 7944 | |
| 7945 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7946 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7947 | # |
| 7948 | # TLS 1.3 uses only signature, but for 1.2 it depends on the key exchange. |
| 7949 | # In 4.0 this will probably change as all TLS 1.2 key exchanges will use |
| 7950 | # 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] | 7951 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7952 | run_test "keyUsage cli 1.2: DigitalSignature+KeyEncipherment, RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7953 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7954 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7955 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7956 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7957 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7958 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7959 | -C "Processing of the Certificate handshake message failed" \ |
| 7960 | -c "Ciphersuite is TLS-" |
| 7961 | |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 7962 | run_test "keyUsage cli 1.2: DigitalSignature+KeyEncipherment, ECDHE-RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7963 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7964 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7965 | "$P_CLI debug_level=1 \ |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 7966 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7967 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7968 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7969 | -C "Processing of the Certificate handshake message failed" \ |
| 7970 | -c "Ciphersuite is TLS-" |
| 7971 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7972 | run_test "keyUsage cli 1.2: KeyEncipherment, RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7973 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7974 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7975 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7976 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7977 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7978 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7979 | -C "Processing of the Certificate handshake message failed" \ |
| 7980 | -c "Ciphersuite is TLS-" |
| 7981 | |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 7982 | run_test "keyUsage cli 1.2: KeyEncipherment, ECDHE-RSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7983 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7984 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7985 | "$P_CLI debug_level=3 \ |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 7986 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7987 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7988 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7989 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7990 | -C "Ciphersuite is TLS-" \ |
| 7991 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7992 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7993 | # 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] | 7994 | |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 7995 | run_test "keyUsage cli 1.2: KeyEncipherment, ECDHE-RSA: fail (soft)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7996 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7997 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7998 | "$P_CLI debug_level=3 auth_mode=optional \ |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 7999 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 8000 | 0 \ |
| 8001 | -c "bad certificate (usage extensions)" \ |
| 8002 | -C "Processing of the Certificate handshake message failed" \ |
| 8003 | -c "Ciphersuite is TLS-" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 8004 | -C "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 8005 | -c "! Usage does not match the keyUsage extension" |
| 8006 | |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 8007 | run_test "keyUsage cli 1.2: DigitalSignature, ECDHE-RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8008 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8009 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8010 | "$P_CLI debug_level=1 \ |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 8011 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 8012 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8013 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 8014 | -C "Processing of the Certificate handshake message failed" \ |
| 8015 | -c "Ciphersuite is TLS-" |
| 8016 | |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8017 | run_test "keyUsage cli 1.2: DigitalSignature, RSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8018 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8019 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 8020 | "$P_CLI debug_level=3 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 8021 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8022 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8023 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 8024 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 8025 | -C "Ciphersuite is TLS-" \ |
| 8026 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8027 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 8028 | # 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] | 8029 | |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8030 | run_test "keyUsage cli 1.2: DigitalSignature, RSA: fail (soft)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8031 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8032 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 8033 | "$P_CLI debug_level=3 auth_mode=optional \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 8034 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8035 | 0 \ |
| 8036 | -c "bad certificate (usage extensions)" \ |
| 8037 | -C "Processing of the Certificate handshake message failed" \ |
| 8038 | -c "Ciphersuite is TLS-" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 8039 | -C "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 8040 | -c "! Usage does not match the keyUsage extension" |
| 8041 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8042 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8043 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8044 | run_test "keyUsage cli 1.3: DigitalSignature, RSA: OK" \ |
| 8045 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 8046 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds.crt" \ |
| 8047 | "$P_CLI debug_level=3" \ |
| 8048 | 0 \ |
| 8049 | -C "bad certificate (usage extensions)" \ |
| 8050 | -C "Processing of the Certificate handshake message failed" \ |
| 8051 | -c "Ciphersuite is" |
| 8052 | |
| 8053 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8054 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8055 | run_test "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8056 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 8057 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds_ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8058 | "$P_CLI debug_level=3" \ |
| 8059 | 0 \ |
| 8060 | -C "bad certificate (usage extensions)" \ |
| 8061 | -C "Processing of the Certificate handshake message failed" \ |
| 8062 | -c "Ciphersuite is" |
| 8063 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8064 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8065 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8066 | run_test "keyUsage cli 1.3: KeyEncipherment, RSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8067 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 8068 | -cert $DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8069 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8070 | 1 \ |
| 8071 | -c "bad certificate (usage extensions)" \ |
| 8072 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8073 | -C "Ciphersuite is" \ |
| 8074 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8075 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8076 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8077 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8078 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8079 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8080 | run_test "keyUsage cli 1.3: KeyAgreement, RSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8081 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 8082 | -cert $DATA_FILES_PATH/server2-sha256.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8083 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8084 | 1 \ |
| 8085 | -c "bad certificate (usage extensions)" \ |
| 8086 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8087 | -C "Ciphersuite is" \ |
| 8088 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8089 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8090 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8091 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8092 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8093 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8094 | run_test "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8095 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8096 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8097 | "$P_CLI debug_level=3" \ |
| 8098 | 0 \ |
| 8099 | -C "bad certificate (usage extensions)" \ |
| 8100 | -C "Processing of the Certificate handshake message failed" \ |
| 8101 | -c "Ciphersuite is" |
| 8102 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8103 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8104 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8105 | run_test "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8106 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8107 | -cert $DATA_FILES_PATH/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8108 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8109 | 1 \ |
| 8110 | -c "bad certificate (usage extensions)" \ |
| 8111 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8112 | -C "Ciphersuite is" \ |
| 8113 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8114 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8115 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8116 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8117 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8118 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8119 | run_test "keyUsage cli 1.3: KeyAgreement, ECDSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8120 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8121 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8122 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8123 | 1 \ |
| 8124 | -c "bad certificate (usage extensions)" \ |
| 8125 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8126 | -C "Ciphersuite is" \ |
| 8127 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8128 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8129 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8130 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8131 | # Tests for keyUsage in leaf certificates, part 3: |
| 8132 | # server-side checking of client cert |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8133 | # |
| 8134 | # Here, both 1.2 and 1.3 only use signatures. |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8135 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8136 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8137 | run_test "keyUsage cli-auth 1.2: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8138 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8139 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8140 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8141 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8142 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8143 | -S "bad certificate (usage extensions)" \ |
| 8144 | -S "Processing of the Certificate handshake message failed" |
| 8145 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8147 | run_test "keyUsage cli-auth 1.2: RSA, DigitalSignature+KeyEncipherment: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8148 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8149 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8150 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
| 8151 | 0 \ |
| 8152 | -s "Verifying peer X.509 certificate... ok" \ |
| 8153 | -S "bad certificate (usage extensions)" \ |
| 8154 | -S "Processing of the Certificate handshake message failed" |
| 8155 | |
| 8156 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8157 | run_test "keyUsage cli-auth 1.2: RSA, KeyEncipherment: fail (soft)" \ |
| 8158 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8159 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8160 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8161 | 0 \ |
| 8162 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8163 | -S "send alert level=2 message=43" \ |
| 8164 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8165 | -S "Processing of the Certificate handshake message failed" |
| 8166 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8167 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8168 | run_test "keyUsage cli-auth 1.2: RSA, KeyEncipherment: fail (hard)" \ |
| 8169 | "$P_SRV debug_level=3 force_version=tls12 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8170 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8171 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8172 | 1 \ |
| 8173 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8174 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8175 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8176 | -s "Processing of the Certificate handshake message failed" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8177 | # 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] | 8178 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8179 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8180 | run_test "keyUsage cli-auth 1.2: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8181 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8182 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8183 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8184 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8185 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8186 | -S "bad certificate (usage extensions)" \ |
| 8187 | -S "Processing of the Certificate handshake message failed" |
| 8188 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8189 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8190 | run_test "keyUsage cli-auth 1.2: ECDSA, KeyAgreement: fail (soft)" \ |
| 8191 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8192 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8193 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8194 | 0 \ |
| 8195 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8196 | -S "send alert level=2 message=43" \ |
| 8197 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8198 | -S "Processing of the Certificate handshake message failed" |
| 8199 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8201 | run_test "keyUsage cli-auth 1.2: ECDSA, KeyAgreement: fail (hard)" \ |
| 8202 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 8203 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8204 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
| 8205 | 1 \ |
| 8206 | -s "bad certificate (usage extensions)" \ |
| 8207 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8208 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8209 | -s "Processing of the Certificate handshake message failed" |
| 8210 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8211 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8212 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8213 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8214 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8215 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8216 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
| 8217 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8218 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8219 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8220 | -S "bad certificate (usage extensions)" \ |
| 8221 | -S "Processing of the Certificate handshake message failed" |
| 8222 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8223 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8224 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8225 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature+KeyEncipherment: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8226 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8227 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8228 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds_ke.crt" \ |
| 8229 | 0 \ |
| 8230 | -s "Verifying peer X.509 certificate... ok" \ |
| 8231 | -S "bad certificate (usage extensions)" \ |
| 8232 | -S "Processing of the Certificate handshake message failed" |
| 8233 | |
| 8234 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8235 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8236 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ |
| 8237 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
| 8238 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8239 | -cert $DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8240 | 0 \ |
| 8241 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8242 | -S "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8243 | -s "! Usage does not match the keyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8244 | -S "Processing of the Certificate handshake message failed" |
| 8245 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8246 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8247 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8248 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (hard)" \ |
| 8249 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=required" \ |
Manuel Pégourié-Gonnard | aeda1fd | 2024-08-12 09:50:18 +0200 | [diff] [blame] | 8250 | "$P_CLI key_file=$DATA_FILES_PATH/server2.key \ |
| 8251 | crt_file=$DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
| 8252 | 1 \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8253 | -s "bad certificate (usage extensions)" \ |
| 8254 | -s "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8255 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8256 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8257 | -s "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8258 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8259 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8260 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8261 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8262 | run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8263 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8264 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8265 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8266 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8267 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8268 | -S "bad certificate (usage extensions)" \ |
| 8269 | -S "Processing of the Certificate handshake message failed" |
| 8270 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8271 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8272 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8273 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8274 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8275 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8276 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8277 | 0 \ |
| 8278 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8279 | -s "! Usage does not match the keyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8280 | -S "Processing of the Certificate handshake message failed" |
| 8281 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8282 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8283 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8284 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (hard)" \ |
| 8285 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=required" \ |
Manuel Pégourié-Gonnard | aeda1fd | 2024-08-12 09:50:18 +0200 | [diff] [blame] | 8286 | "$P_CLI key_file=$DATA_FILES_PATH/server5.key \ |
| 8287 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
| 8288 | 1 \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8289 | -s "bad certificate (usage extensions)" \ |
| 8290 | -s "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8291 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8292 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8293 | -s "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8294 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 8295 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8296 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 8297 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8298 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8299 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8300 | crt_file=$DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8301 | "$P_CLI" \ |
| 8302 | 0 |
| 8303 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8304 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8305 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8306 | crt_file=$DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8307 | "$P_CLI" \ |
| 8308 | 0 |
| 8309 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8310 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8311 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8312 | crt_file=$DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8313 | "$P_CLI" \ |
| 8314 | 0 |
| 8315 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8316 | run_test "extKeyUsage srv: codeSign -> fail" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8317 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8318 | crt_file=$DATA_FILES_PATH/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 8319 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8320 | 1 |
| 8321 | |
| 8322 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 8323 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8324 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8325 | run_test "extKeyUsage cli 1.2: serverAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8326 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8327 | -cert $DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8328 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8329 | 0 \ |
| 8330 | -C "bad certificate (usage extensions)" \ |
| 8331 | -C "Processing of the Certificate handshake message failed" \ |
| 8332 | -c "Ciphersuite is TLS-" |
| 8333 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8334 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8335 | run_test "extKeyUsage cli 1.2: serverAuth,clientAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8336 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8337 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8338 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8339 | 0 \ |
| 8340 | -C "bad certificate (usage extensions)" \ |
| 8341 | -C "Processing of the Certificate handshake message failed" \ |
| 8342 | -c "Ciphersuite is TLS-" |
| 8343 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8344 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8345 | run_test "extKeyUsage cli 1.2: codeSign,anyEKU -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8346 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8347 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8348 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8349 | 0 \ |
| 8350 | -C "bad certificate (usage extensions)" \ |
| 8351 | -C "Processing of the Certificate handshake message failed" \ |
| 8352 | -c "Ciphersuite is TLS-" |
| 8353 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8354 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | f48bfb0 | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8355 | run_test "extKeyUsage cli 1.2: codeSign -> fail (soft)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8356 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8357 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | f48bfb0 | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8358 | "$P_CLI debug_level=3 auth_mode=optional" \ |
| 8359 | 0 \ |
| 8360 | -c "bad certificate (usage extensions)" \ |
| 8361 | -C "Processing of the Certificate handshake message failed" \ |
| 8362 | -c "Ciphersuite is TLS-" \ |
| 8363 | -C "send alert level=2 message=43" \ |
| 8364 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8365 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8366 | |
| 8367 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8368 | run_test "extKeyUsage cli 1.2: codeSign -> fail (hard)" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 8369 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8370 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8371 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8372 | 1 \ |
| 8373 | -c "bad certificate (usage extensions)" \ |
| 8374 | -c "Processing of the Certificate handshake message failed" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8375 | -C "Ciphersuite is TLS-" \ |
| 8376 | -c "send alert level=2 message=43" \ |
| 8377 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8378 | # 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] | 8379 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8380 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8381 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8382 | run_test "extKeyUsage cli 1.3: serverAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8383 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8384 | -cert $DATA_FILES_PATH/server5.eku-srv.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8385 | "$P_CLI debug_level=1" \ |
| 8386 | 0 \ |
| 8387 | -C "bad certificate (usage extensions)" \ |
| 8388 | -C "Processing of the Certificate handshake message failed" \ |
| 8389 | -c "Ciphersuite is" |
| 8390 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8391 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8392 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8393 | run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8394 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8395 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8396 | "$P_CLI debug_level=1" \ |
| 8397 | 0 \ |
| 8398 | -C "bad certificate (usage extensions)" \ |
| 8399 | -C "Processing of the Certificate handshake message failed" \ |
| 8400 | -c "Ciphersuite is" |
| 8401 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8402 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8403 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8404 | run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8405 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8406 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8407 | "$P_CLI debug_level=1" \ |
| 8408 | 0 \ |
| 8409 | -C "bad certificate (usage extensions)" \ |
| 8410 | -C "Processing of the Certificate handshake message failed" \ |
| 8411 | -c "Ciphersuite is" |
| 8412 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8413 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8414 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8415 | run_test "extKeyUsage cli 1.3: codeSign -> fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8416 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8417 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8418 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8419 | 1 \ |
| 8420 | -c "bad certificate (usage extensions)" \ |
| 8421 | -c "Processing of the Certificate handshake message failed" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8422 | -C "Ciphersuite is" \ |
| 8423 | -c "send alert level=2 message=43" \ |
| 8424 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8425 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8426 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8427 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 8428 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8429 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8430 | run_test "extKeyUsage cli-auth 1.2: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8431 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8432 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8433 | -cert $DATA_FILES_PATH/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8434 | 0 \ |
| 8435 | -S "bad certificate (usage extensions)" \ |
| 8436 | -S "Processing of the Certificate handshake message failed" |
| 8437 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8438 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8439 | run_test "extKeyUsage cli-auth 1.2: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8440 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8441 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8442 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8443 | 0 \ |
| 8444 | -S "bad certificate (usage extensions)" \ |
| 8445 | -S "Processing of the Certificate handshake message failed" |
| 8446 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8447 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8448 | run_test "extKeyUsage cli-auth 1.2: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8449 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8450 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8451 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8452 | 0 \ |
| 8453 | -S "bad certificate (usage extensions)" \ |
| 8454 | -S "Processing of the Certificate handshake message failed" |
| 8455 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8456 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8457 | run_test "extKeyUsage cli-auth 1.2: codeSign -> fail (soft)" \ |
| 8458 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8459 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8460 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8461 | 0 \ |
| 8462 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8463 | -S "send alert level=2 message=43" \ |
| 8464 | -s "! Usage does not match the extendedKeyUsage extension" \ |
| 8465 | -S "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8466 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8467 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8468 | run_test "extKeyUsage cli-auth 1.2: codeSign -> fail (hard)" \ |
| 8469 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8470 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8471 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8472 | 1 \ |
| 8473 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8474 | -s "send alert level=2 message=43" \ |
| 8475 | -s "! Usage does not match the extendedKeyUsage extension" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8476 | -s "Processing of the Certificate handshake message failed" |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8477 | # 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] | 8478 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8479 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8480 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8481 | run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8482 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8483 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8484 | -cert $DATA_FILES_PATH/server5.eku-cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8485 | 0 \ |
| 8486 | -S "bad certificate (usage extensions)" \ |
| 8487 | -S "Processing of the Certificate handshake message failed" |
| 8488 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8489 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8490 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8491 | run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8492 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8493 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8494 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8495 | 0 \ |
| 8496 | -S "bad certificate (usage extensions)" \ |
| 8497 | -S "Processing of the Certificate handshake message failed" |
| 8498 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8499 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8500 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8501 | run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8502 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8503 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8504 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8505 | 0 \ |
| 8506 | -S "bad certificate (usage extensions)" \ |
| 8507 | -S "Processing of the Certificate handshake message failed" |
| 8508 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8509 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8510 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8511 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8512 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8513 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8514 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8515 | 0 \ |
| 8516 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8517 | -S "send alert level=2 message=43" \ |
| 8518 | -s "! Usage does not match the extendedKeyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8519 | -S "Processing of the Certificate handshake message failed" |
| 8520 | |
Elena Uziunaite | f48bfb0 | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8521 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8522 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Elena Uziunaite | f48bfb0 | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8523 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (hard)" \ |
| 8524 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=required" \ |
| 8525 | "$P_CLI key_file=$DATA_FILES_PATH/server5.key \ |
| 8526 | crt_file=$DATA_FILES_PATH/server5.eku-cs.crt" \ |
| 8527 | 1 \ |
| 8528 | -s "bad certificate (usage extensions)" \ |
| 8529 | -s "send alert level=2 message=43" \ |
| 8530 | -s "! Usage does not match the extendedKeyUsage extension" \ |
| 8531 | -s "Processing of the Certificate handshake message failed" |
| 8532 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8533 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8534 | # Tests for PSK callback |
| 8535 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8536 | run_test "PSK callback: psk, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8537 | "$P_SRV psk=73776f726466697368 psk_identity=foo" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8538 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8539 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8540 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8541 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 8542 | -S "SSL - Unknown identity received" \ |
| 8543 | -S "SSL - Verification of the message MAC failed" |
| 8544 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8545 | run_test "PSK callback: opaque psk on client, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8546 | "$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] | 8547 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8548 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8549 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8550 | -C "session hash for extended master secret"\ |
| 8551 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8552 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8553 | -S "SSL - Unknown identity received" \ |
| 8554 | -S "SSL - Verification of the message MAC failed" |
| 8555 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8556 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8557 | "$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] | 8558 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8559 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8560 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8561 | -C "session hash for extended master secret"\ |
| 8562 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8563 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8564 | -S "SSL - Unknown identity received" \ |
| 8565 | -S "SSL - Verification of the message MAC failed" |
| 8566 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8567 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8568 | "$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] | 8569 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8570 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8571 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8572 | -c "session hash for extended master secret"\ |
| 8573 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8574 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8575 | -S "SSL - Unknown identity received" \ |
| 8576 | -S "SSL - Verification of the message MAC failed" |
| 8577 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8578 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8579 | "$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] | 8580 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8581 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8582 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8583 | -c "session hash for extended master secret"\ |
| 8584 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8585 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8586 | -S "SSL - Unknown identity received" \ |
| 8587 | -S "SSL - Verification of the message MAC failed" |
| 8588 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8589 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8590 | "$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] | 8591 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8592 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8593 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8594 | -C "session hash for extended master secret"\ |
| 8595 | -S "session hash for extended master secret"\ |
| 8596 | -S "SSL - The handshake negotiation failed" \ |
| 8597 | -S "SSL - Unknown identity received" \ |
| 8598 | -S "SSL - Verification of the message MAC failed" |
| 8599 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8600 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8601 | "$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] | 8602 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8603 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8604 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8605 | -C "session hash for extended master secret"\ |
| 8606 | -S "session hash for extended master secret"\ |
| 8607 | -S "SSL - The handshake negotiation failed" \ |
| 8608 | -S "SSL - Unknown identity received" \ |
| 8609 | -S "SSL - Verification of the message MAC failed" |
| 8610 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8611 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 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 | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8613 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8614 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8615 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +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 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8622 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8623 | "$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] | 8624 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8625 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8626 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8627 | -c "session hash for extended master secret"\ |
| 8628 | -s "session hash for extended master secret"\ |
| 8629 | -S "SSL - The handshake negotiation failed" \ |
| 8630 | -S "SSL - Unknown identity received" \ |
| 8631 | -S "SSL - Verification of the message MAC failed" |
| 8632 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8633 | run_test "PSK callback: raw psk on client, static opaque on server, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8634 | "$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] | 8635 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8636 | psk_identity=foo psk=73776f726466697368" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8637 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8638 | -C "session hash for extended master secret"\ |
| 8639 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8640 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8641 | -S "SSL - Unknown identity received" \ |
| 8642 | -S "SSL - Verification of the message MAC failed" |
| 8643 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8644 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8645 | "$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] | 8646 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8647 | psk_identity=foo psk=73776f726466697368" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8648 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8649 | -C "session hash for extended master secret"\ |
| 8650 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8651 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8652 | -S "SSL - Unknown identity received" \ |
| 8653 | -S "SSL - Verification of the message MAC failed" |
| 8654 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8655 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8656 | "$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] | 8657 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8658 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8659 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8660 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8661 | -c "session hash for extended master secret"\ |
| 8662 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8663 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8664 | -S "SSL - Unknown identity received" \ |
| 8665 | -S "SSL - Verification of the message MAC failed" |
| 8666 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8667 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8668 | "$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] | 8669 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8670 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8671 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8672 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8673 | -c "session hash for extended master secret"\ |
| 8674 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8675 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8676 | -S "SSL - Unknown identity received" \ |
| 8677 | -S "SSL - Verification of the message MAC failed" |
| 8678 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8679 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8680 | "$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] | 8681 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8682 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8683 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8684 | -C "session hash for extended master secret"\ |
| 8685 | -S "session hash for extended master secret"\ |
| 8686 | -S "SSL - The handshake negotiation failed" \ |
| 8687 | -S "SSL - Unknown identity received" \ |
| 8688 | -S "SSL - Verification of the message MAC failed" |
| 8689 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8690 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, SHA-384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8691 | "$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] | 8692 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8693 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8694 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8695 | -C "session hash for extended master secret"\ |
| 8696 | -S "session hash for extended master secret"\ |
| 8697 | -S "SSL - The handshake negotiation failed" \ |
| 8698 | -S "SSL - Unknown identity received" \ |
| 8699 | -S "SSL - Verification of the message MAC failed" |
| 8700 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8701 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8702 | "$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] | 8703 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8704 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8705 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8706 | 0 \ |
| 8707 | -c "session hash for extended master secret"\ |
| 8708 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8709 | -S "SSL - The handshake negotiation failed" \ |
| 8710 | -S "SSL - Unknown identity received" \ |
| 8711 | -S "SSL - Verification of the message MAC failed" |
| 8712 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8713 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8714 | "$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] | 8715 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8716 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8717 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8718 | 0 \ |
| 8719 | -c "session hash for extended master secret"\ |
| 8720 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8721 | -S "SSL - The handshake negotiation failed" \ |
| 8722 | -S "SSL - Unknown identity received" \ |
| 8723 | -S "SSL - Verification of the message MAC failed" |
| 8724 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8725 | 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] | 8726 | "$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" \ |
| 8727 | "$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] | 8728 | psk_identity=def psk=beef" \ |
| 8729 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8730 | -C "session hash for extended master secret"\ |
| 8731 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8732 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8733 | -S "SSL - Unknown identity received" \ |
| 8734 | -S "SSL - Verification of the message MAC failed" |
| 8735 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8736 | 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] | 8737 | "$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" \ |
| 8738 | "$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] | 8739 | psk_identity=def psk=beef" \ |
| 8740 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8741 | -C "session hash for extended master secret"\ |
| 8742 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8743 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8744 | -S "SSL - Unknown identity received" \ |
| 8745 | -S "SSL - Verification of the message MAC failed" |
| 8746 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8747 | 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] | 8748 | "$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] | 8749 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8750 | "$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] | 8751 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8752 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8753 | -c "session hash for extended master secret"\ |
| 8754 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8755 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8756 | -S "SSL - Unknown identity received" \ |
| 8757 | -S "SSL - Verification of the message MAC failed" |
| 8758 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8759 | 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] | 8760 | "$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] | 8761 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8762 | "$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] | 8763 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8764 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8765 | -c "session hash for extended master secret"\ |
| 8766 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8767 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8768 | -S "SSL - Unknown identity received" \ |
| 8769 | -S "SSL - Verification of the message MAC failed" |
| 8770 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8771 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 8772 | "$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" \ |
| 8773 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 8774 | psk_identity=def psk=beef" \ |
| 8775 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8776 | -C "session hash for extended master secret"\ |
| 8777 | -S "session hash for extended master secret"\ |
| 8778 | -S "SSL - The handshake negotiation failed" \ |
| 8779 | -S "SSL - Unknown identity received" \ |
| 8780 | -S "SSL - Verification of the message MAC failed" |
| 8781 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8782 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 8783 | "$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" \ |
| 8784 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 8785 | psk_identity=def psk=beef" \ |
| 8786 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8787 | -C "session hash for extended master secret"\ |
| 8788 | -S "session hash for extended master secret"\ |
| 8789 | -S "SSL - The handshake negotiation failed" \ |
| 8790 | -S "SSL - Unknown identity received" \ |
| 8791 | -S "SSL - Verification of the message MAC failed" |
| 8792 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8793 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 8794 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 8795 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8796 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 8797 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8798 | 0 \ |
| 8799 | -c "session hash for extended master secret"\ |
| 8800 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8801 | -S "SSL - The handshake negotiation failed" \ |
| 8802 | -S "SSL - Unknown identity received" \ |
| 8803 | -S "SSL - Verification of the message MAC failed" |
| 8804 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8805 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 8806 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 8807 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8808 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 8809 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8810 | 0 \ |
| 8811 | -c "session hash for extended master secret"\ |
| 8812 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +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 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8817 | run_test "PSK callback: raw psk on client, mismatching static raw PSK on server, opaque PSK from callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8818 | "$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] | 8819 | "$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] | 8820 | psk_identity=def psk=beef" \ |
| 8821 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8822 | -C "session hash for extended master secret"\ |
| 8823 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8824 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8825 | -S "SSL - Unknown identity received" \ |
| 8826 | -S "SSL - Verification of the message MAC failed" |
| 8827 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8828 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, opaque PSK from callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8829 | "$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] | 8830 | "$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] | 8831 | psk_identity=def psk=beef" \ |
| 8832 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8833 | -C "session hash for extended master secret"\ |
| 8834 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8835 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8836 | -S "SSL - Unknown identity received" \ |
| 8837 | -S "SSL - Verification of the message MAC failed" |
| 8838 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8839 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, raw PSK from callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8840 | "$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] | 8841 | "$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] | 8842 | psk_identity=def psk=beef" \ |
| 8843 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8844 | -C "session hash for extended master secret"\ |
| 8845 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8846 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8847 | -S "SSL - Unknown identity received" \ |
| 8848 | -S "SSL - Verification of the message MAC failed" |
| 8849 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8850 | run_test "PSK callback: raw psk on client, id-matching but wrong raw PSK on server, opaque PSK from callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8851 | "$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] | 8852 | "$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] | 8853 | psk_identity=def psk=beef" \ |
| 8854 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8855 | -C "session hash for extended master secret"\ |
| 8856 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8857 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8858 | -S "SSL - Unknown identity received" \ |
| 8859 | -S "SSL - Verification of the message MAC failed" |
| 8860 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8861 | run_test "PSK callback: raw psk on client, matching opaque PSK on server, wrong opaque PSK from callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8862 | "$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] | 8863 | "$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] | 8864 | psk_identity=def psk=beef" \ |
| 8865 | 1 \ |
| 8866 | -s "SSL - Verification of the message MAC failed" |
| 8867 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8868 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 8869 | "$P_SRV" \ |
| 8870 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8871 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 8872 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 8873 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8874 | -S "SSL - Unknown identity received" \ |
| 8875 | -S "SSL - Verification of the message MAC failed" |
| 8876 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8877 | run_test "PSK callback: callback overrides other settings" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8878 | "$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] | 8879 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8880 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8881 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8882 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8883 | -s "SSL - Unknown identity received" \ |
| 8884 | -S "SSL - Verification of the message MAC failed" |
| 8885 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8886 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8887 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 8888 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 8889 | psk_identity=abc psk=dead" \ |
| 8890 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8891 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8892 | -S "SSL - Unknown identity received" \ |
| 8893 | -S "SSL - Verification of the message MAC failed" |
| 8894 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8895 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8896 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 8897 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 8898 | psk_identity=def psk=beef" \ |
| 8899 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8900 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8901 | -S "SSL - Unknown identity received" \ |
| 8902 | -S "SSL - Verification of the message MAC failed" |
| 8903 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8904 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8905 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 8906 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 8907 | psk_identity=ghi psk=beef" \ |
| 8908 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8909 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8910 | -s "SSL - Unknown identity received" \ |
| 8911 | -S "SSL - Verification of the message MAC failed" |
| 8912 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8913 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8914 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 8915 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 8916 | psk_identity=abc psk=beef" \ |
| 8917 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8918 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8919 | -S "SSL - Unknown identity received" \ |
| 8920 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8921 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8922 | # Tests for EC J-PAKE |
| 8923 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 8924 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8925 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8926 | run_test "ECJPAKE: client not configured" \ |
| 8927 | "$P_SRV debug_level=3" \ |
| 8928 | "$P_CLI debug_level=3" \ |
| 8929 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 8930 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8931 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8932 | -S "found ecjpake kkpp extension" \ |
| 8933 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8934 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 8935 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 8936 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 8937 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8938 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 8939 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8940 | run_test "ECJPAKE: server not configured" \ |
| 8941 | "$P_SRV debug_level=3" \ |
| 8942 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 8943 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8944 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 8945 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8946 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8947 | -s "found ecjpake kkpp extension" \ |
| 8948 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8949 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 8950 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 8951 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 8952 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8953 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 8954 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 8955 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 8956 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8957 | run_test "ECJPAKE: working, TLS" \ |
| 8958 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 8959 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 8960 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 8961 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 8962 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8963 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8964 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8965 | -s "found ecjpake kkpp extension" \ |
| 8966 | -S "skip ecjpake kkpp extension" \ |
| 8967 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 8968 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 8969 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 8970 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8971 | -S "SSL - Verification of the message MAC failed" |
| 8972 | |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8973 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 8974 | run_test "ECJPAKE: opaque password client+server, working, TLS" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8975 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 8976 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 8977 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8978 | 0 \ |
| 8979 | -c "add ciphersuite: c0ff" \ |
| 8980 | -c "adding ecjpake_kkpp extension" \ |
Valerio Setti | 661b9bc | 2022-11-29 17:19:25 +0100 | [diff] [blame] | 8981 | -c "using opaque password" \ |
| 8982 | -s "using opaque password" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8983 | -C "re-using cached ecjpake parameters" \ |
| 8984 | -s "found ecjpake kkpp extension" \ |
| 8985 | -S "skip ecjpake kkpp extension" \ |
| 8986 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 8987 | -s "server hello, ecjpake kkpp extension" \ |
| 8988 | -c "found ecjpake_kkpp extension" \ |
| 8989 | -S "SSL - The handshake negotiation failed" \ |
| 8990 | -S "SSL - Verification of the message MAC failed" |
| 8991 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 8992 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 8993 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8994 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 8995 | run_test "ECJPAKE: opaque password client only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8996 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 8997 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 8998 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8999 | 0 \ |
| 9000 | -c "add ciphersuite: c0ff" \ |
| 9001 | -c "adding ecjpake_kkpp extension" \ |
| 9002 | -c "using opaque password" \ |
| 9003 | -S "using opaque password" \ |
| 9004 | -C "re-using cached ecjpake parameters" \ |
| 9005 | -s "found ecjpake kkpp extension" \ |
| 9006 | -S "skip ecjpake kkpp extension" \ |
| 9007 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9008 | -s "server hello, ecjpake kkpp extension" \ |
| 9009 | -c "found ecjpake_kkpp extension" \ |
| 9010 | -S "SSL - The handshake negotiation failed" \ |
| 9011 | -S "SSL - Verification of the message MAC failed" |
| 9012 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9013 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9014 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9015 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9016 | run_test "ECJPAKE: opaque password server only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9017 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9018 | "$P_CLI debug_level=3 ecjpake_pw=bla\ |
| 9019 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9020 | 0 \ |
| 9021 | -c "add ciphersuite: c0ff" \ |
| 9022 | -c "adding ecjpake_kkpp extension" \ |
| 9023 | -C "using opaque password" \ |
| 9024 | -s "using opaque password" \ |
| 9025 | -C "re-using cached ecjpake parameters" \ |
| 9026 | -s "found ecjpake kkpp extension" \ |
| 9027 | -S "skip ecjpake kkpp extension" \ |
| 9028 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9029 | -s "server hello, ecjpake kkpp extension" \ |
| 9030 | -c "found ecjpake_kkpp extension" \ |
| 9031 | -S "SSL - The handshake negotiation failed" \ |
| 9032 | -S "SSL - Verification of the message MAC failed" |
| 9033 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9034 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9035 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9036 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 9037 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9038 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 9039 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9040 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9041 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9042 | -s "SSL - Verification of the message MAC failed" |
| 9043 | |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9044 | server_needs_more_time 1 |
| 9045 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9046 | run_test "ECJPAKE_OPAQUE_PW: opaque password mismatch, TLS" \ |
| 9047 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9048 | "$P_CLI debug_level=3 ecjpake_pw=bad ecjpake_pw_opaque=1 \ |
| 9049 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9050 | 1 \ |
| 9051 | -c "using opaque password" \ |
| 9052 | -s "using opaque password" \ |
| 9053 | -C "re-using cached ecjpake parameters" \ |
| 9054 | -s "SSL - Verification of the message MAC failed" |
| 9055 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9056 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9057 | run_test "ECJPAKE: working, DTLS" \ |
| 9058 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 9059 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 9060 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9061 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9062 | -c "re-using cached ecjpake parameters" \ |
| 9063 | -S "SSL - Verification of the message MAC failed" |
| 9064 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9065 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9066 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 9067 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 9068 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 9069 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9070 | 0 \ |
| 9071 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9072 | -S "SSL - Verification of the message MAC failed" |
| 9073 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9074 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9075 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9076 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 9077 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 9078 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 9079 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9080 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9081 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9082 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9083 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 9084 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9085 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 9086 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 9087 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 9088 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 9089 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9090 | 0 |
| 9091 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 9092 | # Test for ClientHello without extensions |
| 9093 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9094 | # Without extensions, ECC is impossible (no curve negotiation). |
| 9095 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 9096 | requires_gnutls |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9097 | run_test "ClientHello without extensions: RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 9098 | "$P_SRV force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9099 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 9100 | 0 \ |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9101 | -s "Ciphersuite is .*-RSA-WITH-.*" \ |
| 9102 | -S "Ciphersuite is .*-EC.*" \ |
| 9103 | -s "dumping 'client hello extensions' (0 bytes)" |
| 9104 | |
Gilles Peskine | fc73aa0 | 2024-05-13 21:18:41 +0200 | [diff] [blame] | 9105 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_PSK_ENABLED |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9106 | requires_gnutls |
| 9107 | run_test "ClientHello without extensions: PSK" \ |
| 9108 | "$P_SRV force_version=tls12 debug_level=3 psk=73776f726466697368" \ |
Valerio Setti | 98f348a | 2025-01-30 12:10:28 +0100 | [diff] [blame] | 9109 | "$G_CLI --priority=NORMAL:+PSK:-RSA:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION --pskusername=Client_identity --pskkey=73776f726466697368 localhost" \ |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9110 | 0 \ |
| 9111 | -s "Ciphersuite is .*-PSK-.*" \ |
| 9112 | -S "Ciphersuite is .*-EC.*" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 9113 | -s "dumping 'client hello extensions' (0 bytes)" |
| 9114 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9115 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9116 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9117 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9118 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9119 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9120 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9121 | "$P_CLI request_size=100" \ |
| 9122 | 0 \ |
| 9123 | -s "Read from client: 100 bytes read$" |
| 9124 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9125 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9126 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 9127 | "$P_SRV buffer_size=100" \ |
| 9128 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9129 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9130 | -s "Read from client: 101 bytes read (100 + 1)" |
| 9131 | |
| 9132 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9133 | requires_max_content_len 200 |
| 9134 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 9135 | "$P_SRV buffer_size=100" \ |
| 9136 | "$P_CLI request_size=200" \ |
| 9137 | 0 \ |
| 9138 | -s "Read from client: 200 bytes read (100 + 100)" |
| 9139 | |
| 9140 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9141 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
Waleed Elmelegy | bae705c | 2024-01-01 14:21:21 +0000 | [diff] [blame] | 9142 | "$P_SRV buffer_size=100 force_version=tls12" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9143 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 9144 | 0 \ |
| 9145 | -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] | 9146 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9147 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9148 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9149 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9150 | "$P_SRV force_version=tls12" \ |
| 9151 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9152 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9153 | 0 \ |
| 9154 | -s "Read from client: 1 bytes read" |
| 9155 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9156 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9157 | "$P_SRV force_version=tls12" \ |
| 9158 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 9159 | 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] | 9160 | 0 \ |
| 9161 | -s "Read from client: 1 bytes read" |
| 9162 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9163 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9164 | "$P_SRV force_version=tls12" \ |
| 9165 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 9166 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9167 | 0 \ |
| 9168 | -s "Read from client: 1 bytes read" |
| 9169 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9170 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9171 | "$P_SRV force_version=tls12" \ |
| 9172 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9173 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 9174 | 0 \ |
| 9175 | -s "Read from client: 1 bytes read" |
| 9176 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9177 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9178 | "$P_SRV force_version=tls12" \ |
| 9179 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9180 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 9181 | 0 \ |
| 9182 | -s "Read from client: 1 bytes read" |
| 9183 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9184 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9185 | run_test "Small client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9186 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9187 | "$P_CLI request_size=1 \ |
| 9188 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9189 | 0 \ |
| 9190 | -s "Read from client: 1 bytes read" |
| 9191 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9192 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9193 | run_test "Small client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9194 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9195 | "$P_CLI request_size=1 \ |
| 9196 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9197 | 0 \ |
| 9198 | -s "Read from client: 1 bytes read" |
| 9199 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9200 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9201 | |
| 9202 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9203 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9204 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9205 | "$P_CLI dtls=1 request_size=1 \ |
| 9206 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9207 | 0 \ |
| 9208 | -s "Read from client: 1 bytes read" |
| 9209 | |
| 9210 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9211 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9212 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9213 | "$P_CLI dtls=1 request_size=1 \ |
| 9214 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9215 | 0 \ |
| 9216 | -s "Read from client: 1 bytes read" |
| 9217 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9218 | # Tests for small server packets |
| 9219 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9220 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9221 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9222 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9223 | 0 \ |
| 9224 | -c "Read from server: 1 bytes read" |
| 9225 | |
| 9226 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9227 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9228 | "$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] | 9229 | 0 \ |
| 9230 | -c "Read from server: 1 bytes read" |
| 9231 | |
| 9232 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9233 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9234 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9235 | 0 \ |
| 9236 | -c "Read from server: 1 bytes read" |
| 9237 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9238 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9239 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9240 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9241 | 0 \ |
| 9242 | -c "Read from server: 1 bytes read" |
| 9243 | |
| 9244 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9245 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9246 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9247 | 0 \ |
| 9248 | -c "Read from server: 1 bytes read" |
| 9249 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9250 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9251 | run_test "Small server packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9252 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9253 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9254 | 0 \ |
| 9255 | -c "Read from server: 1 bytes read" |
| 9256 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9257 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9258 | run_test "Small server packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9259 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9260 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9261 | 0 \ |
| 9262 | -c "Read from server: 1 bytes read" |
| 9263 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9264 | # Tests for small server packets in DTLS |
| 9265 | |
| 9266 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9267 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9268 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9269 | "$P_CLI dtls=1 \ |
| 9270 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9271 | 0 \ |
| 9272 | -c "Read from server: 1 bytes read" |
| 9273 | |
| 9274 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9275 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9276 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9277 | "$P_CLI dtls=1 \ |
| 9278 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9279 | 0 \ |
| 9280 | -c "Read from server: 1 bytes read" |
| 9281 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9282 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9283 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9284 | # How many fragments do we expect to write $1 bytes? |
| 9285 | fragments_for_write() { |
| 9286 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 9287 | } |
| 9288 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9289 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9290 | "$P_SRV force_version=tls12" \ |
| 9291 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9292 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9293 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9294 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9295 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9296 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9297 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9298 | "$P_SRV force_version=tls12" \ |
| 9299 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 9300 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9301 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9302 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 9303 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9304 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9305 | "$P_SRV force_version=tls12" \ |
| 9306 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 9307 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9308 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9309 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9310 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9311 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9312 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9313 | "$P_SRV force_version=tls12" \ |
| 9314 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9315 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 9316 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9317 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9318 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9319 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9320 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9321 | "$P_SRV force_version=tls12" \ |
| 9322 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9323 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 9324 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9325 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9326 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9327 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9328 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9329 | run_test "Large client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9330 | "$P_SRV" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9331 | "$P_CLI request_size=16383 \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9332 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9333 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9334 | -c "16383 bytes written in $(fragments_for_write 16383) fragments" \ |
| 9335 | -s "Read from client: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9336 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9337 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9338 | run_test "Large client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9339 | "$P_SRV" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9340 | "$P_CLI request_size=16383 \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9341 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9342 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9343 | -c "16383 bytes written in $(fragments_for_write 16383) fragments" \ |
| 9344 | -s "Read from client: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9345 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9346 | # 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] | 9347 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9348 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9349 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9350 | 0 \ |
| 9351 | -c "Read from server: 16384 bytes read" |
| 9352 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9353 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9354 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9355 | "$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] | 9356 | 0 \ |
| 9357 | -s "16384 bytes written in 1 fragments" \ |
| 9358 | -c "Read from server: 16384 bytes read" |
| 9359 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9360 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9361 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9362 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9363 | 0 \ |
| 9364 | -c "Read from server: 16384 bytes read" |
| 9365 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9366 | 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] | 9367 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 9368 | "$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] | 9369 | 0 \ |
| 9370 | -s "16384 bytes written in 1 fragments" \ |
| 9371 | -c "Read from server: 16384 bytes read" |
| 9372 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9373 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9374 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9375 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9376 | 0 \ |
| 9377 | -c "Read from server: 16384 bytes read" |
| 9378 | |
| 9379 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9380 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9381 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9382 | 0 \ |
| 9383 | -c "Read from server: 16384 bytes read" |
| 9384 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9385 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9386 | run_test "Large server packet TLS 1.3 AEAD" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9387 | "$P_SRV response_size=16383" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9388 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9389 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9390 | -c "Read from server: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9391 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9392 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9393 | run_test "Large server packet TLS 1.3 AEAD shorter tag" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9394 | "$P_SRV response_size=16383" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9395 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9396 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9397 | -c "Read from server: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9398 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9399 | # Tests for restartable ECC |
| 9400 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9401 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 9402 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9403 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9404 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9405 | run_test "EC restart: TLS, default" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9406 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9407 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9408 | 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] | 9409 | debug_level=1" \ |
| 9410 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9411 | -C "x509_verify_cert.*4b00" \ |
| 9412 | -C "mbedtls_pk_verify.*4b00" \ |
| 9413 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9414 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9415 | |
| 9416 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9417 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9418 | run_test "EC restart: TLS, max_ops=0" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9419 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9420 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9421 | 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] | 9422 | debug_level=1 ec_max_ops=0" \ |
| 9423 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9424 | -C "x509_verify_cert.*4b00" \ |
| 9425 | -C "mbedtls_pk_verify.*4b00" \ |
| 9426 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9427 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9428 | |
| 9429 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9430 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9431 | run_test "EC restart: TLS, max_ops=65535" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9432 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9433 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9434 | 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] | 9435 | debug_level=1 ec_max_ops=65535" \ |
| 9436 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9437 | -C "x509_verify_cert.*4b00" \ |
| 9438 | -C "mbedtls_pk_verify.*4b00" \ |
| 9439 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9440 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9441 | |
Gilles Peskine | 005370f | 2024-10-24 20:21:46 +0200 | [diff] [blame] | 9442 | # The following test cases for restartable ECDH come in two variants: |
| 9443 | # * The "(USE_PSA)" variant expects the current behavior, which is the behavior |
| 9444 | # from Mbed TLS 3.x when MBEDTLS_USE_PSA_CRYPTO is disabled. This tests |
| 9445 | # the partial implementation where ECDH in TLS is not actually restartable. |
| 9446 | # * The "(no USE_PSA)" variant expects the desired behavior. These test |
| 9447 | # cases cannot currently pass because the implementation of restartable ECC |
| 9448 | # in TLS is partial: ECDH is not actually restartable. This is the behavior |
| 9449 | # from Mbed TLS 3.x when MBEDTLS_USE_PSA_CRYPTO is enabled. |
| 9450 | # |
| 9451 | # As part of resolving https://github.com/Mbed-TLS/mbedtls/issues/7294, |
| 9452 | # we will remove the "(USE_PSA)" test cases and run the "(no USE_PSA)" test |
| 9453 | # cases. |
| 9454 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9455 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9456 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9457 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Gilles Peskine | 005370f | 2024-10-24 20:21:46 +0200 | [diff] [blame] | 9458 | skip_next_test |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9459 | run_test "EC restart: TLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9460 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9461 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9462 | 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] | 9463 | debug_level=1 ec_max_ops=1000" \ |
| 9464 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9465 | -c "x509_verify_cert.*4b00" \ |
| 9466 | -c "mbedtls_pk_verify.*4b00" \ |
| 9467 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9468 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9469 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9470 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9471 | # everything except ECDH (where TLS calls PSA directly). |
| 9472 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9473 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9474 | run_test "EC restart: TLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9475 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9476 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9477 | 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] | 9478 | debug_level=1 ec_max_ops=1000" \ |
| 9479 | 0 \ |
| 9480 | -c "x509_verify_cert.*4b00" \ |
| 9481 | -c "mbedtls_pk_verify.*4b00" \ |
| 9482 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9483 | -c "mbedtls_pk_sign.*4b00" |
| 9484 | |
| 9485 | # This works the same with & without USE_PSA as we never get to ECDH: |
| 9486 | # 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] | 9487 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9488 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9489 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9490 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9491 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9492 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9493 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9494 | 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] | 9495 | debug_level=1 ec_max_ops=1000" \ |
| 9496 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9497 | -c "x509_verify_cert.*4b00" \ |
| 9498 | -C "mbedtls_pk_verify.*4b00" \ |
| 9499 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9500 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9501 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9502 | -c "! mbedtls_ssl_handshake returned" \ |
| 9503 | -c "X509 - Certificate verification failed" |
| 9504 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9505 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9506 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9507 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Gilles Peskine | 005370f | 2024-10-24 20:21:46 +0200 | [diff] [blame] | 9508 | skip_next_test |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9509 | 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] | 9510 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9511 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9512 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9513 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9514 | 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] | 9515 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 9516 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9517 | -c "x509_verify_cert.*4b00" \ |
| 9518 | -c "mbedtls_pk_verify.*4b00" \ |
| 9519 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9520 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9521 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9522 | -C "! mbedtls_ssl_handshake returned" \ |
| 9523 | -C "X509 - Certificate verification failed" |
| 9524 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9525 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9526 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9527 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9528 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9529 | 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] | 9530 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9531 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9532 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9533 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9534 | 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] | 9535 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 9536 | 0 \ |
| 9537 | -c "x509_verify_cert.*4b00" \ |
| 9538 | -c "mbedtls_pk_verify.*4b00" \ |
| 9539 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9540 | -c "mbedtls_pk_sign.*4b00" \ |
| 9541 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9542 | -C "! mbedtls_ssl_handshake returned" \ |
| 9543 | -C "X509 - Certificate verification failed" |
| 9544 | |
| 9545 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9546 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9547 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Gilles Peskine | 005370f | 2024-10-24 20:21:46 +0200 | [diff] [blame] | 9548 | skip_next_test |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9549 | 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] | 9550 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9551 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9552 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9553 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9554 | 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] | 9555 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 9556 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9557 | -C "x509_verify_cert.*4b00" \ |
| 9558 | -c "mbedtls_pk_verify.*4b00" \ |
| 9559 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9560 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9561 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 9562 | -C "! mbedtls_ssl_handshake returned" \ |
| 9563 | -C "X509 - Certificate verification failed" |
| 9564 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9565 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9566 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9567 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9568 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9569 | 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] | 9570 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9571 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9572 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9573 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9574 | 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] | 9575 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 9576 | 0 \ |
| 9577 | -C "x509_verify_cert.*4b00" \ |
| 9578 | -c "mbedtls_pk_verify.*4b00" \ |
| 9579 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9580 | -c "mbedtls_pk_sign.*4b00" \ |
| 9581 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 9582 | -C "! mbedtls_ssl_handshake returned" \ |
| 9583 | -C "X509 - Certificate verification failed" |
| 9584 | |
| 9585 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9586 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9587 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Gilles Peskine | 005370f | 2024-10-24 20:21:46 +0200 | [diff] [blame] | 9588 | skip_next_test |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9589 | run_test "EC restart: DTLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9590 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9591 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9592 | 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] | 9593 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 9594 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9595 | -c "x509_verify_cert.*4b00" \ |
| 9596 | -c "mbedtls_pk_verify.*4b00" \ |
| 9597 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9598 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9599 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9600 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9601 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9602 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9603 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9604 | run_test "EC restart: DTLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9605 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9606 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9607 | 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] | 9608 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 9609 | 0 \ |
| 9610 | -c "x509_verify_cert.*4b00" \ |
| 9611 | -c "mbedtls_pk_verify.*4b00" \ |
| 9612 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9613 | -c "mbedtls_pk_sign.*4b00" |
| 9614 | |
| 9615 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9616 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9617 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Gilles Peskine | 005370f | 2024-10-24 20:21:46 +0200 | [diff] [blame] | 9618 | skip_next_test |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9619 | 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] | 9620 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9621 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9622 | debug_level=1 ec_max_ops=1000" \ |
| 9623 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9624 | -c "x509_verify_cert.*4b00" \ |
| 9625 | -c "mbedtls_pk_verify.*4b00" \ |
| 9626 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9627 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9628 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9629 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9630 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9631 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9632 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9633 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9634 | 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] | 9635 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9636 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9637 | debug_level=1 ec_max_ops=1000" \ |
| 9638 | 0 \ |
| 9639 | -c "x509_verify_cert.*4b00" \ |
| 9640 | -c "mbedtls_pk_verify.*4b00" \ |
| 9641 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9642 | -C "mbedtls_pk_sign.*4b00" |
| 9643 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9644 | # Restartable is only for ECDHE-ECDSA, with another ciphersuite we expect no |
| 9645 | # restartable behaviour at all (not even client auth). |
| 9646 | # This is the same as "EC restart: TLS, max_ops=1000" except with ECDHE-RSA, |
| 9647 | # and all 4 assertions negated. |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9648 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9649 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9650 | run_test "EC restart: TLS, max_ops=1000, ECDHE-RSA" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9651 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9652 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9653 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9654 | debug_level=1 ec_max_ops=1000" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9655 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9656 | -C "x509_verify_cert.*4b00" \ |
| 9657 | -C "mbedtls_pk_verify.*4b00" \ |
| 9658 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9659 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9660 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9661 | # Tests of asynchronous private key support in SSL |
| 9662 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9663 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9664 | run_test "SSL async private: sign, delay=0" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9665 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9666 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9667 | "$P_CLI" \ |
| 9668 | 0 \ |
| 9669 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9670 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9671 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9672 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9673 | run_test "SSL async private: sign, delay=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9674 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9675 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9676 | "$P_CLI" \ |
| 9677 | 0 \ |
| 9678 | -s "Async sign callback: using key slot " \ |
| 9679 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9680 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 9681 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 9682 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 9683 | run_test "SSL async private: sign, delay=2" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9684 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 9685 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 9686 | "$P_CLI" \ |
| 9687 | 0 \ |
| 9688 | -s "Async sign callback: using key slot " \ |
| 9689 | -U "Async sign callback: using key slot " \ |
| 9690 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 9691 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 9692 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 9693 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9694 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 9695 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 9696 | run_test "SSL async private: sign, SNI" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9697 | "$P_SRV force_version=tls12 debug_level=3 \ |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 9698 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9699 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 9700 | 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] | 9701 | "$P_CLI server_name=polarssl.example" \ |
| 9702 | 0 \ |
| 9703 | -s "Async sign callback: using key slot " \ |
| 9704 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 9705 | -s "parse ServerName extension" \ |
| 9706 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 9707 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 9708 | |
| 9709 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9710 | run_test "SSL async private: decrypt, delay=0" \ |
| 9711 | "$P_SRV \ |
| 9712 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 9713 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9714 | 0 \ |
| 9715 | -s "Async decrypt callback: using key slot " \ |
| 9716 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 9717 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9718 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9719 | run_test "SSL async private: decrypt, delay=1" \ |
| 9720 | "$P_SRV \ |
| 9721 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 9722 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9723 | 0 \ |
| 9724 | -s "Async decrypt callback: using key slot " \ |
| 9725 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 9726 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 9727 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9728 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9729 | run_test "SSL async private: sign callback not present" \ |
| 9730 | "$P_SRV \ |
| 9731 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9732 | "$P_CLI force_version=tls12; [ \$? -eq 1 ] && |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9733 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9734 | 0 \ |
| 9735 | -S "Async sign callback" \ |
| 9736 | -s "! mbedtls_ssl_handshake returned" \ |
| 9737 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 9738 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 9739 | -s "Successful connection" |
| 9740 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9741 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9742 | run_test "SSL async private: decrypt callback not present" \ |
| 9743 | "$P_SRV debug_level=1 \ |
| 9744 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 9745 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 9746 | [ \$? -eq 1 ] && $P_CLI force_version=tls12" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9747 | 0 \ |
| 9748 | -S "Async decrypt callback" \ |
| 9749 | -s "! mbedtls_ssl_handshake returned" \ |
| 9750 | -s "got no RSA private key" \ |
| 9751 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 9752 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9753 | |
| 9754 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9755 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9756 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9757 | "$P_SRV \ |
| 9758 | async_operations=s async_private_delay1=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9759 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 9760 | 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] | 9761 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 9762 | 0 \ |
| 9763 | -s "Async sign callback: using key slot 0," \ |
| 9764 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9765 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9766 | |
| 9767 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9768 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9769 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9770 | "$P_SRV \ |
| 9771 | async_operations=s async_private_delay2=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9772 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 9773 | 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] | 9774 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9775 | 0 \ |
| 9776 | -s "Async sign callback: using key slot 0," \ |
| 9777 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9778 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9779 | |
| 9780 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9781 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 9782 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9783 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 9784 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9785 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 9786 | 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] | 9787 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9788 | 0 \ |
| 9789 | -s "Async sign callback: using key slot 1," \ |
| 9790 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9791 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9792 | |
| 9793 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9794 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9795 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9796 | "$P_SRV \ |
| 9797 | async_operations=s async_private_delay1=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9798 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 9799 | 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] | 9800 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9801 | 0 \ |
| 9802 | -s "Async sign callback: no key matches this certificate." |
| 9803 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9804 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 9805 | run_test "SSL async private: sign, error in start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9806 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9807 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 9808 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9809 | "$P_CLI" \ |
| 9810 | 1 \ |
| 9811 | -s "Async sign callback: injected error" \ |
| 9812 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 9813 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9814 | -s "! mbedtls_ssl_handshake returned" |
| 9815 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9816 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 9817 | run_test "SSL async private: sign, cancel after start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9818 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9819 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 9820 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9821 | "$P_CLI" \ |
| 9822 | 1 \ |
| 9823 | -s "Async sign callback: using key slot " \ |
| 9824 | -S "Async resume" \ |
| 9825 | -s "Async cancel" |
| 9826 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9827 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 9828 | run_test "SSL async private: sign, error in resume" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9829 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9830 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 9831 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9832 | "$P_CLI" \ |
| 9833 | 1 \ |
| 9834 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9835 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 9836 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9837 | -s "! mbedtls_ssl_handshake returned" |
| 9838 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9839 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 9840 | run_test "SSL async private: decrypt, error in start" \ |
| 9841 | "$P_SRV \ |
| 9842 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 9843 | async_private_error=1" \ |
| 9844 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9845 | 1 \ |
| 9846 | -s "Async decrypt callback: injected error" \ |
| 9847 | -S "Async resume" \ |
| 9848 | -S "Async cancel" \ |
| 9849 | -s "! mbedtls_ssl_handshake returned" |
| 9850 | |
| 9851 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 9852 | run_test "SSL async private: decrypt, cancel after start" \ |
| 9853 | "$P_SRV \ |
| 9854 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 9855 | async_private_error=2" \ |
| 9856 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9857 | 1 \ |
| 9858 | -s "Async decrypt callback: using key slot " \ |
| 9859 | -S "Async resume" \ |
| 9860 | -s "Async cancel" |
| 9861 | |
| 9862 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 9863 | run_test "SSL async private: decrypt, error in resume" \ |
| 9864 | "$P_SRV \ |
| 9865 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 9866 | async_private_error=3" \ |
| 9867 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9868 | 1 \ |
| 9869 | -s "Async decrypt callback: using key slot " \ |
| 9870 | -s "Async resume callback: decrypt done but injected error" \ |
| 9871 | -S "Async cancel" \ |
| 9872 | -s "! mbedtls_ssl_handshake returned" |
| 9873 | |
| 9874 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9875 | run_test "SSL async private: cancel after start then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9876 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9877 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 9878 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9879 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 9880 | 0 \ |
| 9881 | -s "Async cancel" \ |
| 9882 | -s "! mbedtls_ssl_handshake returned" \ |
| 9883 | -s "Async resume" \ |
| 9884 | -s "Successful connection" |
| 9885 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9886 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9887 | run_test "SSL async private: error in resume then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9888 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9889 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 9890 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9891 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 9892 | 0 \ |
| 9893 | -s "! mbedtls_ssl_handshake returned" \ |
| 9894 | -s "Async resume" \ |
| 9895 | -s "Successful connection" |
| 9896 | |
| 9897 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9898 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 9899 | # Note: the function "detect_required_features()" is not able to detect more than |
| 9900 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 9901 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 9902 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9903 | 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] | 9904 | "$P_SRV \ |
| 9905 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9906 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 9907 | 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] | 9908 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 9909 | [ \$? -eq 1 ] && |
| 9910 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9911 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 9912 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9913 | -S "Async resume" \ |
| 9914 | -s "Async cancel" \ |
| 9915 | -s "! mbedtls_ssl_handshake returned" \ |
| 9916 | -s "Async sign callback: no key matches this certificate." \ |
| 9917 | -s "Successful connection" |
| 9918 | |
| 9919 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9920 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 9921 | # Note: the function "detect_required_features()" is not able to detect more than |
| 9922 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 9923 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 9924 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 9925 | 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] | 9926 | "$P_SRV \ |
| 9927 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9928 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 9929 | 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] | 9930 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 9931 | [ \$? -eq 1 ] && |
| 9932 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9933 | 0 \ |
| 9934 | -s "Async resume" \ |
| 9935 | -s "! mbedtls_ssl_handshake returned" \ |
| 9936 | -s "Async sign callback: no key matches this certificate." \ |
| 9937 | -s "Successful connection" |
| 9938 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9939 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9940 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9941 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9942 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9943 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9944 | exchanges=2 renegotiation=1" \ |
| 9945 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 9946 | 0 \ |
| 9947 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9948 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9949 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9950 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9951 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9952 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9953 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9954 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9955 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 9956 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 9957 | 0 \ |
| 9958 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9959 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 9960 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9961 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9962 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9963 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9964 | "$P_SRV \ |
| 9965 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 9966 | exchanges=2 renegotiation=1" \ |
| 9967 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 9968 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9969 | 0 \ |
| 9970 | -s "Async decrypt callback: using key slot " \ |
| 9971 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 9972 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9973 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9974 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9975 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9976 | "$P_SRV \ |
| 9977 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 9978 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 9979 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 9980 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9981 | 0 \ |
| 9982 | -s "Async decrypt callback: using key slot " \ |
| 9983 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9984 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9985 | # Tests for ECC extensions (rfc 4492) |
| 9986 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9987 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9988 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9989 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 9990 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9991 | "$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] | 9992 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 9993 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9994 | -C "client hello, adding supported_point_formats extension" \ |
| 9995 | -S "found supported elliptic curves extension" \ |
| 9996 | -S "found supported point formats extension" |
| 9997 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9998 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9999 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10000 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10001 | "$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] | 10002 | "$P_CLI debug_level=3" \ |
| 10003 | 0 \ |
| 10004 | -C "found supported_point_formats extension" \ |
| 10005 | -S "server hello, supported_point_formats extension" |
| 10006 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10007 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10008 | run_test "Force an ECC ciphersuite in the client side" \ |
| 10009 | "$P_SRV debug_level=3" \ |
| 10010 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10011 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 10012 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10013 | -c "client hello, adding supported_point_formats extension" \ |
| 10014 | -s "found supported elliptic curves extension" \ |
| 10015 | -s "found supported point formats extension" |
| 10016 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10017 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10018 | run_test "Force an ECC ciphersuite in the server side" \ |
| 10019 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10020 | "$P_CLI debug_level=3" \ |
| 10021 | 0 \ |
| 10022 | -c "found supported_point_formats extension" \ |
| 10023 | -s "server hello, supported_point_formats extension" |
| 10024 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10025 | # Tests for DTLS HelloVerifyRequest |
| 10026 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10027 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10028 | run_test "DTLS cookie: enabled" \ |
| 10029 | "$P_SRV dtls=1 debug_level=2" \ |
| 10030 | "$P_CLI dtls=1 debug_level=2" \ |
| 10031 | 0 \ |
| 10032 | -s "cookie verification failed" \ |
| 10033 | -s "cookie verification passed" \ |
| 10034 | -S "cookie verification skipped" \ |
| 10035 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10036 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10037 | -S "SSL - The requested feature is not available" |
| 10038 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10039 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10040 | run_test "DTLS cookie: disabled" \ |
| 10041 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 10042 | "$P_CLI dtls=1 debug_level=2" \ |
| 10043 | 0 \ |
| 10044 | -S "cookie verification failed" \ |
| 10045 | -S "cookie verification passed" \ |
| 10046 | -s "cookie verification skipped" \ |
| 10047 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10048 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10049 | -S "SSL - The requested feature is not available" |
| 10050 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10051 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10052 | run_test "DTLS cookie: default (failing)" \ |
| 10053 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 10054 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 10055 | 1 \ |
| 10056 | -s "cookie verification failed" \ |
| 10057 | -S "cookie verification passed" \ |
| 10058 | -S "cookie verification skipped" \ |
| 10059 | -C "received hello verify request" \ |
| 10060 | -S "hello verification requested" \ |
| 10061 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10062 | |
| 10063 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10064 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10065 | run_test "DTLS cookie: enabled, IPv6" \ |
| 10066 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 10067 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 10068 | 0 \ |
| 10069 | -s "cookie verification failed" \ |
| 10070 | -s "cookie verification passed" \ |
| 10071 | -S "cookie verification skipped" \ |
| 10072 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10073 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10074 | -S "SSL - The requested feature is not available" |
| 10075 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10076 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 10077 | run_test "DTLS cookie: enabled, nbio" \ |
| 10078 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 10079 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10080 | 0 \ |
| 10081 | -s "cookie verification failed" \ |
| 10082 | -s "cookie verification passed" \ |
| 10083 | -S "cookie verification skipped" \ |
| 10084 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10085 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 10086 | -S "SSL - The requested feature is not available" |
| 10087 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10088 | # Tests for client reconnecting from the same port with DTLS |
| 10089 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10090 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10091 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10092 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10093 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 10094 | "$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] | 10095 | 0 \ |
| 10096 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10097 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10098 | -S "Client initiated reconnection from same port" |
| 10099 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10100 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10101 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10102 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10103 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 10104 | "$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] | 10105 | 0 \ |
| 10106 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10107 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10108 | -s "Client initiated reconnection from same port" |
| 10109 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10110 | 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] | 10111 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10112 | 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] | 10113 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 10114 | "$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] | 10115 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10116 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10117 | -s "Client initiated reconnection from same port" |
| 10118 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10119 | 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] | 10120 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10121 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 10122 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 10123 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 10124 | 0 \ |
| 10125 | -S "The operation timed out" \ |
| 10126 | -s "Client initiated reconnection from same port" |
| 10127 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10128 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10129 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 10130 | "$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] | 10131 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 10132 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10133 | -s "The operation timed out" \ |
| 10134 | -S "Client initiated reconnection from same port" |
| 10135 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10136 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 10137 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 10138 | -p "$P_PXY inject_clihlo=1" \ |
| 10139 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 10140 | "$P_CLI dtls=1 exchanges=2" \ |
| 10141 | 0 \ |
| 10142 | -s "possible client reconnect from the same port" \ |
| 10143 | -S "Client initiated reconnection from same port" |
| 10144 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10145 | # Tests for various cases of client authentication with DTLS |
| 10146 | # (focused on handshake flows and message parsing) |
| 10147 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10148 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10149 | run_test "DTLS client auth: required" \ |
| 10150 | "$P_SRV dtls=1 auth_mode=required" \ |
| 10151 | "$P_CLI dtls=1" \ |
| 10152 | 0 \ |
| 10153 | -s "Verifying peer X.509 certificate... ok" |
| 10154 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10155 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10156 | run_test "DTLS client auth: optional, client has no cert" \ |
| 10157 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 10158 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 10159 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10160 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10161 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10162 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10163 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10164 | "$P_SRV dtls=1 auth_mode=none" \ |
| 10165 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 10166 | 0 \ |
| 10167 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10168 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10169 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 10170 | run_test "DTLS wrong PSK: badmac alert" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10171 | "$P_SRV dtls=1 psk=73776f726466697368 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
Gilles Peskine | f9f3d21 | 2024-05-13 21:06:26 +0200 | [diff] [blame] | 10172 | "$P_CLI dtls=1 psk=73776f726466697374" \ |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 10173 | 1 \ |
| 10174 | -s "SSL - Verification of the message MAC failed" \ |
| 10175 | -c "SSL - A fatal alert message was received from our peer" |
| 10176 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10177 | # Tests for receiving fragmented handshake messages with DTLS |
| 10178 | |
| 10179 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10180 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10181 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 10182 | "$G_SRV -u --mtu 2048 -a" \ |
| 10183 | "$P_CLI dtls=1 debug_level=2" \ |
| 10184 | 0 \ |
| 10185 | -C "found fragmented DTLS handshake message" \ |
| 10186 | -C "error" |
| 10187 | |
| 10188 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10189 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10190 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 10191 | "$G_SRV -u --mtu 512" \ |
| 10192 | "$P_CLI dtls=1 debug_level=2" \ |
| 10193 | 0 \ |
| 10194 | -c "found fragmented DTLS handshake message" \ |
| 10195 | -C "error" |
| 10196 | |
| 10197 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10198 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10199 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 10200 | "$G_SRV -u --mtu 128" \ |
| 10201 | "$P_CLI dtls=1 debug_level=2" \ |
| 10202 | 0 \ |
| 10203 | -c "found fragmented DTLS handshake message" \ |
| 10204 | -C "error" |
| 10205 | |
| 10206 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10207 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10208 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 10209 | "$G_SRV -u --mtu 128" \ |
| 10210 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10211 | 0 \ |
| 10212 | -c "found fragmented DTLS handshake message" \ |
| 10213 | -C "error" |
| 10214 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10215 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10216 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10217 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10218 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 10219 | "$G_SRV -u --mtu 256" \ |
| 10220 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 10221 | 0 \ |
| 10222 | -c "found fragmented DTLS handshake message" \ |
| 10223 | -c "client hello, adding renegotiation extension" \ |
| 10224 | -c "found renegotiation extension" \ |
| 10225 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 10226 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10227 | -C "error" \ |
| 10228 | -s "Extra-header:" |
| 10229 | |
| 10230 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10231 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10232 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10233 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 10234 | "$G_SRV -u --mtu 256" \ |
| 10235 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 10236 | 0 \ |
| 10237 | -c "found fragmented DTLS handshake message" \ |
| 10238 | -c "client hello, adding renegotiation extension" \ |
| 10239 | -c "found renegotiation extension" \ |
| 10240 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 10241 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10242 | -C "error" \ |
| 10243 | -s "Extra-header:" |
| 10244 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10246 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 10247 | "$O_SRV -dtls -mtu 2048" \ |
| 10248 | "$P_CLI dtls=1 debug_level=2" \ |
| 10249 | 0 \ |
| 10250 | -C "found fragmented DTLS handshake message" \ |
| 10251 | -C "error" |
| 10252 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10253 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10254 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 10255 | "$O_SRV -dtls -mtu 256" \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10256 | "$P_CLI dtls=1 debug_level=2" \ |
| 10257 | 0 \ |
| 10258 | -c "found fragmented DTLS handshake message" \ |
| 10259 | -C "error" |
| 10260 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10261 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10262 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 10263 | "$O_SRV -dtls -mtu 256" \ |
| 10264 | "$P_CLI dtls=1 debug_level=2" \ |
| 10265 | 0 \ |
| 10266 | -c "found fragmented DTLS handshake message" \ |
| 10267 | -C "error" |
| 10268 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10269 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10270 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 10271 | "$O_SRV -dtls -mtu 256" \ |
| 10272 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10273 | 0 \ |
| 10274 | -c "found fragmented DTLS handshake message" \ |
| 10275 | -C "error" |
| 10276 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10277 | # Tests for sending fragmented handshake messages with DTLS |
| 10278 | # |
| 10279 | # Use client auth when we need the client to send large messages, |
| 10280 | # and use large cert chains on both sides too (the long chains we have all use |
| 10281 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 10282 | # Sizes reached (UDP payload): |
| 10283 | # - 2037B for server certificate |
| 10284 | # - 1542B for client certificate |
| 10285 | # - 1013B for newsessionticket |
| 10286 | # - all others below 512B |
| 10287 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 10288 | |
| 10289 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10290 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10291 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10292 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10293 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10294 | run_test "DTLS fragmenting: none (for reference)" \ |
| 10295 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10296 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10297 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10298 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10299 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10300 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10301 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10302 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10303 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10304 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10305 | 0 \ |
| 10306 | -S "found fragmented DTLS handshake message" \ |
| 10307 | -C "found fragmented DTLS handshake message" \ |
| 10308 | -C "error" |
| 10309 | |
| 10310 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10311 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10312 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10313 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10314 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10315 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10316 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10317 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10318 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10319 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10320 | max_frag_len=1024" \ |
| 10321 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10322 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10323 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10324 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10325 | max_frag_len=2048" \ |
| 10326 | 0 \ |
| 10327 | -S "found fragmented DTLS handshake message" \ |
| 10328 | -c "found fragmented DTLS handshake message" \ |
| 10329 | -C "error" |
| 10330 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 10331 | # With the MFL extension, the server has no way of forcing |
| 10332 | # the client to not exceed a certain MTU; hence, the following |
| 10333 | # test can't be replicated with an MTU proxy such as the one |
| 10334 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10335 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10336 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10337 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10338 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10339 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10340 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10341 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10342 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10343 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10344 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10345 | max_frag_len=512" \ |
| 10346 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10347 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10348 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10349 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 10350 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10351 | 0 \ |
| 10352 | -S "found fragmented DTLS handshake message" \ |
| 10353 | -c "found fragmented DTLS handshake message" \ |
| 10354 | -C "error" |
| 10355 | |
| 10356 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10357 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10358 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10359 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10360 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10361 | 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] | 10362 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10363 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10364 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10365 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10366 | max_frag_len=2048" \ |
| 10367 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10368 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10369 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10370 | hs_timeout=2500-60000 \ |
| 10371 | max_frag_len=1024" \ |
| 10372 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10373 | -S "found fragmented DTLS handshake message" \ |
| 10374 | -c "found fragmented DTLS handshake message" \ |
| 10375 | -C "error" |
| 10376 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10377 | # While not required by the standard defining the MFL extension |
| 10378 | # (according to which it only applies to records, not to datagrams), |
| 10379 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 10380 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 10381 | # to the peer. |
| 10382 | # The next test checks that no datagrams significantly larger than the |
| 10383 | # negotiated MFL are sent. |
| 10384 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10385 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10386 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10387 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10388 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10389 | 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] | 10390 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10391 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10392 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10393 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10394 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10395 | max_frag_len=2048" \ |
| 10396 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10397 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10398 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10399 | hs_timeout=2500-60000 \ |
| 10400 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10401 | 0 \ |
| 10402 | -S "found fragmented DTLS handshake message" \ |
| 10403 | -c "found fragmented DTLS handshake message" \ |
| 10404 | -C "error" |
| 10405 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10406 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10407 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10408 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10409 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10410 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10411 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10412 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10413 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10414 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10415 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10416 | max_frag_len=2048" \ |
| 10417 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10418 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10419 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10420 | hs_timeout=2500-60000 \ |
| 10421 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10422 | 0 \ |
| 10423 | -s "found fragmented DTLS handshake message" \ |
| 10424 | -c "found fragmented DTLS handshake message" \ |
| 10425 | -C "error" |
| 10426 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10427 | # While not required by the standard defining the MFL extension |
| 10428 | # (according to which it only applies to records, not to datagrams), |
| 10429 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 10430 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 10431 | # to the peer. |
| 10432 | # The next test checks that no datagrams significantly larger than the |
| 10433 | # negotiated MFL are sent. |
| 10434 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10435 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10436 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10437 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10438 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10439 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 10440 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10441 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10442 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10443 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10444 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10445 | max_frag_len=2048" \ |
| 10446 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10447 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10448 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10449 | hs_timeout=2500-60000 \ |
| 10450 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10451 | 0 \ |
| 10452 | -s "found fragmented DTLS handshake message" \ |
| 10453 | -c "found fragmented DTLS handshake message" \ |
| 10454 | -C "error" |
| 10455 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10456 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10457 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10458 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10459 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10460 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 10461 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10462 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10463 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10464 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10465 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10466 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10467 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10468 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10469 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10470 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10471 | 0 \ |
| 10472 | -S "found fragmented DTLS handshake message" \ |
| 10473 | -C "found fragmented DTLS handshake message" \ |
| 10474 | -C "error" |
| 10475 | |
| 10476 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10477 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10478 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10479 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10480 | run_test "DTLS fragmenting: client (MTU)" \ |
| 10481 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10482 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10483 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10484 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10485 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10486 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10487 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10488 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10489 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10490 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10491 | 0 \ |
| 10492 | -s "found fragmented DTLS handshake message" \ |
| 10493 | -C "found fragmented DTLS handshake message" \ |
| 10494 | -C "error" |
| 10495 | |
| 10496 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10497 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10498 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10499 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10500 | run_test "DTLS fragmenting: server (MTU)" \ |
| 10501 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10502 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10503 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10504 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10505 | mtu=512" \ |
| 10506 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10507 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10508 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10509 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10510 | mtu=2048" \ |
| 10511 | 0 \ |
| 10512 | -S "found fragmented DTLS handshake message" \ |
| 10513 | -c "found fragmented DTLS handshake message" \ |
| 10514 | -C "error" |
| 10515 | |
| 10516 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10517 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10518 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10519 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10520 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10521 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10522 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10523 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10524 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10525 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 10526 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10527 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10528 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10529 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10530 | hs_timeout=2500-60000 \ |
| 10531 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10532 | 0 \ |
| 10533 | -s "found fragmented DTLS handshake message" \ |
| 10534 | -c "found fragmented DTLS handshake message" \ |
| 10535 | -C "error" |
| 10536 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10537 | # 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] | 10538 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10539 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10540 | requires_hash_alg SHA_256 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10541 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10542 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 10543 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 10544 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10545 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10546 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10547 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 10548 | mtu=512" \ |
| 10549 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10550 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10551 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10552 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10553 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10554 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10555 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10556 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10557 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10558 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10559 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10560 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10561 | # 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] | 10562 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 10563 | # retransmissions, but in some cases (like both the server and client using |
| 10564 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 10565 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 10566 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10567 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10568 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10569 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 10570 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10571 | -p "$P_PXY mtu=508" \ |
| 10572 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10573 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10574 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10575 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10576 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10577 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10578 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10579 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10580 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10581 | 0 \ |
| 10582 | -s "found fragmented DTLS handshake message" \ |
| 10583 | -c "found fragmented DTLS handshake message" \ |
| 10584 | -C "error" |
| 10585 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10586 | # 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] | 10587 | only_with_valgrind |
| 10588 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10589 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10590 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 10591 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10592 | -p "$P_PXY mtu=508" \ |
| 10593 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10594 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10595 | key_file=$DATA_FILES_PATH/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10596 | hs_timeout=250-10000" \ |
| 10597 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10598 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10599 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10600 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10601 | hs_timeout=250-10000" \ |
| 10602 | 0 \ |
| 10603 | -s "found fragmented DTLS handshake message" \ |
| 10604 | -c "found fragmented DTLS handshake message" \ |
| 10605 | -C "error" |
| 10606 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10607 | # 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] | 10608 | # OTOH the client might resend if the server is to slow to reset after sending |
| 10609 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10610 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10611 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10612 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10613 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10614 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10615 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10616 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10617 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10618 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10619 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10620 | hs_timeout=10000-60000 \ |
| 10621 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10622 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10623 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10624 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10625 | hs_timeout=10000-60000 \ |
| 10626 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10627 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10628 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10629 | -s "found fragmented DTLS handshake message" \ |
| 10630 | -c "found fragmented DTLS handshake message" \ |
| 10631 | -C "error" |
| 10632 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10633 | # 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] | 10634 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 10635 | # OTOH the client might resend if the server is to slow to reset after sending |
| 10636 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10637 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10638 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10639 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10640 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10641 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10642 | -p "$P_PXY mtu=512" \ |
| 10643 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10644 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10645 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10646 | hs_timeout=10000-60000 \ |
| 10647 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10648 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10649 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10650 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10651 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10652 | hs_timeout=10000-60000 \ |
| 10653 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10654 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10655 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10656 | -s "found fragmented DTLS handshake message" \ |
| 10657 | -c "found fragmented DTLS handshake message" \ |
| 10658 | -C "error" |
| 10659 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10660 | not_with_valgrind # spurious autoreduction due to timeout |
| 10661 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10662 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10663 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10665 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10666 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10667 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10668 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10669 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10670 | hs_timeout=10000-60000 \ |
| 10671 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10672 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10673 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10674 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10675 | hs_timeout=10000-60000 \ |
| 10676 | mtu=1024 nbio=2" \ |
| 10677 | 0 \ |
| 10678 | -S "autoreduction" \ |
| 10679 | -s "found fragmented DTLS handshake message" \ |
| 10680 | -c "found fragmented DTLS handshake message" \ |
| 10681 | -C "error" |
| 10682 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10683 | # 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] | 10684 | not_with_valgrind # spurious autoreduction due to timeout |
| 10685 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10686 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10687 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10688 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 10689 | -p "$P_PXY mtu=512" \ |
| 10690 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10691 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10692 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10693 | hs_timeout=10000-60000 \ |
| 10694 | mtu=512 nbio=2" \ |
| 10695 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10696 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10697 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10698 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10699 | hs_timeout=10000-60000 \ |
| 10700 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10701 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10702 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10703 | -s "found fragmented DTLS handshake message" \ |
| 10704 | -c "found fragmented DTLS handshake message" \ |
| 10705 | -C "error" |
| 10706 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10707 | # 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] | 10708 | # This ensures things still work after session_reset(). |
| 10709 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 10710 | # Since we don't support reading fragmented ClientHello yet, |
| 10711 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 10712 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10713 | # An autoreduction on the client-side might happen if the server is |
| 10714 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 10715 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10716 | # resumed listening, which would result in a spurious autoreduction. |
| 10717 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 10718 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10719 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10720 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 10721 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 10722 | -p "$P_PXY mtu=1450" \ |
| 10723 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10724 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10725 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10726 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 10727 | mtu=1450" \ |
| 10728 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10729 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10730 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10731 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10732 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 10733 | 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] | 10734 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10735 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 10736 | -s "found fragmented DTLS handshake message" \ |
| 10737 | -c "found fragmented DTLS handshake message" \ |
| 10738 | -C "error" |
| 10739 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10740 | # An autoreduction on the client-side might happen if the server is |
| 10741 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10742 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10743 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10744 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10745 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10746 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10747 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10748 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 10749 | -p "$P_PXY mtu=512" \ |
| 10750 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10751 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10752 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10753 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10754 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10755 | mtu=512" \ |
| 10756 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10757 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10758 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10759 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Ronald Cron | 60f7666 | 2023-11-28 17:52:42 +0100 | [diff] [blame] | 10760 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10761 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10762 | mtu=512" \ |
| 10763 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10764 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10765 | -s "found fragmented DTLS handshake message" \ |
| 10766 | -c "found fragmented DTLS handshake message" \ |
| 10767 | -C "error" |
| 10768 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10769 | # An autoreduction on the client-side might happen if the server is |
| 10770 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10771 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10772 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10773 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10774 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10775 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10776 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10777 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 10778 | -p "$P_PXY mtu=512" \ |
| 10779 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10780 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10781 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10782 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10783 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10784 | mtu=512" \ |
| 10785 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10786 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10787 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10788 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10789 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10790 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10791 | mtu=512" \ |
| 10792 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10793 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10794 | -s "found fragmented DTLS handshake message" \ |
| 10795 | -c "found fragmented DTLS handshake message" \ |
| 10796 | -C "error" |
| 10797 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10798 | # An autoreduction on the client-side might happen if the server is |
| 10799 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10800 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10801 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10802 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10803 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10804 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10805 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10806 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10807 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10808 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10809 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10810 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10811 | exchanges=2 renegotiation=1 \ |
| 10812 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10813 | hs_timeout=10000-60000 \ |
| 10814 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10815 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10816 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10817 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10818 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10819 | hs_timeout=10000-60000 \ |
| 10820 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10821 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10822 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10823 | -s "found fragmented DTLS handshake message" \ |
| 10824 | -c "found fragmented DTLS handshake message" \ |
| 10825 | -C "error" |
| 10826 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10827 | # An autoreduction on the client-side might happen if the server is |
| 10828 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10829 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10830 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10831 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10832 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10833 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10834 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10835 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10836 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10837 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10838 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10839 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10840 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10841 | exchanges=2 renegotiation=1 \ |
| 10842 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10843 | hs_timeout=10000-60000 \ |
| 10844 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10845 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10846 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10847 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10848 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10849 | hs_timeout=10000-60000 \ |
| 10850 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10851 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10852 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10853 | -s "found fragmented DTLS handshake message" \ |
| 10854 | -c "found fragmented DTLS handshake message" \ |
| 10855 | -C "error" |
| 10856 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10857 | # An autoreduction on the client-side might happen if the server is |
| 10858 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10859 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10860 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10861 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10862 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10863 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10864 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10865 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10866 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10867 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10868 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10869 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10870 | exchanges=2 renegotiation=1 \ |
| 10871 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10872 | hs_timeout=10000-60000 \ |
| 10873 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10874 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10875 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10876 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10877 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10878 | hs_timeout=10000-60000 \ |
| 10879 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10880 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10881 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10882 | -s "found fragmented DTLS handshake message" \ |
| 10883 | -c "found fragmented DTLS handshake message" \ |
| 10884 | -C "error" |
| 10885 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10886 | # 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] | 10887 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10888 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10889 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10890 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10891 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 10892 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10893 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10894 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10895 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 10896 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10897 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10898 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10899 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10900 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 10901 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10902 | 0 \ |
| 10903 | -s "found fragmented DTLS handshake message" \ |
| 10904 | -c "found fragmented DTLS handshake message" \ |
| 10905 | -C "error" |
| 10906 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10907 | # 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] | 10908 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10909 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10910 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10911 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10912 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 10913 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 10914 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10915 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10916 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10917 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 10918 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10919 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10920 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10921 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10922 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 10923 | 0 \ |
| 10924 | -s "found fragmented DTLS handshake message" \ |
| 10925 | -c "found fragmented DTLS handshake message" \ |
| 10926 | -C "error" |
| 10927 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10928 | # interop tests for DTLS fragmentating with reliable connection |
| 10929 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10930 | # here and below we just want to test that the we fragment in a way that |
| 10931 | # pleases other implementations, so we don't need the peer to fragment |
| 10932 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10933 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 10934 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10935 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10936 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 10937 | "$G_SRV -u" \ |
| 10938 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10939 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10940 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10941 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10942 | 0 \ |
| 10943 | -c "fragmenting handshake message" \ |
| 10944 | -C "error" |
| 10945 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 10946 | # We use --insecure for the GnuTLS client because it expects |
| 10947 | # the hostname / IP it connects to to be the name used in the |
| 10948 | # certificate obtained from the server. Here, however, it |
| 10949 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 10950 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 10951 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 10952 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10953 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10954 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 10955 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 10956 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10957 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10958 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Valerio Setti | 3b2c028 | 2023-03-08 10:22:29 +0100 | [diff] [blame] | 10959 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10960 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10961 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10962 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 10963 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10964 | 0 \ |
| 10965 | -s "fragmenting handshake message" |
| 10966 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10967 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10968 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10969 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10970 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 10971 | "$O_SRV -dtls1_2 -verify 10" \ |
| 10972 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10973 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10974 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10975 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10976 | 0 \ |
| 10977 | -c "fragmenting handshake message" \ |
| 10978 | -C "error" |
| 10979 | |
| 10980 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10981 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10982 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10983 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 10984 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10985 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10986 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10987 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10988 | "$O_CLI -dtls1_2" \ |
| 10989 | 0 \ |
| 10990 | -s "fragmenting handshake message" |
| 10991 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10992 | # interop tests for DTLS fragmentating with unreliable connection |
| 10993 | # |
| 10994 | # again we just want to test that the we fragment in a way that |
| 10995 | # pleases other implementations, so we don't need the peer to fragment |
| 10996 | requires_gnutls_next |
| 10997 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10998 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 10999 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11000 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11001 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 11002 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11003 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11004 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11005 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11006 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11007 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11008 | 0 \ |
| 11009 | -c "fragmenting handshake message" \ |
| 11010 | -C "error" |
| 11011 | |
| 11012 | requires_gnutls_next |
| 11013 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11014 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11015 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11016 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11017 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 11018 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11019 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11020 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11021 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11022 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11023 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11024 | 0 \ |
| 11025 | -s "fragmenting handshake message" |
| 11026 | |
Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 11027 | ## The test below requires 1.1.1a or higher version of openssl, otherwise |
| 11028 | ## 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] | 11029 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11030 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11031 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11032 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11033 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11034 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 11035 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11036 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11037 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11038 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11039 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11040 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11041 | 0 \ |
| 11042 | -c "fragmenting handshake message" \ |
| 11043 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11044 | |
Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 11045 | ## the test below will time out with certain seed. |
Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 11046 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 11047 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11048 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11049 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11050 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11051 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11052 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 11053 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11054 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11055 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11056 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11057 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11058 | "$O_CLI -dtls1_2" \ |
| 11059 | 0 \ |
| 11060 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11061 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11062 | # Tests for DTLS-SRTP (RFC 5764) |
| 11063 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11064 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11065 | run_test "DTLS-SRTP all profiles supported" \ |
| 11066 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11067 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11068 | 0 \ |
| 11069 | -s "found use_srtp extension" \ |
| 11070 | -s "found srtp profile" \ |
| 11071 | -s "selected srtp profile" \ |
| 11072 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11073 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11074 | -c "client hello, adding use_srtp extension" \ |
| 11075 | -c "found use_srtp extension" \ |
| 11076 | -c "found srtp profile" \ |
| 11077 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11078 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11079 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11080 | -C "error" |
| 11081 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11082 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11083 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11084 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11085 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 11086 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11087 | "$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] | 11088 | 0 \ |
| 11089 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11090 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 11091 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11092 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11093 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11094 | -c "client hello, adding use_srtp extension" \ |
| 11095 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11096 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11097 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11098 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11099 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11100 | -C "error" |
| 11101 | |
| 11102 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11103 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11104 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11105 | "$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] | 11106 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11107 | 0 \ |
| 11108 | -s "found use_srtp extension" \ |
| 11109 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11110 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11111 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11112 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11113 | -c "client hello, adding use_srtp extension" \ |
| 11114 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11115 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11116 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11117 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11118 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11119 | -C "error" |
| 11120 | |
| 11121 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11122 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11123 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 11124 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11125 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11126 | 0 \ |
| 11127 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11128 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11129 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11130 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11131 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11132 | -c "client hello, adding use_srtp extension" \ |
| 11133 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11134 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11135 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11136 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11137 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11138 | -C "error" |
| 11139 | |
| 11140 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11141 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11142 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 11143 | "$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] | 11144 | "$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] | 11145 | 0 \ |
| 11146 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11147 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11148 | -S "selected srtp profile" \ |
| 11149 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11150 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11151 | -c "client hello, adding use_srtp extension" \ |
| 11152 | -C "found use_srtp extension" \ |
| 11153 | -C "found srtp profile" \ |
| 11154 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11155 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11156 | -C "error" |
| 11157 | |
| 11158 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11159 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11160 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 11161 | "$P_SRV dtls=1 debug_level=3" \ |
| 11162 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11163 | 0 \ |
| 11164 | -s "found use_srtp extension" \ |
| 11165 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11166 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11167 | -c "client hello, adding use_srtp extension" \ |
| 11168 | -C "found use_srtp extension" \ |
| 11169 | -C "found srtp profile" \ |
| 11170 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11171 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11172 | -C "error" |
| 11173 | |
| 11174 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11175 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11176 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 11177 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 11178 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11179 | 0 \ |
| 11180 | -s "found use_srtp extension" \ |
| 11181 | -s "found srtp profile" \ |
| 11182 | -s "selected srtp profile" \ |
| 11183 | -s "server hello, adding use_srtp extension" \ |
| 11184 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11185 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11186 | -c "client hello, adding use_srtp extension" \ |
| 11187 | -c "found use_srtp extension" \ |
| 11188 | -c "found srtp profile" \ |
| 11189 | -c "selected srtp profile" \ |
| 11190 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11191 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11192 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11193 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 11194 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11195 | -C "error" |
| 11196 | |
| 11197 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11198 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11199 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 11200 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11201 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11202 | 0 \ |
| 11203 | -s "found use_srtp extension" \ |
| 11204 | -s "found srtp profile" \ |
| 11205 | -s "selected srtp profile" \ |
| 11206 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11207 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 11208 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11209 | -S "dumping 'using mki' (8 bytes)" \ |
| 11210 | -c "client hello, adding use_srtp extension" \ |
| 11211 | -c "found use_srtp extension" \ |
| 11212 | -c "found srtp profile" \ |
| 11213 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11214 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 11215 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11216 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11217 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11218 | -C "dumping 'received mki' (8 bytes)" \ |
| 11219 | -C "error" |
| 11220 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11221 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11222 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11223 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 11224 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11225 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11226 | 0 \ |
| 11227 | -s "found use_srtp extension" \ |
| 11228 | -s "found srtp profile" \ |
| 11229 | -s "selected srtp profile" \ |
| 11230 | -s "server hello, adding use_srtp extension" \ |
| 11231 | -s "DTLS-SRTP key material is"\ |
| 11232 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11233 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 11234 | |
| 11235 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11236 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11237 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 11238 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11239 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11240 | 0 \ |
| 11241 | -s "found use_srtp extension" \ |
| 11242 | -s "found srtp profile" \ |
| 11243 | -s "selected srtp profile" \ |
| 11244 | -s "server hello, adding use_srtp extension" \ |
| 11245 | -s "DTLS-SRTP key material is"\ |
| 11246 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11247 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11248 | |
| 11249 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11250 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11251 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 11252 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11253 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11254 | 0 \ |
| 11255 | -s "found use_srtp extension" \ |
| 11256 | -s "found srtp profile" \ |
| 11257 | -s "selected srtp profile" \ |
| 11258 | -s "server hello, adding use_srtp extension" \ |
| 11259 | -s "DTLS-SRTP key material is"\ |
| 11260 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11261 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11262 | |
| 11263 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11264 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11265 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 11266 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11267 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11268 | 0 \ |
| 11269 | -s "found use_srtp extension" \ |
| 11270 | -s "found srtp profile" \ |
| 11271 | -s "selected srtp profile" \ |
| 11272 | -s "server hello, adding use_srtp extension" \ |
| 11273 | -s "DTLS-SRTP key material is"\ |
| 11274 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11275 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11276 | |
| 11277 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11278 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11279 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 11280 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11281 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11282 | 0 \ |
| 11283 | -s "found use_srtp extension" \ |
| 11284 | -s "found srtp profile" \ |
| 11285 | -s "selected srtp profile" \ |
| 11286 | -s "server hello, adding use_srtp extension" \ |
| 11287 | -s "DTLS-SRTP key material is"\ |
| 11288 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11289 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11290 | |
| 11291 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11292 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11293 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 11294 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 11295 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11296 | 0 \ |
| 11297 | -s "found use_srtp extension" \ |
| 11298 | -s "found srtp profile" \ |
| 11299 | -S "selected srtp profile" \ |
| 11300 | -S "server hello, adding use_srtp extension" \ |
| 11301 | -S "DTLS-SRTP key material is"\ |
| 11302 | -C "SRTP Extension negotiated, profile" |
| 11303 | |
| 11304 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11305 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11306 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 11307 | "$P_SRV dtls=1 debug_level=3" \ |
| 11308 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11309 | 0 \ |
| 11310 | -s "found use_srtp extension" \ |
| 11311 | -S "server hello, adding use_srtp extension" \ |
| 11312 | -S "DTLS-SRTP key material is"\ |
| 11313 | -C "SRTP Extension negotiated, profile" |
| 11314 | |
| 11315 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11316 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11317 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 11318 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11319 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11320 | 0 \ |
| 11321 | -c "client hello, adding use_srtp extension" \ |
| 11322 | -c "found use_srtp extension" \ |
| 11323 | -c "found srtp profile" \ |
| 11324 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 11325 | -c "DTLS-SRTP key material is"\ |
| 11326 | -C "error" |
| 11327 | |
| 11328 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11329 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11330 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 11331 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11332 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11333 | 0 \ |
| 11334 | -c "client hello, adding use_srtp extension" \ |
| 11335 | -c "found use_srtp extension" \ |
| 11336 | -c "found srtp profile" \ |
| 11337 | -c "selected srtp profile" \ |
| 11338 | -c "DTLS-SRTP key material is"\ |
| 11339 | -C "error" |
| 11340 | |
| 11341 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11342 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11343 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 11344 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11345 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11346 | 0 \ |
| 11347 | -c "client hello, adding use_srtp extension" \ |
| 11348 | -c "found use_srtp extension" \ |
| 11349 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11350 | -c "selected srtp profile" \ |
| 11351 | -c "DTLS-SRTP key material is"\ |
| 11352 | -C "error" |
| 11353 | |
| 11354 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11355 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11356 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 11357 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11358 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11359 | 0 \ |
| 11360 | -c "client hello, adding use_srtp extension" \ |
| 11361 | -c "found use_srtp extension" \ |
| 11362 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11363 | -c "selected srtp profile" \ |
| 11364 | -c "DTLS-SRTP key material is"\ |
| 11365 | -C "error" |
| 11366 | |
| 11367 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11368 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11369 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 11370 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11371 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11372 | 0 \ |
| 11373 | -c "client hello, adding use_srtp extension" \ |
| 11374 | -c "found use_srtp extension" \ |
| 11375 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11376 | -c "selected srtp profile" \ |
| 11377 | -c "DTLS-SRTP key material is"\ |
| 11378 | -C "error" |
| 11379 | |
| 11380 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11381 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11382 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 11383 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11384 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 11385 | 0 \ |
| 11386 | -c "client hello, adding use_srtp extension" \ |
| 11387 | -C "found use_srtp extension" \ |
| 11388 | -C "found srtp profile" \ |
| 11389 | -C "selected srtp profile" \ |
| 11390 | -C "DTLS-SRTP key material is"\ |
| 11391 | -C "error" |
| 11392 | |
| 11393 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11394 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11395 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 11396 | "$O_SRV -dtls" \ |
| 11397 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11398 | 0 \ |
| 11399 | -c "client hello, adding use_srtp extension" \ |
| 11400 | -C "found use_srtp extension" \ |
| 11401 | -C "found srtp profile" \ |
| 11402 | -C "selected srtp profile" \ |
| 11403 | -C "DTLS-SRTP key material is"\ |
| 11404 | -C "error" |
| 11405 | |
| 11406 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11407 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11408 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 11409 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11410 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11411 | 0 \ |
| 11412 | -c "client hello, adding use_srtp extension" \ |
| 11413 | -c "found use_srtp extension" \ |
| 11414 | -c "found srtp profile" \ |
| 11415 | -c "selected srtp profile" \ |
| 11416 | -c "DTLS-SRTP key material is"\ |
| 11417 | -c "DTLS-SRTP no mki value negotiated"\ |
| 11418 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11419 | -C "dumping 'received mki' (8 bytes)" \ |
| 11420 | -C "error" |
| 11421 | |
| 11422 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11423 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11424 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11425 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11426 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11427 | "$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] | 11428 | 0 \ |
| 11429 | -s "found use_srtp extension" \ |
| 11430 | -s "found srtp profile" \ |
| 11431 | -s "selected srtp profile" \ |
| 11432 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11433 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11434 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 11435 | |
| 11436 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11437 | requires_gnutls |
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 all profiles. Client supports all profiles, in different order. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11440 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11441 | "$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] | 11442 | 0 \ |
| 11443 | -s "found use_srtp extension" \ |
| 11444 | -s "found srtp profile" \ |
| 11445 | -s "selected srtp profile" \ |
| 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 | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11448 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 11449 | |
| 11450 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11451 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11452 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11453 | 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] | 11454 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11455 | "$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] | 11456 | 0 \ |
| 11457 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11458 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11459 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11460 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11461 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11462 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 11463 | |
| 11464 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11465 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11467 | 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] | 11468 | "$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] | 11469 | "$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] | 11470 | 0 \ |
| 11471 | -s "found use_srtp extension" \ |
| 11472 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11473 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11474 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11475 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11476 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 11477 | |
| 11478 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11479 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11480 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11481 | 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] | 11482 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11483 | "$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] | 11484 | 0 \ |
| 11485 | -s "found use_srtp extension" \ |
| 11486 | -s "found srtp profile" \ |
| 11487 | -s "selected srtp profile" \ |
| 11488 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11489 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11490 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 11491 | |
| 11492 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11493 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11495 | 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] | 11496 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 11497 | "$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] | 11498 | 0 \ |
| 11499 | -s "found use_srtp extension" \ |
| 11500 | -s "found srtp profile" \ |
| 11501 | -S "selected srtp profile" \ |
| 11502 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11503 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11504 | -C "SRTP profile:" |
| 11505 | |
| 11506 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11507 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11508 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11509 | 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] | 11510 | "$P_SRV dtls=1 debug_level=3" \ |
| 11511 | "$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] | 11512 | 0 \ |
| 11513 | -s "found use_srtp extension" \ |
| 11514 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11515 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11516 | -C "SRTP profile:" |
| 11517 | |
| 11518 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11519 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11520 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11521 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 11522 | "$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" \ |
| 11523 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11524 | 0 \ |
| 11525 | -c "client hello, adding use_srtp extension" \ |
| 11526 | -c "found use_srtp extension" \ |
| 11527 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11528 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11529 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11530 | -C "error" |
| 11531 | |
| 11532 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11533 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11534 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11535 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 11536 | "$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" \ |
| 11537 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11538 | 0 \ |
| 11539 | -c "client hello, adding use_srtp extension" \ |
| 11540 | -c "found use_srtp extension" \ |
| 11541 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11542 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11543 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11544 | -C "error" |
| 11545 | |
| 11546 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11547 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11548 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11549 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 11550 | "$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" \ |
| 11551 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11552 | 0 \ |
| 11553 | -c "client hello, adding use_srtp extension" \ |
| 11554 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11555 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11556 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11557 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11558 | -C "error" |
| 11559 | |
| 11560 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11561 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11562 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11563 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 11564 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11565 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11566 | 0 \ |
| 11567 | -c "client hello, adding use_srtp extension" \ |
| 11568 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11569 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11570 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11571 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11572 | -C "error" |
| 11573 | |
| 11574 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11575 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11576 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11577 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 11578 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11579 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11580 | 0 \ |
| 11581 | -c "client hello, adding use_srtp extension" \ |
| 11582 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11583 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11584 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11585 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11586 | -C "error" |
| 11587 | |
| 11588 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11589 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11590 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11591 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 11592 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11593 | "$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] | 11594 | 0 \ |
| 11595 | -c "client hello, adding use_srtp extension" \ |
| 11596 | -C "found use_srtp extension" \ |
| 11597 | -C "found srtp profile" \ |
| 11598 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11599 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11600 | -C "error" |
| 11601 | |
| 11602 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11603 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11604 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11605 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 11606 | "$G_SRV -u" \ |
| 11607 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11608 | 0 \ |
| 11609 | -c "client hello, adding use_srtp extension" \ |
| 11610 | -C "found use_srtp extension" \ |
| 11611 | -C "found srtp profile" \ |
| 11612 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11613 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11614 | -C "error" |
| 11615 | |
| 11616 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11617 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11618 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11619 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 11620 | "$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" \ |
| 11621 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11622 | 0 \ |
| 11623 | -c "client hello, adding use_srtp extension" \ |
| 11624 | -c "found use_srtp extension" \ |
| 11625 | -c "found srtp profile" \ |
| 11626 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11627 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 11628 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11629 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11630 | -c "dumping 'received mki' (8 bytes)" \ |
| 11631 | -C "error" |
| 11632 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 11633 | # Tests for specific things with "unreliable" UDP connection |
| 11634 | |
| 11635 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11636 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 11637 | run_test "DTLS proxy: reference" \ |
| 11638 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 11639 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 11640 | "$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] | 11641 | 0 \ |
| 11642 | -C "replayed record" \ |
| 11643 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 11644 | -C "Buffer record from epoch" \ |
| 11645 | -S "Buffer record from epoch" \ |
| 11646 | -C "ssl_buffer_message" \ |
| 11647 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 11648 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11649 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 11650 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11651 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 11652 | -c "HTTP/1.0 200 OK" |
| 11653 | |
| 11654 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11655 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11656 | run_test "DTLS proxy: duplicate every packet" \ |
| 11657 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 11658 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 11659 | "$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] | 11660 | 0 \ |
| 11661 | -c "replayed record" \ |
| 11662 | -s "replayed record" \ |
| 11663 | -c "record from another epoch" \ |
| 11664 | -s "record from another epoch" \ |
| 11665 | -S "resend" \ |
| 11666 | -s "Extra-header:" \ |
| 11667 | -c "HTTP/1.0 200 OK" |
| 11668 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11669 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11670 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 11671 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11672 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 11673 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 11674 | 0 \ |
| 11675 | -c "replayed record" \ |
| 11676 | -S "replayed record" \ |
| 11677 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11678 | -s "record from another epoch" \ |
| 11679 | -c "resend" \ |
| 11680 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11681 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11682 | -c "HTTP/1.0 200 OK" |
| 11683 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11684 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11685 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 11686 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11687 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 11688 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 11689 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11690 | -c "next record in same datagram" \ |
| 11691 | -s "next record in same datagram" |
| 11692 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11693 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11694 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 11695 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11696 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 11697 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11698 | 0 \ |
| 11699 | -c "next record in same datagram" \ |
| 11700 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11701 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11702 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 11703 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 11704 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11705 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 11706 | "$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] | 11707 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 11708 | -c "discarding invalid record (mac)" \ |
| 11709 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11710 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11711 | -c "HTTP/1.0 200 OK" \ |
| 11712 | -S "too many records with bad MAC" \ |
| 11713 | -S "Verification of the message MAC failed" |
| 11714 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11715 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11716 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 11717 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11718 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 11719 | "$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] | 11720 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 11721 | -C "discarding invalid record (mac)" \ |
| 11722 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11723 | -S "Extra-header:" \ |
| 11724 | -C "HTTP/1.0 200 OK" \ |
| 11725 | -s "too many records with bad MAC" \ |
| 11726 | -s "Verification of the message MAC failed" |
| 11727 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11728 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11729 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 11730 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11731 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 11732 | "$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] | 11733 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 11734 | -c "discarding invalid record (mac)" \ |
| 11735 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11736 | -s "Extra-header:" \ |
| 11737 | -c "HTTP/1.0 200 OK" \ |
| 11738 | -S "too many records with bad MAC" \ |
| 11739 | -S "Verification of the message MAC failed" |
| 11740 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11741 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11742 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 11743 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11744 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 11745 | "$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] | 11746 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 11747 | -c "discarding invalid record (mac)" \ |
| 11748 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11749 | -s "Extra-header:" \ |
| 11750 | -c "HTTP/1.0 200 OK" \ |
| 11751 | -s "too many records with bad MAC" \ |
| 11752 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11753 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11754 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11755 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 11756 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 11757 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 11758 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11759 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11760 | -c "record from another epoch" \ |
| 11761 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11762 | -s "Extra-header:" \ |
| 11763 | -c "HTTP/1.0 200 OK" |
| 11764 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 11765 | # Tests for reordering support with DTLS |
| 11766 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11767 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11768 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11769 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 11770 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11771 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11772 | hs_timeout=2500-60000" \ |
| 11773 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11774 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 11775 | 0 \ |
| 11776 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11777 | -c "Next handshake message has been buffered - load"\ |
| 11778 | -S "Buffering HS message" \ |
| 11779 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11780 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11781 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11782 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11783 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 11784 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11785 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11786 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 11787 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 11788 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11789 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11790 | hs_timeout=2500-60000" \ |
| 11791 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11792 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 11793 | 0 \ |
| 11794 | -c "Buffering HS message" \ |
| 11795 | -c "found fragmented DTLS handshake message"\ |
| 11796 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 11797 | -c "Next handshake message has been buffered - load"\ |
| 11798 | -S "Buffering HS message" \ |
| 11799 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11800 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 11801 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11802 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 11803 | -S "Remember CCS message" |
| 11804 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11805 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 11806 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 11807 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 11808 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11809 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11810 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11811 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11812 | 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] | 11813 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11814 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11815 | hs_timeout=2500-60000" \ |
| 11816 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11817 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 11818 | 0 \ |
| 11819 | -c "Buffering HS message" \ |
| 11820 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11821 | -C "attempt to make space by freeing buffered messages" \ |
| 11822 | -S "Buffering HS message" \ |
| 11823 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11824 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11825 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11826 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11827 | -S "Remember CCS message" |
| 11828 | |
| 11829 | # The size constraints ensure that the delayed certificate message can't |
| 11830 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 11831 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11832 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11833 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 11834 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11835 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11836 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 11837 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11838 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11839 | hs_timeout=2500-60000" \ |
| 11840 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11841 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11842 | 0 \ |
| 11843 | -c "Buffering HS message" \ |
| 11844 | -c "attempt to make space by freeing buffered future messages" \ |
| 11845 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 11846 | -S "Buffering HS message" \ |
| 11847 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11848 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 11849 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11850 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 11851 | -S "Remember CCS message" |
| 11852 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11853 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11854 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11855 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 11856 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11857 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 11858 | hs_timeout=2500-60000" \ |
| 11859 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11860 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11861 | 0 \ |
| 11862 | -C "Buffering HS message" \ |
| 11863 | -C "Next handshake message has been buffered - load"\ |
| 11864 | -s "Buffering HS message" \ |
| 11865 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11866 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11867 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11868 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11869 | -S "Remember CCS message" |
| 11870 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11871 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11872 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 11873 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11874 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 11875 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11876 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11877 | hs_timeout=2500-60000" \ |
| 11878 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11879 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11880 | 0 \ |
| 11881 | -C "Buffering HS message" \ |
| 11882 | -C "Next handshake message has been buffered - load"\ |
| 11883 | -S "Buffering HS message" \ |
| 11884 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11885 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11886 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11887 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11888 | -S "Remember CCS message" |
| 11889 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11890 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11891 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11892 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 11893 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11894 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11895 | hs_timeout=2500-60000" \ |
| 11896 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11897 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11898 | 0 \ |
| 11899 | -C "Buffering HS message" \ |
| 11900 | -C "Next handshake message has been buffered - load"\ |
| 11901 | -S "Buffering HS message" \ |
| 11902 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11903 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11904 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11905 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11906 | -s "Remember CCS message" |
| 11907 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11908 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11909 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11910 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11911 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11912 | hs_timeout=2500-60000" \ |
| 11913 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11914 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 11915 | 0 \ |
| 11916 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11917 | -s "Found buffered record from current epoch - load" \ |
| 11918 | -c "Buffer record from epoch 1" \ |
| 11919 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11920 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11921 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 11922 | # from the server are delayed, so that the encrypted Finished message |
| 11923 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 11924 | # in afterwards, the encrypted Finished message must be freed in order |
| 11925 | # to make space for the NewSessionTicket to be reassembled. |
| 11926 | # This works only in very particular circumstances: |
| 11927 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 11928 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 11929 | # the encrypted Finished message. |
| 11930 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 11931 | # needs to be fragmented. |
| 11932 | # - All messages sent by the server must be small enough to be either sent |
| 11933 | # without fragmentation or be reassembled within the bounds of |
| 11934 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 11935 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 11936 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 11937 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11938 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 11939 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 11940 | "$P_SRV mtu=140 response_size=90 dgram_packing=0 psk=73776f726466697368 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 11941 | "$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] | 11942 | 0 \ |
| 11943 | -s "Buffer record from epoch 1" \ |
| 11944 | -s "Found buffered record from current epoch - load" \ |
| 11945 | -c "Buffer record from epoch 1" \ |
| 11946 | -C "Found buffered record from current epoch - load" \ |
| 11947 | -c "Enough space available after freeing future epoch record" |
| 11948 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 11949 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 11950 | |
| 11951 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11952 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 11953 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Gilles Peskine | 78df617 | 2024-09-07 19:50:46 +0200 | [diff] [blame] | 11954 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 11955 | psk=73776f726466697368" \ |
| 11956 | "$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] | 11957 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11958 | 0 \ |
| 11959 | -s "Extra-header:" \ |
| 11960 | -c "HTTP/1.0 200 OK" |
| 11961 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11962 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11963 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 11964 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11965 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 11966 | "$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] | 11967 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 11968 | 0 \ |
| 11969 | -s "Extra-header:" \ |
| 11970 | -c "HTTP/1.0 200 OK" |
| 11971 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11972 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11973 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11974 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 11975 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11976 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 11977 | "$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] | 11978 | 0 \ |
| 11979 | -s "Extra-header:" \ |
| 11980 | -c "HTTP/1.0 200 OK" |
| 11981 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11982 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11983 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11984 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 11985 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11986 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 11987 | "$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] | 11988 | 0 \ |
| 11989 | -s "Extra-header:" \ |
| 11990 | -c "HTTP/1.0 200 OK" |
| 11991 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11992 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11993 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 11994 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11995 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 11996 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11997 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 11998 | "$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] | 11999 | 0 \ |
| 12000 | -s "Extra-header:" \ |
| 12001 | -c "HTTP/1.0 200 OK" |
| 12002 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12003 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12004 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12005 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12006 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 12007 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12008 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 12009 | "$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] | 12010 | 0 \ |
| 12011 | -s "Extra-header:" \ |
| 12012 | -c "HTTP/1.0 200 OK" |
| 12013 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12014 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12015 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12016 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12017 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 12018 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12019 | "$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] | 12020 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12021 | "$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] | 12022 | 0 \ |
| 12023 | -s "Extra-header:" \ |
| 12024 | -c "HTTP/1.0 200 OK" |
| 12025 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12026 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 12027 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 12028 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 12029 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12030 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12031 | psk=73776f726466697368 debug_level=3" \ |
| 12032 | "$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] | 12033 | 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] | 12034 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12035 | 0 \ |
| 12036 | -s "a session has been resumed" \ |
| 12037 | -c "a session has been resumed" \ |
| 12038 | -s "Extra-header:" \ |
| 12039 | -c "HTTP/1.0 200 OK" |
| 12040 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12041 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 12042 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 12043 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 12044 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12045 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12046 | psk=73776f726466697368 debug_level=3 nbio=2" \ |
| 12047 | "$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] | 12048 | 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] | 12049 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 12050 | 0 \ |
| 12051 | -s "a session has been resumed" \ |
| 12052 | -c "a session has been resumed" \ |
| 12053 | -s "Extra-header:" \ |
| 12054 | -c "HTTP/1.0 200 OK" |
| 12055 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12056 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12057 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12058 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 12059 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12060 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12061 | psk=73776f726466697368 renegotiation=1 debug_level=2" \ |
| 12062 | "$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] | 12063 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 12064 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12065 | 0 \ |
| 12066 | -c "=> renegotiate" \ |
| 12067 | -s "=> renegotiate" \ |
| 12068 | -s "Extra-header:" \ |
| 12069 | -c "HTTP/1.0 200 OK" |
| 12070 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12071 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12072 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12073 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 12074 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12075 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12076 | psk=73776f726466697368 renegotiation=1 debug_level=2" \ |
| 12077 | "$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] | 12078 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12079 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12080 | 0 \ |
| 12081 | -c "=> renegotiate" \ |
| 12082 | -s "=> renegotiate" \ |
| 12083 | -s "Extra-header:" \ |
| 12084 | -c "HTTP/1.0 200 OK" |
| 12085 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12086 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12087 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12088 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 12089 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12090 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12091 | psk=73776f726466697368 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12092 | debug_level=2" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12093 | "$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] | 12094 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12095 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12096 | 0 \ |
| 12097 | -c "=> renegotiate" \ |
| 12098 | -s "=> renegotiate" \ |
| 12099 | -s "Extra-header:" \ |
| 12100 | -c "HTTP/1.0 200 OK" |
| 12101 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12102 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12103 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12104 | 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] | 12105 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12106 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12107 | psk=73776f726466697368 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12108 | debug_level=2 nbio=2" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12109 | "$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] | 12110 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12111 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12112 | 0 \ |
| 12113 | -c "=> renegotiate" \ |
| 12114 | -s "=> renegotiate" \ |
| 12115 | -s "Extra-header:" \ |
| 12116 | -c "HTTP/1.0 200 OK" |
| 12117 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12118 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 12119 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 12120 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error |
| 12121 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12122 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12123 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12124 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12125 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 12126 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 12127 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ |
| 12128 | "$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] | 12129 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 12130 | -c "HTTP/1.0 200 OK" |
| 12131 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12132 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12133 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12134 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12135 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12136 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 12137 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12138 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12139 | "$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] | 12140 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12141 | -c "HTTP/1.0 200 OK" |
| 12142 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12143 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12144 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12145 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12147 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 12148 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12149 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12150 | "$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] | 12151 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12152 | -c "HTTP/1.0 200 OK" |
| 12153 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 12154 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12155 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12156 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12157 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12158 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 12159 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 12160 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12161 | "$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] | 12162 | 0 \ |
| 12163 | -s "Extra-header:" \ |
| 12164 | -c "Extra-header:" |
| 12165 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12166 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12167 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12168 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12169 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12170 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 12171 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12172 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12173 | "$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] | 12174 | 0 \ |
| 12175 | -s "Extra-header:" \ |
| 12176 | -c "Extra-header:" |
| 12177 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12178 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12179 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12180 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12181 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12182 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 12183 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12184 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12185 | "$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] | 12186 | 0 \ |
| 12187 | -s "Extra-header:" \ |
| 12188 | -c "Extra-header:" |
| 12189 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12190 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12191 | run_test "export keys functionality" \ |
| 12192 | "$P_SRV eap_tls=1 debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 12193 | "$P_CLI force_version=tls12 eap_tls=1 debug_level=3" \ |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12194 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 12195 | -c "EAP-TLS key material is:"\ |
| 12196 | -s "EAP-TLS key material is:"\ |
| 12197 | -c "EAP-TLS IV is:" \ |
| 12198 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12199 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 12200 | # openssl feature tests: check if tls1.3 exists. |
| 12201 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12202 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 12203 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 12204 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 12205 | 0 \ |
| 12206 | -c "TLS 1.3" \ |
| 12207 | -s "TLS 1.3" |
| 12208 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 12209 | # 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] | 12210 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 12211 | requires_gnutls_next_no_ticket |
| 12212 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12213 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 12214 | "$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] | 12215 | "$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] | 12216 | 0 \ |
| 12217 | -s "Version: TLS1.3" \ |
| 12218 | -c "Version: TLS1.3" |
| 12219 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 12220 | # TLS1.3 test cases |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12221 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12222 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12223 | requires_ciphersuite_enabled TLS1-3-CHACHA20-POLY1305-SHA256 |
Valerio Setti | cf29c5d | 2023-09-01 09:03:41 +0200 | [diff] [blame] | 12224 | requires_any_configs_enabled "PSA_WANT_ECC_MONTGOMERY_255" |
| 12225 | requires_any_configs_enabled "PSA_WANT_ECC_SECP_R1_256" |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12226 | run_test "TLS 1.3: Default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12227 | "$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] | 12228 | "$P_CLI allow_sha1=0" \ |
| 12229 | 0 \ |
| 12230 | -s "Protocol is TLSv1.3" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12231 | -s "Ciphersuite is TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12232 | -s "ECDH/FFDH group: " \ |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12233 | -s "selected signature algorithm ecdsa_secp256r1_sha256" |
| 12234 | |
Ronald Cron | 587cfe6 | 2024-02-08 08:56:09 +0100 | [diff] [blame] | 12235 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12236 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12237 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 12238 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 12239 | run_test "Establish TLS 1.2 then TLS 1.3 session" \ |
| 12240 | "$P_SRV" \ |
| 12241 | "( $P_CLI force_version=tls12; \ |
| 12242 | $P_CLI force_version=tls13 )" \ |
| 12243 | 0 \ |
| 12244 | -s "Protocol is TLSv1.2" \ |
| 12245 | -s "Protocol is TLSv1.3" \ |
| 12246 | |
Ronald Cron | 90abb22 | 2024-02-08 09:02:49 +0100 | [diff] [blame] | 12247 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12248 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12249 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 12250 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 12251 | run_test "Establish TLS 1.3 then TLS 1.2 session" \ |
| 12252 | "$P_SRV" \ |
| 12253 | "( $P_CLI force_version=tls13; \ |
| 12254 | $P_CLI force_version=tls12 )" \ |
| 12255 | 0 \ |
| 12256 | -s "Protocol is TLSv1.3" \ |
| 12257 | -s "Protocol is TLSv1.2" \ |
| 12258 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12259 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12260 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12261 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12262 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12263 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12264 | "$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] | 12265 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 12266 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12267 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12268 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12269 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12270 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12271 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12272 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12273 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12274 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12275 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12276 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12277 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12278 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12279 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12280 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12281 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 12282 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12283 | -c "=> parse certificate verify" \ |
| 12284 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12285 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12286 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 12287 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12288 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 12289 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 12290 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 12291 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12292 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12293 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12294 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12295 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12296 | "$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] | 12297 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 12298 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12299 | -s "SERVER HELLO was queued" \ |
| 12300 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12301 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12302 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12303 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12304 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12305 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12306 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12307 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12308 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12309 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12310 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12311 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12312 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12313 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12314 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 12315 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12316 | -c "=> parse certificate verify" \ |
| 12317 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12318 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12319 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 12320 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12321 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12322 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12323 | requires_openssl_tls1_3_with_compatible_ephemeral |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12324 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12325 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12326 | requires_config_enabled MBEDTLS_SSL_ALPN |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12327 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12328 | run_test "TLS 1.3: alpn - openssl" \ |
| 12329 | "$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] | 12330 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12331 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12332 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12333 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12334 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12335 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12336 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12337 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12338 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12339 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12340 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12341 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12342 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12343 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12344 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12345 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12346 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12347 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12348 | -c "=> parse certificate verify" \ |
| 12349 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12350 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 12351 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12352 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12353 | -c "HTTP/1.0 200 ok" \ |
| 12354 | -c "Application Layer Protocol is h2" |
| 12355 | |
| 12356 | requires_gnutls_tls1_3 |
| 12357 | requires_gnutls_next_no_ticket |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12358 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12359 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12360 | requires_config_enabled MBEDTLS_SSL_ALPN |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12361 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12362 | run_test "TLS 1.3: alpn - gnutls" \ |
| 12363 | "$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] | 12364 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12365 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12366 | -s "SERVER HELLO was queued" \ |
| 12367 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12368 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12369 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12370 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12371 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12372 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12373 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12374 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12375 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12376 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12377 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12378 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12379 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12380 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12381 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12382 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12383 | -c "=> parse certificate verify" \ |
| 12384 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12385 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 12386 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12387 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12388 | -c "HTTP/1.0 200 OK" \ |
| 12389 | -c "Application Layer Protocol is h2" |
| 12390 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12391 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12392 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 12393 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12394 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12395 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12396 | run_test "TLS 1.3: server alpn - openssl" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12397 | "$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] | 12398 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ |
| 12399 | 0 \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12400 | -s "found alpn extension" \ |
| 12401 | -s "server side, adding alpn extension" \ |
| 12402 | -s "Protocol is TLSv1.3" \ |
| 12403 | -s "HTTP/1.0 200 OK" \ |
| 12404 | -s "Application Layer Protocol is h2" |
| 12405 | |
| 12406 | requires_gnutls_tls1_3 |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12407 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 12408 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12409 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12410 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12411 | run_test "TLS 1.3: server alpn - gnutls" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12412 | "$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] | 12413 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ |
| 12414 | 0 \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12415 | -s "found alpn extension" \ |
| 12416 | -s "server side, adding alpn extension" \ |
| 12417 | -s "Protocol is TLSv1.3" \ |
| 12418 | -s "HTTP/1.0 200 OK" \ |
| 12419 | -s "Application Layer Protocol is h2" |
| 12420 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12421 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12422 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12423 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12424 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12425 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12426 | "$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] | 12427 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12428 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12429 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12430 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12431 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12432 | -c "HTTP/1.0 200 ok" \ |
| 12433 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12434 | |
| 12435 | requires_gnutls_tls1_3 |
| 12436 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12437 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12438 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12439 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12440 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12441 | "$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] | 12442 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12443 | 0 \ |
| 12444 | -c "got a certificate request" \ |
| 12445 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 12446 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12447 | -c "HTTP/1.0 200 OK" \ |
| 12448 | -c "Protocol is TLSv1.3" |
| 12449 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12450 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12451 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12452 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12453 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12454 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12455 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12456 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12457 | "$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] | 12458 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12459 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12460 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12461 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12462 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12463 | |
| 12464 | requires_gnutls_tls1_3 |
| 12465 | requires_gnutls_next_no_ticket |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12466 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12467 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12468 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12469 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12470 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12471 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/cli2.crt \ |
| 12472 | key_file=$DATA_FILES_PATH/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 12473 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12474 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12475 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12476 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12477 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12478 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12479 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12480 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12481 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12482 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12483 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12484 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12485 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12486 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12487 | 0 \ |
| 12488 | -c "got a certificate request" \ |
| 12489 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12490 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12491 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12492 | |
| 12493 | requires_gnutls_tls1_3 |
| 12494 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12495 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12496 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12497 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12498 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12499 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12500 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12501 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12502 | 0 \ |
| 12503 | -c "got a certificate request" \ |
| 12504 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12505 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12506 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12507 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12508 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12509 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12510 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12511 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12512 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12513 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12514 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12515 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12516 | 0 \ |
| 12517 | -c "got a certificate request" \ |
| 12518 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12519 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12520 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12521 | |
| 12522 | requires_gnutls_tls1_3 |
| 12523 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12524 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12525 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12526 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12527 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12528 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12529 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12530 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12531 | 0 \ |
| 12532 | -c "got a certificate request" \ |
| 12533 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12534 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12535 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12536 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12537 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12538 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12539 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12540 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12541 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12542 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12543 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12544 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12545 | 0 \ |
| 12546 | -c "got a certificate request" \ |
| 12547 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12548 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12549 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12550 | |
| 12551 | requires_gnutls_tls1_3 |
| 12552 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12553 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12554 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12555 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12556 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12557 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12558 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12559 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12560 | 0 \ |
| 12561 | -c "got a certificate request" \ |
| 12562 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12563 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12564 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12565 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12566 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12567 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12568 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12569 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12570 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12571 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12572 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12573 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12574 | 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] | 12575 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12576 | -c "got a certificate request" \ |
| 12577 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12578 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12579 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12580 | |
| 12581 | requires_gnutls_tls1_3 |
| 12582 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12583 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12584 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12585 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12586 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12587 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12588 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12589 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12590 | 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] | 12591 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12592 | -c "got a certificate request" \ |
| 12593 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12594 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12595 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12596 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12597 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12598 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12599 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12600 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12601 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12602 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 12603 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12604 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12605 | 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] | 12606 | 0 \ |
| 12607 | -c "got a certificate request" \ |
| 12608 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12609 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12610 | -c "Protocol is TLSv1.3" |
| 12611 | |
| 12612 | requires_gnutls_tls1_3 |
| 12613 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12614 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12615 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12616 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12617 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12618 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 12619 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12620 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12621 | 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] | 12622 | 0 \ |
| 12623 | -c "got a certificate request" \ |
| 12624 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12625 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12626 | -c "Protocol is TLSv1.3" |
| 12627 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12628 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12629 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12630 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12631 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12632 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12633 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 12634 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12635 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12636 | 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] | 12637 | 0 \ |
| 12638 | -c "got a certificate request" \ |
| 12639 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12640 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12641 | -c "Protocol is TLSv1.3" |
| 12642 | |
| 12643 | requires_gnutls_tls1_3 |
| 12644 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12645 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12646 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12647 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12648 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12649 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 12650 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12651 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12652 | 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] | 12653 | 0 \ |
| 12654 | -c "got a certificate request" \ |
| 12655 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12656 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12657 | -c "Protocol is TLSv1.3" |
| 12658 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12659 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12660 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12661 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12662 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12663 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 12664 | 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] | 12665 | "$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] | 12666 | -sigalgs ecdsa_secp256r1_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12667 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12668 | 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] | 12669 | 1 \ |
| 12670 | -c "got a certificate request" \ |
| 12671 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12672 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 12673 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12674 | |
| 12675 | requires_gnutls_tls1_3 |
| 12676 | requires_gnutls_next_no_ticket |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12677 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12678 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12679 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12680 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12681 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 12682 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12683 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12684 | 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] | 12685 | 1 \ |
| 12686 | -c "got a certificate request" \ |
| 12687 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12688 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 12689 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12690 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12691 | # Test using an opaque private key for client authentication |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12692 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12693 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12694 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12695 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12696 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 12697 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12698 | "$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] | 12699 | 0 \ |
| 12700 | -c "got a certificate request" \ |
| 12701 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12702 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12703 | -c "Protocol is TLSv1.3" |
| 12704 | |
| 12705 | requires_gnutls_tls1_3 |
| 12706 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12707 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12708 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12709 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12710 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 12711 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12712 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/cli2.crt \ |
| 12713 | key_file=$DATA_FILES_PATH/cli2.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12714 | 0 \ |
| 12715 | -c "got a certificate request" \ |
| 12716 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12717 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12718 | -c "Protocol is TLSv1.3" |
| 12719 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12720 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12721 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12722 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12723 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12724 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 12725 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12726 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12727 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12728 | 0 \ |
| 12729 | -c "got a certificate request" \ |
| 12730 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12731 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12732 | -c "Protocol is TLSv1.3" |
| 12733 | |
| 12734 | requires_gnutls_tls1_3 |
| 12735 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12736 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12737 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12738 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12739 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 12740 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12741 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12742 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12743 | 0 \ |
| 12744 | -c "got a certificate request" \ |
| 12745 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12746 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12747 | -c "Protocol is TLSv1.3" |
| 12748 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12749 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12750 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12751 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12752 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12753 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 12754 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12755 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12756 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12757 | 0 \ |
| 12758 | -c "got a certificate request" \ |
| 12759 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12760 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12761 | -c "Protocol is TLSv1.3" |
| 12762 | |
| 12763 | requires_gnutls_tls1_3 |
| 12764 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12765 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12766 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12767 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12768 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 12769 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12770 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12771 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12772 | 0 \ |
| 12773 | -c "got a certificate request" \ |
| 12774 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12775 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12776 | -c "Protocol is TLSv1.3" |
| 12777 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12778 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12779 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12780 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12781 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12782 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 12783 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12784 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12785 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12786 | 0 \ |
| 12787 | -c "got a certificate request" \ |
| 12788 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12789 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12790 | -c "Protocol is TLSv1.3" |
| 12791 | |
| 12792 | requires_gnutls_tls1_3 |
| 12793 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12794 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12795 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12796 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12797 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 12798 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12799 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12800 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12801 | 0 \ |
| 12802 | -c "got a certificate request" \ |
| 12803 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12804 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12805 | -c "Protocol is TLSv1.3" |
| 12806 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12807 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12808 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12809 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12810 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12811 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12812 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 12813 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12814 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12815 | 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] | 12816 | 0 \ |
| 12817 | -c "got a certificate request" \ |
| 12818 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12819 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12820 | -c "Protocol is TLSv1.3" |
| 12821 | |
| 12822 | requires_gnutls_tls1_3 |
| 12823 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12824 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12825 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12826 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12827 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12828 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 12829 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12830 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12831 | 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] | 12832 | 0 \ |
| 12833 | -c "got a certificate request" \ |
| 12834 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12835 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12836 | -c "Protocol is TLSv1.3" |
| 12837 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12838 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12839 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12840 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12841 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12842 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12843 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 12844 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12845 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12846 | 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] | 12847 | 0 \ |
| 12848 | -c "got a certificate request" \ |
| 12849 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12850 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12851 | -c "Protocol is TLSv1.3" |
| 12852 | |
| 12853 | requires_gnutls_tls1_3 |
| 12854 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12855 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12856 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12857 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12858 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12859 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 12860 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12861 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12862 | 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] | 12863 | 0 \ |
| 12864 | -c "got a certificate request" \ |
| 12865 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12866 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12867 | -c "Protocol is TLSv1.3" |
| 12868 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12869 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12870 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12871 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12872 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12873 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12874 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 12875 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12876 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12877 | 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] | 12878 | 0 \ |
| 12879 | -c "got a certificate request" \ |
| 12880 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12881 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12882 | -c "Protocol is TLSv1.3" |
| 12883 | |
| 12884 | requires_gnutls_tls1_3 |
| 12885 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12886 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12887 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12888 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12889 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12890 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \ |
| 12891 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12892 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12893 | 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] | 12894 | 0 \ |
| 12895 | -c "got a certificate request" \ |
| 12896 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12897 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12898 | -c "Protocol is TLSv1.3" |
| 12899 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12900 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12901 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12902 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12903 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12904 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12905 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 12906 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 12907 | -sigalgs ecdsa_secp256r1_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12908 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12909 | 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] | 12910 | 1 \ |
| 12911 | -c "got a certificate request" \ |
| 12912 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12913 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 12914 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12915 | |
| 12916 | requires_gnutls_tls1_3 |
| 12917 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12918 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12919 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12920 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12921 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12922 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 12923 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12924 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12925 | 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] | 12926 | 1 \ |
| 12927 | -c "got a certificate request" \ |
| 12928 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12929 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 12930 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12931 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12932 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12933 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12934 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12935 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12936 | 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] | 12937 | "$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] | 12938 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12939 | 0 \ |
| 12940 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12941 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12942 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12943 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12944 | -c "HTTP/1.0 200 ok" |
| 12945 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12946 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12947 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12948 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12949 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12950 | 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] | 12951 | "$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] | 12952 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12953 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12954 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12955 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12956 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12957 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12958 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12959 | |
| 12960 | requires_gnutls_tls1_3 |
| 12961 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12962 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12963 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 12964 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12965 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12966 | 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] | 12967 | "$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] | 12968 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12969 | 0 \ |
| 12970 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12971 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12972 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12973 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12974 | -c "HTTP/1.0 200 OK" |
| 12975 | |
| 12976 | requires_gnutls_tls1_3 |
| 12977 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12978 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12979 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 12980 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12981 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12982 | 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] | 12983 | "$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] | 12984 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12985 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12986 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12987 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12988 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12989 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12990 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12991 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12992 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12993 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12994 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12995 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12996 | run_test "TLS 1.3: Server side check - openssl" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12997 | "$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] | 12998 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 12999 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 13000 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13001 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13002 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13003 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 13004 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13005 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13006 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 13007 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13008 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13009 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13010 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13011 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13012 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13013 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13014 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13015 | "$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] | 13016 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13017 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13018 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13019 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13020 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13021 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 13022 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13023 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13024 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13025 | -s "=> parse client hello" \ |
| 13026 | -s "<= parse client hello" |
| 13027 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13028 | requires_gnutls_tls1_3 |
| 13029 | requires_gnutls_next_no_ticket |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13030 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 13031 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13032 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 13033 | run_test "TLS 1.3: Server side check - gnutls" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13034 | "$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] | 13035 | "$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] | 13036 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 13037 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13038 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13039 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13040 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 13041 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13042 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13043 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 13044 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 13045 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13046 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13047 | requires_gnutls_tls1_3 |
| 13048 | requires_gnutls_next_no_ticket |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13049 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13050 | requires_config_enabled MBEDTLS_SSL_SRV_C |
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 |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13052 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13053 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13054 | "$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] | 13055 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13056 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13057 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13058 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13059 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13060 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 13061 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13062 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13063 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13064 | -s "=> parse client hello" \ |
| 13065 | -s "<= parse client hello" |
| 13066 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13067 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13068 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 13069 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13070 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13071 | run_test "TLS 1.3: Server side check - mbedtls" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13072 | "$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] | 13073 | "$P_CLI debug_level=4" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 13074 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13075 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13076 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13077 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13078 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13079 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13080 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13081 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 13082 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 13083 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 13084 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13085 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13086 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13087 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13088 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13089 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13090 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13091 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13092 | "$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] | 13093 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13094 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13095 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13096 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13097 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13098 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13099 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13100 | -s "=> parse client hello" \ |
| 13101 | -s "<= parse client hello" |
| 13102 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13103 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13104 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13105 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13106 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13107 | run_test "TLS 1.3: Server side check - mbedtls with client empty certificate" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13108 | "$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] | 13109 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13110 | 1 \ |
| 13111 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13112 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13113 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13114 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13115 | -s "=> write certificate request" \ |
| 13116 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 13117 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13118 | -s "=> parse client hello" \ |
| 13119 | -s "<= parse client hello" |
| 13120 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13121 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13122 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13123 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13124 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13125 | run_test "TLS 1.3: Server side check - mbedtls with optional client authentication" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13126 | "$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] | 13127 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13128 | 0 \ |
| 13129 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13130 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13131 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13132 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13133 | -s "=> write certificate request" \ |
| 13134 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13135 | -s "=> parse client hello" \ |
| 13136 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13137 | |
| 13138 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13139 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13140 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13141 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13142 | requires_config_enabled PSA_WANT_ALG_ECDH |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13143 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13144 | "$P_SRV debug_level=4 groups=secp384r1" \ |
| 13145 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 13146 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13147 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13148 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13149 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13150 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 13151 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13152 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13153 | -s "=> write hello retry request" \ |
| 13154 | -s "<= write hello retry request" |
| 13155 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13156 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13157 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13158 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13159 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13160 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13161 | "$P_SRV debug_level=4 crt_file=none key_file=none" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 13162 | "$P_CLI debug_level=4" \ |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13163 | 1 \ |
| 13164 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13165 | -s "No certificate available." |
| 13166 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13167 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13168 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13169 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13170 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13171 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13172 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13173 | 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,-,-,-" \ |
| 13174 | "$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] | 13175 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13176 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13177 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13178 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 13179 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13180 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13181 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13182 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13183 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13184 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13185 | 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,-,-,-" \ |
| 13186 | "$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] | 13187 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13188 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13189 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13190 | |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 13191 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13192 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13193 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13194 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13195 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13196 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13197 | 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,-,-,-" \ |
| 13198 | "$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] | 13199 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13200 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13201 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 13202 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 13203 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 13204 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 13205 | TEST_SUITE_NAME=${i##*/} |
| 13206 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 13207 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 13208 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 13209 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 13210 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13211 | # Test 1.3 compatibility mode |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13212 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13213 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13214 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13215 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13216 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13217 | 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] | 13218 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13219 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13220 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13221 | -s "Protocol is TLSv1.3" \ |
| 13222 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13223 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13224 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13225 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13226 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13227 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13228 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13229 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13230 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13231 | run_test "TLS 1.3 m->m both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13232 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13233 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13234 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13235 | -s "Protocol is TLSv1.3" \ |
| 13236 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13237 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13238 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13239 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13240 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13241 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13242 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13243 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13244 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13245 | 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] | 13246 | "$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] | 13247 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13248 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13249 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13250 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13251 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13252 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13253 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13254 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13255 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13256 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13257 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13258 | 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] | 13259 | "$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] | 13260 | "$P_CLI debug_level=4" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13261 | 0 \ |
| 13262 | -c "Protocol is TLSv1.3" \ |
| 13263 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13264 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13265 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13266 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13267 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13268 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13269 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13270 | run_test "TLS 1.3 m->O both with middlebox compat support" \ |
| 13271 | "$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] | 13272 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13273 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13274 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13275 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13276 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13277 | requires_gnutls_tls1_3 |
| 13278 | requires_gnutls_next_no_ticket |
| 13279 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13280 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13281 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13282 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13283 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13284 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 13285 | "$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] | 13286 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13287 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13288 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13289 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13290 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13291 | |
| 13292 | requires_gnutls_tls1_3 |
| 13293 | requires_gnutls_next_no_ticket |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13294 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13295 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13296 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13297 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13298 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 13299 | "$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] | 13300 | "$P_CLI debug_level=4" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13301 | 0 \ |
| 13302 | -c "Protocol is TLSv1.3" \ |
| 13303 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13304 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13305 | requires_gnutls_tls1_3 |
| 13306 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13307 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13308 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13309 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13310 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13311 | run_test "TLS 1.3 m->G both with middlebox compat support" \ |
| 13312 | "$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] | 13313 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13314 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13315 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13316 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13317 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13318 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13319 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13320 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13321 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13322 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13323 | run_test "TLS 1.3 O->m both peers do not support middlebox compatibility" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13324 | "$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] | 13325 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13326 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13327 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13328 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13329 | -C "14 03 03 00 01" |
| 13330 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13331 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13332 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13333 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13334 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13335 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13336 | run_test "TLS 1.3 O->m server with middlebox compat support, not client" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13337 | "$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] | 13338 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13339 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13340 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13341 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" |
| 13342 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13343 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13344 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13345 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13346 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13347 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13348 | run_test "TLS 1.3 O->m both with middlebox compat support" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13349 | "$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] | 13350 | "$O_NEXT_CLI -msg -debug" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13351 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13352 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13353 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13354 | -c "14 03 03 00 01" |
| 13355 | |
| 13356 | requires_gnutls_tls1_3 |
| 13357 | requires_gnutls_next_no_ticket |
| 13358 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13359 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13360 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13361 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13362 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13363 | run_test "TLS 1.3 G->m both peers do not support middlebox compatibility" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13364 | "$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] | 13365 | "$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] | 13366 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13367 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13368 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13369 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 13370 | |
| 13371 | requires_gnutls_tls1_3 |
| 13372 | requires_gnutls_next_no_ticket |
| 13373 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13374 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13375 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13376 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13377 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13378 | run_test "TLS 1.3 G->m server with middlebox compat support, not client" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13379 | "$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] | 13380 | "$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] | 13381 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13382 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13383 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13384 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 13385 | -c "discarding change cipher spec in TLS1.3" |
| 13386 | |
| 13387 | requires_gnutls_tls1_3 |
| 13388 | requires_gnutls_next_no_ticket |
| 13389 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13390 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13391 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13392 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13393 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13394 | run_test "TLS 1.3 G->m both with middlebox compat support" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13395 | "$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] | 13396 | "$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] | 13397 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13398 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13399 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13400 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 13401 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13402 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13403 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13404 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13405 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13406 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13407 | 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] | 13408 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 13409 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13410 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13411 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13412 | -c "Protocol is TLSv1.3" \ |
| 13413 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13414 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13415 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13416 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13417 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13418 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13419 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13420 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13421 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13422 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13423 | 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] | 13424 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 13425 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13426 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13427 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13428 | -c "Protocol is TLSv1.3" \ |
| 13429 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13430 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13431 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13432 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13433 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13434 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13435 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13436 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13437 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13438 | run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ |
| 13439 | "$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] | 13440 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13441 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13442 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13443 | -c "received HelloRetryRequest message" \ |
| 13444 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13445 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13446 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13447 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13448 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13449 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13450 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13451 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13452 | run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ |
| 13453 | "$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] | 13454 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13455 | 0 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13456 | -c "received HelloRetryRequest message" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13457 | -c "Protocol is TLSv1.3" \ |
| 13458 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13459 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13460 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13461 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13462 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13463 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13464 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13465 | run_test "TLS 1.3 m->O HRR both with middlebox compat support" \ |
| 13466 | "$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] | 13467 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13468 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13469 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13470 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13471 | |
| 13472 | requires_gnutls_tls1_3 |
| 13473 | requires_gnutls_next_no_ticket |
| 13474 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13475 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13476 | requires_config_enabled MBEDTLS_DEBUG_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 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13479 | run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ |
| 13480 | "$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] | 13481 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13482 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13483 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13484 | -c "received HelloRetryRequest message" \ |
| 13485 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13486 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13487 | |
| 13488 | requires_gnutls_tls1_3 |
| 13489 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13490 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13491 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13492 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13493 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13494 | run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \ |
| 13495 | "$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] | 13496 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13497 | 0 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13498 | -c "received HelloRetryRequest message" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13499 | -c "Protocol is TLSv1.3" \ |
| 13500 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13501 | |
| 13502 | requires_gnutls_tls1_3 |
| 13503 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13504 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13505 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13506 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13507 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13508 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13509 | run_test "TLS 1.3 m->G HRR both with middlebox compat support" \ |
| 13510 | "$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] | 13511 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13512 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13513 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13514 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13515 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13516 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13517 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13518 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13519 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13520 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13521 | run_test "TLS 1.3 O->m HRR both peers do not support middlebox compatibility" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13522 | "$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] | 13523 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13524 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13525 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13526 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13527 | -C "14 03 03 00 01" |
| 13528 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13529 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13530 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13531 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13532 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13533 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13534 | run_test "TLS 1.3 O->m HRR server with middlebox compat support, not client" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13535 | "$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] | 13536 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13537 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13538 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13539 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13540 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13541 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13542 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13543 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13544 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13545 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13546 | run_test "TLS 1.3 O->m HRR both with middlebox compat support" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13547 | "$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] | 13548 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13549 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13550 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13551 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13552 | -c "14 03 03 00 01" |
| 13553 | |
| 13554 | requires_gnutls_tls1_3 |
| 13555 | requires_gnutls_next_no_ticket |
| 13556 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13557 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13558 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13559 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13560 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13561 | run_test "TLS 1.3 G->m HRR both peers do not support middlebox compatibility" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13562 | "$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] | 13563 | "$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] | 13564 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13565 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13566 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13567 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 13568 | |
| 13569 | requires_gnutls_tls1_3 |
| 13570 | requires_gnutls_next_no_ticket |
| 13571 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13572 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13573 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13574 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13575 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13576 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13577 | run_test "TLS 1.3 G->m HRR server with middlebox compat support, not client" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13578 | "$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] | 13579 | "$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] | 13580 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13581 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13582 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13583 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 13584 | -c "discarding change cipher spec in TLS1.3" |
| 13585 | |
| 13586 | requires_gnutls_tls1_3 |
| 13587 | requires_gnutls_next_no_ticket |
| 13588 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13589 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13590 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13591 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13592 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13593 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13594 | run_test "TLS 1.3 G->m HRR both with middlebox compat support" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13595 | "$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] | 13596 | "$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] | 13597 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13598 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13599 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13600 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 13601 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13602 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13603 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13604 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13605 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13606 | run_test "TLS 1.3: Check signature algorithm order, m->O" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13607 | "$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] | 13608 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 13609 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13610 | "$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] | 13611 | 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] | 13612 | 0 \ |
| 13613 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13614 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13615 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13616 | |
| 13617 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13618 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13619 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13620 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13621 | run_test "TLS 1.3: Check signature algorithm order, m->G" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13622 | "$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] | 13623 | -d 4 |
| 13624 | --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 | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13625 | "$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] | 13626 | 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] | 13627 | 0 \ |
| 13628 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13629 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13630 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13631 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13632 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13633 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13634 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13635 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13636 | run_test "TLS 1.3: Check signature algorithm order, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13637 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13638 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 13639 | 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] | 13640 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13641 | "$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] | 13642 | 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] | 13643 | 0 \ |
| 13644 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13645 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 13646 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13647 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 13648 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13649 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13650 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13651 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13652 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13653 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13654 | run_test "TLS 1.3: Check signature algorithm order, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13655 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13656 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 13657 | 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] | 13658 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13659 | "$O_NEXT_CLI_NO_CERT -msg -CAfile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 13660 | -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] | 13661 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 13662 | 0 \ |
| 13663 | -c "TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13664 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13665 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 13666 | |
| 13667 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13668 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13669 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13670 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13671 | run_test "TLS 1.3: Check signature algorithm order, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13672 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13673 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 13674 | 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] | 13675 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13676 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 13677 | --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] | 13678 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" \ |
| 13679 | 0 \ |
| 13680 | -c "Negotiated version: 3.4" \ |
| 13681 | -c "HTTP/1.0 200 [Oo][Kk]" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13682 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13683 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 13684 | |
| 13685 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13686 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13687 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13688 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13689 | 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] | 13690 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13691 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 13692 | 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] | 13693 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13694 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 13695 | --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] | 13696 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512" \ |
| 13697 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 13698 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13699 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13700 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13701 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13702 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13703 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13704 | 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] | 13705 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13706 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 13707 | 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] | 13708 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13709 | "$O_NEXT_CLI_NO_CERT -msg -CAfile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 13710 | -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] | 13711 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \ |
| 13712 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 13713 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13714 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13715 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13716 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13717 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13718 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13719 | 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] | 13720 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13721 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 13722 | 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] | 13723 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13724 | "$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] | 13725 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13726 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 13727 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13728 | |
| 13729 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13730 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13731 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13732 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13733 | run_test "TLS 1.3: Check server no suitable certificate, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13734 | "$P_SRV debug_level=4 |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13735 | 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] | 13736 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13737 | "$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] | 13738 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \ |
| 13739 | 1 \ |
| 13740 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 13741 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13742 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13743 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13744 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13745 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13746 | run_test "TLS 1.3: Check server no suitable certificate, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13747 | "$P_SRV debug_level=4 |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13748 | 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] | 13749 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13750 | "$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] | 13751 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \ |
| 13752 | 1 \ |
| 13753 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 13754 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13755 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13756 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13757 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13758 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13759 | run_test "TLS 1.3: Check server no suitable certificate, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13760 | "$P_SRV debug_level=4 |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13761 | 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] | 13762 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 13763 | "$P_CLI allow_sha1=0 debug_level=4 \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 13764 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13765 | 1 \ |
| 13766 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 13767 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13768 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13769 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13770 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13771 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13772 | run_test "TLS 1.3: Check client no signature algorithm, m->O" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13773 | "$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] | 13774 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 13775 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp521r1_sha512" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13776 | "$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] | 13777 | 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] | 13778 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13779 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13780 | |
| 13781 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13782 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13783 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13784 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13785 | run_test "TLS 1.3: Check client no signature algorithm, m->G" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13786 | "$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] | 13787 | -d 4 |
| 13788 | --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 | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13789 | "$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] | 13790 | 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] | 13791 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13792 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13793 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13794 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13795 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13796 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13797 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13798 | run_test "TLS 1.3: Check client no signature algorithm, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13799 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13800 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 13801 | 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] | 13802 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp521r1_sha512" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13803 | "$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] | 13804 | 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] | 13805 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13806 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13807 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13808 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13809 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13810 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13811 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13812 | run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->O" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13813 | "$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] | 13814 | -msg -tls1_2 |
| 13815 | -Verify 10 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13816 | "$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] | 13817 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 13818 | min_version=tls12 max_version=tls13 " \ |
| 13819 | 0 \ |
| 13820 | -c "Protocol is TLSv1.2" \ |
| 13821 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13822 | |
| 13823 | |
| 13824 | requires_gnutls_tls1_3 |
| 13825 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13826 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13827 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13828 | run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->G" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13829 | "$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] | 13830 | -d 4 |
| 13831 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13832 | "$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] | 13833 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 13834 | min_version=tls12 max_version=tls13 " \ |
| 13835 | 0 \ |
| 13836 | -c "Protocol is TLSv1.2" \ |
| 13837 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13838 | |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13839 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13840 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13841 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13842 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13843 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 13844 | requires_config_enabled PSA_WANT_DH_RFC7919_3072 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13845 | requires_gnutls_tls1_3 |
| 13846 | requires_gnutls_next_no_ticket |
| 13847 | requires_gnutls_next_disable_tls13_compat |
| 13848 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe3072,rsa_pss_rsae_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13849 | "$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" \ |
| 13850 | "$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] | 13851 | 0 \ |
| 13852 | -s "Protocol is TLSv1.3" \ |
| 13853 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 13854 | -s "received signature algorithm: 0x804" \ |
| 13855 | -s "got named group: ffdhe3072(0101)" \ |
| 13856 | -s "Certificate verification was skipped" \ |
| 13857 | -C "received HelloRetryRequest message" |
| 13858 | |
| 13859 | |
| 13860 | requires_gnutls_tls1_3 |
| 13861 | requires_gnutls_next_no_ticket |
| 13862 | requires_gnutls_next_disable_tls13_compat |
| 13863 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13864 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13865 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13866 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13867 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 13868 | requires_config_enabled PSA_WANT_DH_RFC7919_3072 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13869 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe3072,rsa_pss_rsae_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13870 | "$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" \ |
| 13871 | "$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] | 13872 | 0 \ |
| 13873 | -c "HTTP/1.0 200 OK" \ |
| 13874 | -c "Protocol is TLSv1.3" \ |
| 13875 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 13876 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 13877 | -c "NamedGroup: ffdhe3072 ( 101 )" \ |
| 13878 | -c "Verifying peer X.509 certificate... ok" \ |
| 13879 | -C "received HelloRetryRequest message" |
| 13880 | |
| 13881 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13882 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13883 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13884 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13885 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 13886 | requires_config_enabled PSA_WANT_DH_RFC7919_4096 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13887 | requires_gnutls_tls1_3 |
| 13888 | requires_gnutls_next_no_ticket |
| 13889 | requires_gnutls_next_disable_tls13_compat |
| 13890 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe4096,rsa_pss_rsae_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13891 | "$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" \ |
| 13892 | "$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] | 13893 | 0 \ |
| 13894 | -s "Protocol is TLSv1.3" \ |
| 13895 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 13896 | -s "received signature algorithm: 0x804" \ |
| 13897 | -s "got named group: ffdhe4096(0102)" \ |
| 13898 | -s "Certificate verification was skipped" \ |
| 13899 | -C "received HelloRetryRequest message" |
| 13900 | |
| 13901 | |
| 13902 | requires_gnutls_tls1_3 |
| 13903 | requires_gnutls_next_no_ticket |
| 13904 | requires_gnutls_next_disable_tls13_compat |
| 13905 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13906 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13907 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13908 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13909 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 13910 | requires_config_enabled PSA_WANT_DH_RFC7919_4096 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13911 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe4096,rsa_pss_rsae_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13912 | "$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" \ |
| 13913 | "$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] | 13914 | 0 \ |
| 13915 | -c "HTTP/1.0 200 OK" \ |
| 13916 | -c "Protocol is TLSv1.3" \ |
| 13917 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 13918 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 13919 | -c "NamedGroup: ffdhe4096 ( 102 )" \ |
| 13920 | -c "Verifying peer X.509 certificate... ok" \ |
| 13921 | -C "received HelloRetryRequest message" |
| 13922 | |
| 13923 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13924 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13925 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13926 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13927 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 13928 | requires_config_enabled PSA_WANT_DH_RFC7919_6144 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13929 | requires_gnutls_tls1_3 |
| 13930 | requires_gnutls_next_no_ticket |
| 13931 | requires_gnutls_next_disable_tls13_compat |
Gilles Peskine | 05030d4 | 2024-10-31 18:52:40 +0100 | [diff] [blame] | 13932 | # Tests using FFDH with a large prime take a long time to run with a memory |
| 13933 | # sanitizer. GnuTLS <=3.8.1 has a hard-coded timeout and gives up after |
| 13934 | # 30s (since 3.8.1, it can be configured with --timeout). We've observed |
| 13935 | # 8192-bit FFDH test cases failing intermittently on heavily loaded CI |
| 13936 | # executors (https://github.com/Mbed-TLS/mbedtls/issues/9742), |
| 13937 | # when using MSan. As a workaround, skip them. |
| 13938 | # Also skip 6144-bit FFDH to have a bit of safety margin. |
| 13939 | not_with_msan_or_valgrind |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13940 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe6144,rsa_pss_rsae_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13941 | "$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" \ |
| 13942 | "$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] | 13943 | 0 \ |
| 13944 | -s "Protocol is TLSv1.3" \ |
| 13945 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 13946 | -s "received signature algorithm: 0x804" \ |
| 13947 | -s "got named group: ffdhe6144(0103)" \ |
| 13948 | -s "Certificate verification was skipped" \ |
| 13949 | -C "received HelloRetryRequest message" |
| 13950 | |
| 13951 | requires_gnutls_tls1_3 |
| 13952 | requires_gnutls_next_no_ticket |
| 13953 | requires_gnutls_next_disable_tls13_compat |
| 13954 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13955 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13956 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13957 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13958 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 13959 | requires_config_enabled PSA_WANT_DH_RFC7919_6144 |
Gilles Peskine | 05030d4 | 2024-10-31 18:52:40 +0100 | [diff] [blame] | 13960 | not_with_msan_or_valgrind |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13961 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe6144,rsa_pss_rsae_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13962 | "$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" \ |
| 13963 | "$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] | 13964 | 0 \ |
| 13965 | -c "HTTP/1.0 200 OK" \ |
| 13966 | -c "Protocol is TLSv1.3" \ |
| 13967 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 13968 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 13969 | -c "NamedGroup: ffdhe6144 ( 103 )" \ |
| 13970 | -c "Verifying peer X.509 certificate... ok" \ |
| 13971 | -C "received HelloRetryRequest message" |
| 13972 | |
| 13973 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13974 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13975 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13976 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13977 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 13978 | requires_config_enabled PSA_WANT_DH_RFC7919_8192 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13979 | requires_gnutls_tls1_3 |
| 13980 | requires_gnutls_next_no_ticket |
| 13981 | requires_gnutls_next_disable_tls13_compat |
Gilles Peskine | 05030d4 | 2024-10-31 18:52:40 +0100 | [diff] [blame] | 13982 | not_with_msan_or_valgrind |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13983 | client_needs_more_time 4 |
| 13984 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe8192,rsa_pss_rsae_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13985 | "$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" \ |
| 13986 | "$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] | 13987 | 0 \ |
| 13988 | -s "Protocol is TLSv1.3" \ |
| 13989 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 13990 | -s "received signature algorithm: 0x804" \ |
| 13991 | -s "got named group: ffdhe8192(0104)" \ |
| 13992 | -s "Certificate verification was skipped" \ |
| 13993 | -C "received HelloRetryRequest message" |
| 13994 | |
| 13995 | requires_gnutls_tls1_3 |
| 13996 | requires_gnutls_next_no_ticket |
| 13997 | requires_gnutls_next_disable_tls13_compat |
| 13998 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13999 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14000 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14001 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14002 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14003 | requires_config_enabled PSA_WANT_DH_RFC7919_8192 |
Gilles Peskine | 05030d4 | 2024-10-31 18:52:40 +0100 | [diff] [blame] | 14004 | not_with_msan_or_valgrind |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14005 | client_needs_more_time 4 |
| 14006 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe8192,rsa_pss_rsae_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14007 | "$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" \ |
| 14008 | "$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] | 14009 | 0 \ |
| 14010 | -c "HTTP/1.0 200 OK" \ |
| 14011 | -c "Protocol is TLSv1.3" \ |
| 14012 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14013 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14014 | -c "NamedGroup: ffdhe8192 ( 104 )" \ |
| 14015 | -c "Verifying peer X.509 certificate... ok" \ |
| 14016 | -C "received HelloRetryRequest message" |
| 14017 | |
Ronald Cron | 8a74f07 | 2023-06-14 17:59:29 +0200 | [diff] [blame] | 14018 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 14019 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14020 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14021 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 14022 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14023 | run_test "TLS 1.3: no HRR in case of PSK key exchange mode" \ |
Gilles Peskine | f9f3d21 | 2024-05-13 21:06:26 +0200 | [diff] [blame] | 14024 | "$P_SRV nbio=2 psk=73776f726466697368 psk_identity=0a0b0c tls13_kex_modes=psk groups=none" \ |
| 14025 | "$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] | 14026 | 0 \ |
| 14027 | -C "received HelloRetryRequest message" \ |
| 14028 | -c "Selected key exchange mode: psk$" \ |
| 14029 | -c "HTTP/1.0 200 OK" |
| 14030 | |
Waleed Elmelegy | 0b190f1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14031 | # Legacy_compression_methods testing |
| 14032 | |
| 14033 | requires_gnutls |
Waleed Elmelegy | dc99c89 | 2024-07-15 17:25:04 +0000 | [diff] [blame] | 14034 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Waleed Elmelegy | 0b190f1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14035 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Waleed Elmelegy | dc99c89 | 2024-07-15 17:25:04 +0000 | [diff] [blame] | 14036 | run_test "TLS 1.2 ClientHello indicating support for deflate compression method" \ |
| 14037 | "$P_SRV debug_level=3" \ |
| 14038 | "$G_CLI --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+COMP-DEFLATE localhost" \ |
| 14039 | 0 \ |
| 14040 | -c "Handshake was completed" \ |
| 14041 | -s "dumping .client hello, compression. (2 bytes)" |
Waleed Elmelegy | 0b190f1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14042 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14043 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 14044 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14045 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 14046 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 14047 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 14048 | requires_max_content_len 16384 |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 14049 | run_tests_memory_after_handshake |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14050 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14051 | if [ "$LIST_TESTS" -eq 0 ]; then |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 14052 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14053 | # Final report |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 14054 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14055 | echo "------------------------------------------------------------------------" |
| 14056 | |
| 14057 | if [ $FAILS = 0 ]; then |
| 14058 | printf "PASSED" |
| 14059 | else |
| 14060 | printf "FAILED" |
| 14061 | fi |
| 14062 | PASSES=$(( $TESTS - $FAILS )) |
| 14063 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
| 14064 | |
Gilles Peskine | 39c5207 | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 14065 | if [ $((TESTS - SKIPS)) -lt $MIN_TESTS ]; then |
| 14066 | cat <<EOF |
| 14067 | Error: Expected to run at least $MIN_TESTS, but only ran $((TESTS - SKIPS)). |
| 14068 | Maybe a bad filter ('$FILTER') or a bad configuration? |
| 14069 | EOF |
| 14070 | if [ $FAILS -eq 0 ]; then |
| 14071 | FAILS=1 |
| 14072 | fi |
| 14073 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 14074 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 14075 | |
Tom Cosgrove | fc0e79e | 2023-01-13 12:13:41 +0000 | [diff] [blame] | 14076 | if [ $FAILS -gt 255 ]; then |
| 14077 | # Clamp at 255 as caller gets exit code & 0xFF |
| 14078 | # (so 256 would be 0, or success, etc) |
| 14079 | FAILS=255 |
| 14080 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 14081 | exit $FAILS |