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" |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 71 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 72 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 73 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 74 | |
Gilles Peskine | dd782f4 | 2024-04-29 17:46:24 +0200 | [diff] [blame] | 75 | # If $OPENSSL is at least 1.1.1, use it as OPENSSL_NEXT as well. |
| 76 | if [ -z "${OPENSSL_NEXT:-}" ]; then |
| 77 | case $($OPENSSL version) in |
| 78 | OpenSSL\ 1.1.[1-9]*) OPENSSL_NEXT=$OPENSSL;; |
| 79 | OpenSSL\ [3-9]*) OPENSSL_NEXT=$OPENSSL;; |
| 80 | esac |
| 81 | fi |
| 82 | |
| 83 | # If $GNUTLS_CLI is at least 3.7, use it as GNUTLS_NEXT_CLI as well. |
| 84 | if [ -z "${GNUTLS_NEXT_CLI:-}" ]; then |
| 85 | case $($GNUTLS_CLI --version) in |
| 86 | gnutls-cli\ 3.[1-9][0-9]*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 87 | gnutls-cli\ 3.[7-9].*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 88 | gnutls-cli\ [4-9]*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 89 | esac |
| 90 | fi |
| 91 | |
| 92 | # If $GNUTLS_SERV is at least 3.7, use it as GNUTLS_NEXT_SERV as well. |
| 93 | if [ -z "${GNUTLS_NEXT_SERV:-}" ]; then |
| 94 | case $($GNUTLS_SERV --version) in |
| 95 | gnutls-cli\ 3.[1-9][0-9]*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 96 | gnutls-cli\ 3.[7-9].*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 97 | gnutls-cli\ [4-9]*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 98 | esac |
| 99 | fi |
| 100 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 101 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 102 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" |
| 103 | O_NEXT_SRV_EARLY_DATA="$OPENSSL_NEXT s_server -early_data -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 104 | O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www " |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 105 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client -CAfile $DATA_FILES_PATH/test-ca_cat12.crt" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 106 | O_NEXT_CLI_NO_CERT="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 107 | else |
| 108 | O_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 109 | O_NEXT_SRV_NO_CERT=false |
Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 110 | O_NEXT_SRV_EARLY_DATA=false |
XiaokangQian | b1847a2 | 2022-06-08 07:49:31 +0000 | [diff] [blame] | 111 | O_NEXT_CLI_NO_CERT=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 112 | O_NEXT_CLI=false |
| 113 | fi |
| 114 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 115 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 116 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile $DATA_FILES_PATH/server5.crt --x509keyfile $DATA_FILES_PATH/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 117 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 118 | else |
| 119 | G_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 120 | G_NEXT_SRV_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 121 | fi |
| 122 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 123 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 124 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 125 | G_NEXT_CLI_NO_CERT="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 126 | else |
| 127 | G_NEXT_CLI=false |
XiaokangQian | fb1a3fe | 2022-06-09 06:37:33 +0000 | [diff] [blame] | 128 | G_NEXT_CLI_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 129 | fi |
| 130 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 131 | TESTS=0 |
| 132 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 133 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 134 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 135 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 136 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 137 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 138 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 139 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 140 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 141 | SHOW_TEST_NUMBER=0 |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 142 | LIST_TESTS=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 143 | RUN_TEST_NUMBER='' |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 144 | RUN_TEST_SUITE='' |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 145 | |
Gilles Peskine | 39c5207 | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 146 | MIN_TESTS=1 |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 147 | PRESERVE_LOGS=0 |
| 148 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 149 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 150 | # port which is this plus 10000. Each port number may be independently |
| 151 | # overridden by a command line option. |
| 152 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 153 | PXY_PORT=$((SRV_PORT + 10000)) |
| 154 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 155 | print_usage() { |
| 156 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 157 | printf " -h|--help\tPrint this help.\n" |
| 158 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 159 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 160 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 161 | printf " -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 162 | printf " -s|--show-numbers\tShow test numbers in front of test names\n" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 163 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Tomás González | 12787c9 | 2023-09-04 10:26:00 +0100 | [diff] [blame] | 164 | printf " --list-test-cases\tList all potential test cases (No Execution)\n" |
Gilles Peskine | 39c5207 | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 165 | printf " --min \tMinimum number of non-skipped tests (default 1)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 166 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 167 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 168 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 169 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 170 | printf " --seed \tInteger seed value to use for this test run\n" |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 171 | printf " --test-suite\tOnly matching test suites are executed\n" |
| 172 | printf " \t(comma-separated, e.g. 'ssl-opt,tls13-compat')\n\n" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 173 | } |
| 174 | |
| 175 | get_options() { |
| 176 | while [ $# -gt 0 ]; do |
| 177 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 178 | -f|--filter) |
| 179 | shift; FILTER=$1 |
| 180 | ;; |
| 181 | -e|--exclude) |
| 182 | shift; EXCLUDE=$1 |
| 183 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 184 | -m|--memcheck) |
| 185 | MEMCHECK=1 |
| 186 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 187 | -n|--number) |
| 188 | shift; RUN_TEST_NUMBER=$1 |
| 189 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 190 | -s|--show-numbers) |
| 191 | SHOW_TEST_NUMBER=1 |
| 192 | ;; |
Tomás González | 4a86da2 | 2023-09-01 17:41:16 +0100 | [diff] [blame] | 193 | -l|--list-test-cases) |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 194 | LIST_TESTS=1 |
| 195 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 196 | -p|--preserve-logs) |
| 197 | PRESERVE_LOGS=1 |
| 198 | ;; |
Gilles Peskine | 39c5207 | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 199 | --min) |
| 200 | shift; MIN_TESTS=$1 |
| 201 | ;; |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 202 | --outcome-file) |
| 203 | shift; MBEDTLS_TEST_OUTCOME_FILE=$1 |
| 204 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 205 | --port) |
| 206 | shift; SRV_PORT=$1 |
| 207 | ;; |
| 208 | --proxy-port) |
| 209 | shift; PXY_PORT=$1 |
| 210 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 211 | --seed) |
| 212 | shift; SEED="$1" |
| 213 | ;; |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 214 | --test-suite) |
| 215 | shift; RUN_TEST_SUITE="$1" |
| 216 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 217 | -h|--help) |
| 218 | print_usage |
| 219 | exit 0 |
| 220 | ;; |
| 221 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 222 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 223 | print_usage |
| 224 | exit 1 |
| 225 | ;; |
| 226 | esac |
| 227 | shift |
| 228 | done |
| 229 | } |
| 230 | |
Tomás González | 0e8a08a | 2023-08-23 15:29:57 +0100 | [diff] [blame] | 231 | get_options "$@" |
| 232 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 233 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 234 | # testing. Skip non-boolean options (with something other than spaces |
| 235 | # and a comment after "#define SYMBOL"). The variable contains a |
| 236 | # space-separated list of symbols. |
Tomás González | f162b4f | 2023-08-23 15:31:12 +0100 | [diff] [blame] | 237 | if [ "$LIST_TESTS" -eq 0 ];then |
| 238 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
| 239 | else |
Tomás González | be2c66e | 2023-09-01 10:34:49 +0100 | [diff] [blame] | 240 | P_QUERY=":" |
Tomás González | f162b4f | 2023-08-23 15:31:12 +0100 | [diff] [blame] | 241 | CONFIGS_ENABLED="" |
| 242 | fi |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 243 | # Skip next test; use this macro to skip tests which are legitimate |
| 244 | # in theory and expected to be re-introduced at some point, but |
| 245 | # aren't expected to succeed at the moment due to problems outside |
| 246 | # our control (such as bugs in other TLS implementations). |
| 247 | skip_next_test() { |
| 248 | SKIP_NEXT="YES" |
| 249 | } |
| 250 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 251 | # Check if the required configuration ($1) is enabled |
| 252 | is_config_enabled() |
| 253 | { |
| 254 | case $CONFIGS_ENABLED in |
| 255 | *" $1"[\ =]*) return 0;; |
| 256 | *) return 1;; |
| 257 | esac |
| 258 | } |
| 259 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 260 | # skip next test if the flag is not enabled in mbedtls_config.h |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 261 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 262 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 263 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 264 | *) SKIP_NEXT="YES";; |
| 265 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 266 | } |
| 267 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 268 | # skip next test if the flag is enabled in mbedtls_config.h |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 269 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 270 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 271 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 272 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 273 | } |
| 274 | |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 275 | requires_all_configs_enabled() { |
Jerry Yu | 9dd0cc0 | 2023-10-18 11:25:30 +0800 | [diff] [blame] | 276 | if ! $P_QUERY -all $* 2>&1 > /dev/null |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 277 | then |
| 278 | SKIP_NEXT="YES" |
| 279 | fi |
| 280 | } |
| 281 | |
| 282 | requires_all_configs_disabled() { |
Jerry Yu | 9dd0cc0 | 2023-10-18 11:25:30 +0800 | [diff] [blame] | 283 | if $P_QUERY -any $* 2>&1 > /dev/null |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 284 | then |
| 285 | SKIP_NEXT="YES" |
| 286 | fi |
| 287 | } |
| 288 | |
| 289 | requires_any_configs_enabled() { |
Jerry Yu | 9dd0cc0 | 2023-10-18 11:25:30 +0800 | [diff] [blame] | 290 | if ! $P_QUERY -any $* 2>&1 > /dev/null |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 291 | then |
| 292 | SKIP_NEXT="YES" |
| 293 | fi |
| 294 | } |
| 295 | |
| 296 | requires_any_configs_disabled() { |
Jerry Yu | 9dd0cc0 | 2023-10-18 11:25:30 +0800 | [diff] [blame] | 297 | if $P_QUERY -all $* 2>&1 > /dev/null |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 298 | then |
| 299 | SKIP_NEXT="YES" |
| 300 | fi |
| 301 | } |
| 302 | |
Ronald Cron | 454eb91 | 2022-10-21 08:56:04 +0200 | [diff] [blame] | 303 | TLS1_2_KEY_EXCHANGES_WITH_CERT="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 304 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 305 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 306 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 307 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED \ |
| 308 | MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED \ |
| 309 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 310 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 311 | TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT="MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 312 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 313 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 314 | TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
| 315 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 316 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 317 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 318 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED" |
| 319 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 320 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled() { |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 321 | if $P_QUERY -all MBEDTLS_SSL_PROTO_TLS1_2 |
| 322 | then |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 323 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 324 | elif ! $P_QUERY -all MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 325 | then |
| 326 | SKIP_NEXT="YES" |
| 327 | fi |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 328 | } |
| 329 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 330 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 331 | # This function uses the query_config command line option to query the |
| 332 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 333 | # program. The command will always return a success value if the |
| 334 | # configuration is defined and the value will be printed to stdout. |
| 335 | # |
| 336 | # Note that if the configuration is not defined or is defined to nothing, |
| 337 | # the output of this function will be an empty string. |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 338 | if [ "$LIST_TESTS" -eq 0 ];then |
| 339 | ${P_SRV} "query_config=${1}" |
| 340 | else |
| 341 | echo "1" |
| 342 | fi |
| 343 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 344 | } |
| 345 | |
| 346 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 347 | VAL="$( get_config_value_or_default "$1" )" |
| 348 | if [ -z "$VAL" ]; then |
| 349 | # Should never happen |
| 350 | echo "Mbed TLS configuration $1 is not defined" |
| 351 | exit 1 |
| 352 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 353 | SKIP_NEXT="YES" |
| 354 | fi |
| 355 | } |
| 356 | |
| 357 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 358 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 359 | if [ -z "$VAL" ]; then |
| 360 | # Should never happen |
| 361 | echo "Mbed TLS configuration $1 is not defined" |
| 362 | exit 1 |
| 363 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 364 | SKIP_NEXT="YES" |
| 365 | fi |
| 366 | } |
| 367 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 368 | requires_config_value_equals() { |
| 369 | VAL=$( get_config_value_or_default "$1" ) |
| 370 | if [ -z "$VAL" ]; then |
| 371 | # Should never happen |
| 372 | echo "Mbed TLS configuration $1 is not defined" |
| 373 | exit 1 |
| 374 | elif [ "$VAL" -ne "$2" ]; then |
| 375 | SKIP_NEXT="YES" |
| 376 | fi |
| 377 | } |
| 378 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 379 | # Require Mbed TLS to support the given protocol version. |
| 380 | # |
| 381 | # Inputs: |
| 382 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 383 | requires_protocol_version() { |
| 384 | # Support for DTLS is detected separately in detect_dtls(). |
| 385 | case "$1" in |
| 386 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 387 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; |
| 388 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 389 | esac |
| 390 | } |
| 391 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 392 | # Space-separated list of ciphersuites supported by this build of |
| 393 | # Mbed TLS. |
Ronald Cron | 5b73de8 | 2023-11-28 15:49:25 +0100 | [diff] [blame] | 394 | P_CIPHERSUITES="" |
| 395 | if [ "$LIST_TESTS" -eq 0 ]; then |
| 396 | P_CIPHERSUITES=" $($P_CLI help_ciphersuites 2>/dev/null | |
| 397 | grep 'TLS-\|TLS1-3' | |
| 398 | tr -s ' \n' ' ')" |
| 399 | |
| 400 | if [ -z "${P_CIPHERSUITES# }" ]; then |
| 401 | echo >&2 "$0: fatal error: no cipher suites found!" |
| 402 | exit 125 |
| 403 | fi |
| 404 | fi |
| 405 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 406 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 407 | case $P_CIPHERSUITES in |
| 408 | *" $1 "*) :;; |
| 409 | *) SKIP_NEXT="YES";; |
| 410 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 411 | } |
| 412 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 413 | requires_cipher_enabled() { |
| 414 | KEY_TYPE=$1 |
| 415 | MODE=${2:-} |
| 416 | if is_config_enabled MBEDTLS_USE_PSA_CRYPTO; then |
| 417 | case "$KEY_TYPE" in |
| 418 | CHACHA20) |
| 419 | requires_config_enabled PSA_WANT_ALG_CHACHA20_POLY1305 |
| 420 | requires_config_enabled PSA_WANT_KEY_TYPE_CHACHA20 |
| 421 | ;; |
| 422 | *) |
| 423 | requires_config_enabled PSA_WANT_ALG_${MODE} |
| 424 | requires_config_enabled PSA_WANT_KEY_TYPE_${KEY_TYPE} |
| 425 | ;; |
| 426 | esac |
| 427 | else |
| 428 | case "$KEY_TYPE" in |
| 429 | CHACHA20) |
| 430 | requires_config_enabled MBEDTLS_CHACHA20_C |
| 431 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 432 | ;; |
| 433 | *) |
| 434 | requires_config_enabled MBEDTLS_${MODE}_C |
| 435 | requires_config_enabled MBEDTLS_${KEY_TYPE}_C |
| 436 | ;; |
| 437 | esac |
| 438 | fi |
| 439 | } |
| 440 | |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 441 | # Automatically detect required features based on command line parameters. |
| 442 | # Parameters are: |
| 443 | # - $1 = command line (call to a TLS client or server program) |
| 444 | # - $2 = client/server |
| 445 | # - $3 = TLS version (TLS12 or TLS13) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 446 | # - $4 = Use an external tool without ECDH support |
| 447 | # - $5 = run test options |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 448 | detect_required_features() { |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 449 | CMD_LINE=$1 |
| 450 | ROLE=$2 |
| 451 | TLS_VERSION=$3 |
| 452 | EXT_WO_ECDH=$4 |
| 453 | TEST_OPTIONS=${5:-} |
| 454 | |
| 455 | case "$CMD_LINE" in |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 456 | *\ force_version=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 457 | tmp="${CMD_LINE##*\ force_version=}" |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 458 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 459 | requires_protocol_version "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 460 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 461 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 462 | case "$CMD_LINE" in |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 463 | *\ force_ciphersuite=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 464 | tmp="${CMD_LINE##*\ force_ciphersuite=}" |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 465 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 466 | requires_ciphersuite_enabled "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 467 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 468 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 469 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 470 | *[-_\ =]tickets=[^0]*) |
| 471 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 472 | esac |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 473 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 474 | *[-_\ =]alpn=*) |
| 475 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 476 | esac |
| 477 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 478 | case "$CMD_LINE" in |
Gilles Peskine | e855317 | 2024-04-26 21:28:49 +0200 | [diff] [blame] | 479 | */server5*|\ |
| 480 | */server7*|\ |
| 481 | */dir-maxpath*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 482 | if [ "$TLS_VERSION" = "TLS13" ]; then |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 483 | # In case of TLS13 the support for ECDSA is enough |
| 484 | requires_pk_alg "ECDSA" |
| 485 | else |
| 486 | # For TLS12 requirements are different between server and client |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 487 | if [ "$ROLE" = "server" ]; then |
Valerio Setti | 194e2bd | 2023-03-02 17:18:10 +0100 | [diff] [blame] | 488 | # If the server uses "server5*" certificates, then an ECDSA based |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 489 | # key exchange is required. However gnutls also does not |
| 490 | # support ECDH, so this limit the choice to ECDHE-ECDSA |
| 491 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 492 | requires_any_configs_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
| 493 | else |
| 494 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT |
| 495 | fi |
| 496 | elif [ "$ROLE" = "client" ]; then |
| 497 | # On the client side it is enough to have any certificate |
| 498 | # based authentication together with support for ECDSA. |
| 499 | # Of course the GnuTLS limitation mentioned above applies |
| 500 | # also here. |
| 501 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 502 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH |
| 503 | else |
| 504 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 505 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 506 | requires_pk_alg "ECDSA" |
| 507 | fi |
| 508 | fi |
| 509 | ;; |
| 510 | esac |
| 511 | |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 512 | case "$CMD_LINE" in |
Gilles Peskine | d00b93b | 2024-04-29 16:03:02 +0200 | [diff] [blame] | 513 | */server1*|\ |
Gilles Peskine | e855317 | 2024-04-26 21:28:49 +0200 | [diff] [blame] | 514 | */server2*|\ |
| 515 | */server7*) |
Gilles Peskine | d00b93b | 2024-04-29 16:03:02 +0200 | [diff] [blame] | 516 | # Certificates with an RSA key. The algorithm requirement is |
| 517 | # some subset of {PKCS#1v1.5 encryption, PKCS#1v1.5 signature, |
| 518 | # PSS signature}. We can't easily tell which subset works, and |
| 519 | # we aren't currently running ssl-opt.sh in configurations |
| 520 | # where partial RSA support is a problem, so generically, we |
| 521 | # just require RSA and it works out for our tests so far. |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 522 | requires_config_enabled "MBEDTLS_RSA_C" |
| 523 | esac |
| 524 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 525 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 526 | } |
| 527 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 528 | requires_certificate_authentication () { |
| 529 | if [ "$PSK_ONLY" = "YES" ]; then |
| 530 | SKIP_NEXT="YES" |
| 531 | fi |
| 532 | } |
| 533 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 534 | adapt_cmd_for_psk () { |
| 535 | case "$2" in |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 536 | *openssl*s_server*) s='-psk 73776f726466697368 -nocert';; |
| 537 | *openssl*) s='-psk 73776f726466697368';; |
| 538 | *gnutls-*) s='--pskusername=Client_identity --pskkey=73776f726466697368';; |
| 539 | *) s='psk=73776f726466697368';; |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 540 | esac |
| 541 | eval $1='"$2 $s"' |
| 542 | unset s |
| 543 | } |
| 544 | |
| 545 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 546 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 547 | # |
| 548 | # If not running in a PSK-only build, do nothing. |
| 549 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 550 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 551 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 552 | # a pre-shared key, do nothing. |
| 553 | # |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 554 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 555 | # |
| 556 | # Inputs: |
| 557 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 558 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 559 | # * "$@": options passed to run_test. |
| 560 | # |
| 561 | # Outputs: |
| 562 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 563 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 564 | maybe_adapt_for_psk() { |
| 565 | if [ "$PSK_ONLY" != "YES" ]; then |
| 566 | return |
| 567 | fi |
| 568 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 569 | return |
| 570 | fi |
| 571 | case "$CLI_CMD $SRV_CMD" in |
| 572 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 573 | return;; |
| 574 | *force_ciphersuite*) |
| 575 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 576 | # PSK cipher suite could be substituted, but we're not ready for |
| 577 | # that yet. |
| 578 | SKIP_NEXT="YES" |
| 579 | return;; |
| 580 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 581 | # The test case involves certificates. PSK won't do. |
| 582 | SKIP_NEXT="YES" |
| 583 | return;; |
| 584 | esac |
| 585 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 586 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 587 | } |
| 588 | |
| 589 | case " $CONFIGS_ENABLED " in |
| 590 | *\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";; |
| 591 | *\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";; |
| 592 | *\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";; |
| 593 | *\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";; |
| 594 | *\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";; |
| 595 | *) PSK_ONLY="NO";; |
| 596 | esac |
| 597 | |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 598 | HAS_ALG_MD5="NO" |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 599 | HAS_ALG_SHA_1="NO" |
| 600 | HAS_ALG_SHA_224="NO" |
| 601 | HAS_ALG_SHA_256="NO" |
| 602 | HAS_ALG_SHA_384="NO" |
| 603 | HAS_ALG_SHA_512="NO" |
| 604 | |
| 605 | check_for_hash_alg() |
| 606 | { |
| 607 | CURR_ALG="INVALID"; |
| 608 | USE_PSA="NO" |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 609 | if is_config_enabled "MBEDTLS_USE_PSA_CRYPTO"; then |
| 610 | USE_PSA="YES"; |
| 611 | fi |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 612 | if [ $USE_PSA = "YES" ]; then |
| 613 | CURR_ALG=PSA_WANT_ALG_${1} |
| 614 | else |
| 615 | CURR_ALG=MBEDTLS_${1}_C |
| 616 | # Remove the second underscore to match MBEDTLS_* naming convention |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 617 | # MD5 is an exception to this convention |
| 618 | if [ "${1}" != "MD5" ]; then |
| 619 | CURR_ALG=$(echo "$CURR_ALG" | sed 's/_//2') |
| 620 | fi |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 621 | fi |
| 622 | |
| 623 | case $CONFIGS_ENABLED in |
| 624 | *" $CURR_ALG"[\ =]*) |
| 625 | return 0 |
| 626 | ;; |
| 627 | *) :;; |
| 628 | esac |
| 629 | return 1 |
| 630 | } |
| 631 | |
| 632 | populate_enabled_hash_algs() |
| 633 | { |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 634 | for hash_alg in SHA_1 SHA_224 SHA_256 SHA_384 SHA_512 MD5; do |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 635 | if check_for_hash_alg "$hash_alg"; then |
| 636 | hash_alg_variable=HAS_ALG_${hash_alg} |
| 637 | eval ${hash_alg_variable}=YES |
| 638 | fi |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 639 | done |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 640 | } |
| 641 | |
| 642 | # skip next test if the given hash alg is not supported |
| 643 | requires_hash_alg() { |
| 644 | HASH_DEFINE="Invalid" |
| 645 | HAS_HASH_ALG="NO" |
| 646 | case $1 in |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 647 | MD5):;; |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 648 | SHA_1):;; |
| 649 | SHA_224):;; |
| 650 | SHA_256):;; |
| 651 | SHA_384):;; |
| 652 | SHA_512):;; |
| 653 | *) |
| 654 | echo "Unsupported hash alg - $1" |
| 655 | exit 1 |
| 656 | ;; |
| 657 | esac |
| 658 | |
| 659 | HASH_DEFINE=HAS_ALG_${1} |
| 660 | eval "HAS_HASH_ALG=\${${HASH_DEFINE}}" |
| 661 | if [ "$HAS_HASH_ALG" = "NO" ] |
| 662 | then |
| 663 | SKIP_NEXT="YES" |
| 664 | fi |
| 665 | } |
| 666 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 667 | # Skip next test if the given pk alg is not enabled |
| 668 | requires_pk_alg() { |
| 669 | case $1 in |
| 670 | ECDSA) |
| 671 | if is_config_enabled MBEDTLS_USE_PSA_CRYPTO; then |
| 672 | requires_config_enabled PSA_WANT_ALG_ECDSA |
| 673 | else |
| 674 | requires_config_enabled MBEDTLS_ECDSA_C |
| 675 | fi |
| 676 | ;; |
| 677 | *) |
| 678 | echo "Unknown/unimplemented case $1 in requires_pk_alg" |
| 679 | exit 1 |
| 680 | ;; |
| 681 | esac |
| 682 | } |
| 683 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 684 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 685 | requires_openssl_with_fallback_scsv() { |
| 686 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 687 | if $OPENSSL s_client -help 2>&1 | grep fallback_scsv >/dev/null |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 688 | then |
| 689 | OPENSSL_HAS_FBSCSV="YES" |
| 690 | else |
| 691 | OPENSSL_HAS_FBSCSV="NO" |
| 692 | fi |
| 693 | fi |
| 694 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 695 | SKIP_NEXT="YES" |
| 696 | fi |
| 697 | } |
| 698 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 699 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 700 | requires_max_content_len() { |
| 701 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 702 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 703 | } |
| 704 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 705 | # skip next test if GnuTLS isn't available |
| 706 | requires_gnutls() { |
| 707 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 708 | if ( which "$GNUTLS_CLI" && which "$GNUTLS_SERV" ) >/dev/null 2>&1; then |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 709 | GNUTLS_AVAILABLE="YES" |
| 710 | else |
| 711 | GNUTLS_AVAILABLE="NO" |
| 712 | fi |
| 713 | fi |
| 714 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 715 | SKIP_NEXT="YES" |
| 716 | fi |
| 717 | } |
| 718 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 719 | # skip next test if GnuTLS-next isn't available |
| 720 | requires_gnutls_next() { |
| 721 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 722 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 723 | GNUTLS_NEXT_AVAILABLE="YES" |
| 724 | else |
| 725 | GNUTLS_NEXT_AVAILABLE="NO" |
| 726 | fi |
| 727 | fi |
| 728 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 729 | SKIP_NEXT="YES" |
| 730 | fi |
| 731 | } |
| 732 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 733 | requires_openssl_next() { |
| 734 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 735 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 736 | OPENSSL_NEXT_AVAILABLE="YES" |
| 737 | else |
| 738 | OPENSSL_NEXT_AVAILABLE="NO" |
| 739 | fi |
| 740 | fi |
| 741 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 742 | SKIP_NEXT="YES" |
| 743 | fi |
| 744 | } |
| 745 | |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 746 | # skip next test if openssl version is lower than 3.0 |
| 747 | requires_openssl_3_x() { |
| 748 | requires_openssl_next |
| 749 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 750 | OPENSSL_3_X_AVAILABLE="NO" |
| 751 | fi |
| 752 | if [ -z "${OPENSSL_3_X_AVAILABLE:-}" ]; then |
Przemek Stekiel | a53dca1 | 2023-06-14 20:53:09 +0200 | [diff] [blame] | 753 | if $OPENSSL_NEXT version 2>&1 | grep "OpenSSL 3." >/dev/null |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 754 | then |
| 755 | OPENSSL_3_X_AVAILABLE="YES" |
| 756 | else |
| 757 | OPENSSL_3_X_AVAILABLE="NO" |
| 758 | fi |
| 759 | fi |
| 760 | if [ "$OPENSSL_3_X_AVAILABLE" = "NO" ]; then |
| 761 | SKIP_NEXT="YES" |
| 762 | fi |
| 763 | } |
| 764 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 765 | # skip next test if openssl does not support ffdh keys |
| 766 | requires_openssl_tls1_3_with_ffdh() { |
| 767 | requires_openssl_3_x |
| 768 | } |
| 769 | |
Przemek Stekiel | 7dda271 | 2023-06-27 14:43:33 +0200 | [diff] [blame] | 770 | # skip next test if openssl cannot handle ephemeral key exchange |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 771 | requires_openssl_tls1_3_with_compatible_ephemeral() { |
| 772 | requires_openssl_next |
| 773 | |
| 774 | if !(is_config_enabled "PSA_WANT_ALG_ECDH"); then |
| 775 | requires_openssl_tls1_3_with_ffdh |
| 776 | fi |
| 777 | } |
| 778 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 779 | # skip next test if tls1_3 is not available |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 780 | requires_openssl_tls1_3() { |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 781 | requires_openssl_next |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 782 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 783 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 784 | fi |
| 785 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 786 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 787 | then |
| 788 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 789 | else |
| 790 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 791 | fi |
| 792 | fi |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 793 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 794 | SKIP_NEXT="YES" |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 795 | fi |
| 796 | } |
| 797 | |
| 798 | # skip next test if tls1_3 is not available |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 799 | requires_gnutls_tls1_3() { |
| 800 | requires_gnutls_next |
| 801 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 802 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 803 | fi |
| 804 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 805 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 806 | then |
| 807 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 808 | else |
| 809 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 810 | fi |
| 811 | fi |
| 812 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 813 | SKIP_NEXT="YES" |
| 814 | fi |
| 815 | } |
| 816 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 817 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 818 | requires_gnutls_next_no_ticket() { |
| 819 | requires_gnutls_next |
| 820 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 821 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 822 | fi |
| 823 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 824 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 825 | then |
| 826 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 827 | else |
| 828 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 829 | fi |
| 830 | fi |
| 831 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 832 | SKIP_NEXT="YES" |
| 833 | fi |
| 834 | } |
| 835 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 836 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 837 | requires_gnutls_next_disable_tls13_compat() { |
| 838 | requires_gnutls_next |
| 839 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 840 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 841 | fi |
| 842 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 843 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 844 | then |
| 845 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 846 | else |
| 847 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 848 | fi |
| 849 | fi |
| 850 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 851 | SKIP_NEXT="YES" |
| 852 | fi |
| 853 | } |
| 854 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 855 | # skip next test if GnuTLS does not support the record size limit extension |
| 856 | requires_gnutls_record_size_limit() { |
| 857 | requires_gnutls_next |
| 858 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 859 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="NO" |
| 860 | else |
| 861 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="YES" |
| 862 | fi |
| 863 | if [ "$GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE" = "NO" ]; then |
| 864 | SKIP_NEXT="YES" |
| 865 | fi |
| 866 | } |
| 867 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 868 | # skip next test if IPv6 isn't available on this host |
| 869 | requires_ipv6() { |
| 870 | if [ -z "${HAS_IPV6:-}" ]; then |
| 871 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 872 | SRV_PID=$! |
| 873 | sleep 1 |
| 874 | kill $SRV_PID >/dev/null 2>&1 |
| 875 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 876 | HAS_IPV6="NO" |
| 877 | else |
| 878 | HAS_IPV6="YES" |
| 879 | fi |
| 880 | rm -r $SRV_OUT |
| 881 | fi |
| 882 | |
| 883 | if [ "$HAS_IPV6" = "NO" ]; then |
| 884 | SKIP_NEXT="YES" |
| 885 | fi |
| 886 | } |
| 887 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 888 | # skip next test if it's i686 or uname is not available |
| 889 | requires_not_i686() { |
| 890 | if [ -z "${IS_I686:-}" ]; then |
| 891 | IS_I686="YES" |
| 892 | if which "uname" >/dev/null 2>&1; then |
| 893 | if [ -z "$(uname -a | grep i686)" ]; then |
| 894 | IS_I686="NO" |
| 895 | fi |
| 896 | fi |
| 897 | fi |
| 898 | if [ "$IS_I686" = "YES" ]; then |
| 899 | SKIP_NEXT="YES" |
| 900 | fi |
| 901 | } |
| 902 | |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 903 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 904 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 905 | MAX_OUT_LEN=$( get_config_value_or_default "MBEDTLS_SSL_OUT_CONTENT_LEN" ) |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 906 | if [ "$LIST_TESTS" -eq 0 ];then |
| 907 | # Calculate the input & output maximum content lengths set in the config |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 908 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 909 | # Calculate the maximum content length that fits both |
| 910 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 911 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 912 | fi |
| 913 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 914 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 915 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 916 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 917 | # skip the next test if the SSL output buffer is less than 16KB |
| 918 | requires_full_size_output_buffer() { |
| 919 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 920 | SKIP_NEXT="YES" |
| 921 | fi |
| 922 | } |
| 923 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 924 | # skip the next test if valgrind is in use |
| 925 | not_with_valgrind() { |
| 926 | if [ "$MEMCHECK" -gt 0 ]; then |
| 927 | SKIP_NEXT="YES" |
| 928 | fi |
| 929 | } |
| 930 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 931 | # skip the next test if valgrind is NOT in use |
| 932 | only_with_valgrind() { |
| 933 | if [ "$MEMCHECK" -eq 0 ]; then |
| 934 | SKIP_NEXT="YES" |
| 935 | fi |
| 936 | } |
| 937 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 938 | # multiply the client timeout delay by the given factor for the next test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 939 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 940 | CLI_DELAY_FACTOR=$1 |
| 941 | } |
| 942 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 943 | # wait for the given seconds after the client finished in the next test |
| 944 | server_needs_more_time() { |
| 945 | SRV_DELAY_SECONDS=$1 |
| 946 | } |
| 947 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 948 | # print_name <name> |
| 949 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 950 | TESTS=$(( $TESTS + 1 )) |
| 951 | LINE="" |
| 952 | |
| 953 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 954 | LINE="$TESTS " |
| 955 | fi |
| 956 | |
| 957 | LINE="$LINE$1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 958 | |
Tomás González | 378e364 | 2023-09-04 10:41:37 +0100 | [diff] [blame] | 959 | printf "%s " "$LINE" |
| 960 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
| 961 | for i in `seq 1 $LEN`; do printf '.'; done |
| 962 | printf ' ' |
| 963 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 964 | } |
| 965 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 966 | # record_outcome <outcome> [<failure-reason>] |
| 967 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 968 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 969 | record_outcome() { |
| 970 | echo "$1" |
| 971 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 972 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 973 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Jerry Yu | 9e47b26 | 2023-11-06 10:52:01 +0800 | [diff] [blame] | 974 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 975 | "$1" "${2-}" \ |
| 976 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 977 | fi |
| 978 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 979 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 980 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 981 | # True if the presence of the given pattern in a log definitely indicates |
| 982 | # that the test has failed. False if the presence is inconclusive. |
| 983 | # |
| 984 | # Inputs: |
| 985 | # * $1: pattern found in the logs |
| 986 | # * $TIMES_LEFT: >0 if retrying is an option |
| 987 | # |
| 988 | # Outputs: |
| 989 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 990 | # unchanged otherwise. |
| 991 | # * Return value: 1 if the pattern is inconclusive, |
| 992 | # 0 if the failure is definitive. |
| 993 | log_pattern_presence_is_conclusive() { |
| 994 | # If we've run out of attempts, then don't retry no matter what. |
| 995 | if [ $TIMES_LEFT -eq 0 ]; then |
| 996 | return 0 |
| 997 | fi |
| 998 | case $1 in |
| 999 | "resend") |
| 1000 | # An undesired resend may have been caused by the OS dropping or |
| 1001 | # delaying a packet at an inopportune time. |
| 1002 | outcome="RETRY(resend)" |
| 1003 | return 1;; |
| 1004 | esac |
| 1005 | } |
| 1006 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1007 | # fail <message> |
| 1008 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1009 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 1010 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1011 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 1012 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1013 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1014 | if [ -n "$PXY_CMD" ]; then |
| 1015 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1016 | fi |
| 1017 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1018 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 1019 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1020 | echo " ! server output:" |
| 1021 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1022 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1023 | echo " ! client output:" |
| 1024 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1025 | if [ -n "$PXY_CMD" ]; then |
| 1026 | echo " ! ========================================================" |
| 1027 | echo " ! proxy output:" |
| 1028 | cat o-pxy-${TESTS}.log |
| 1029 | fi |
| 1030 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1031 | fi |
| 1032 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 1033 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1034 | } |
| 1035 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1036 | # is_polar <cmd_line> |
| 1037 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1038 | case "$1" in |
| 1039 | *ssl_client2*) true;; |
| 1040 | *ssl_server2*) true;; |
| 1041 | *) false;; |
| 1042 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1043 | } |
| 1044 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 1045 | # openssl s_server doesn't have -www with DTLS |
| 1046 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1047 | case "$SRV_CMD" in |
| 1048 | *s_server*-dtls*) |
| 1049 | NEEDS_INPUT=1 |
| 1050 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 1051 | *) NEEDS_INPUT=0;; |
| 1052 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 1053 | } |
| 1054 | |
| 1055 | # provide input to commands that need it |
| 1056 | provide_input() { |
| 1057 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 1058 | return |
| 1059 | fi |
| 1060 | |
| 1061 | while true; do |
| 1062 | echo "HTTP/1.0 200 OK" |
| 1063 | sleep 1 |
| 1064 | done |
| 1065 | } |
| 1066 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1067 | # has_mem_err <log_file_name> |
| 1068 | has_mem_err() { |
| 1069 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 1070 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 1071 | then |
| 1072 | return 1 # false: does not have errors |
| 1073 | else |
| 1074 | return 0 # true: has errors |
| 1075 | fi |
| 1076 | } |
| 1077 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1078 | # Wait for process $2 named $3 to be listening on port $1. Print error to $4. |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1079 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1080 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1081 | newline=' |
| 1082 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1083 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1084 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1085 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1086 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1087 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1088 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1089 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 1090 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1091 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1092 | # When we use a proxy, it will be listening on the same port we |
| 1093 | # are checking for as well as the server and lsof will list both. |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1094 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1095 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1096 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1097 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1098 | echo "$3 START TIMEOUT" |
| 1099 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1100 | break |
| 1101 | fi |
| 1102 | # Linux and *BSD support decimal arguments to sleep. On other |
| 1103 | # OSes this may be a tight loop. |
| 1104 | sleep 0.1 2>/dev/null || true |
| 1105 | done |
| 1106 | } |
| 1107 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1108 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 1109 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1110 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1111 | } |
| 1112 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1113 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1114 | # Wait for server process $2 to be listening on port $1. |
| 1115 | wait_server_start() { |
| 1116 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 1117 | } |
| 1118 | |
| 1119 | # Wait for proxy process $2 to be listening on port $1. |
| 1120 | wait_proxy_start() { |
| 1121 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 1122 | } |
| 1123 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1124 | # Given the client or server debug output, parse the unix timestamp that is |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 1125 | # included in the first 4 bytes of the random bytes and check that it's within |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1126 | # acceptable bounds |
| 1127 | check_server_hello_time() { |
| 1128 | # Extract the time from the debug (lvl 3) output of the client |
Andres Amaya Garcia | 67d8da5 | 2017-09-15 15:49:24 +0100 | [diff] [blame] | 1129 | SERVER_HELLO_TIME="$(sed -n 's/.*server hello, current time: //p' < "$1")" |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1130 | # Get the Unix timestamp for now |
| 1131 | CUR_TIME=$(date +'%s') |
| 1132 | THRESHOLD_IN_SECS=300 |
| 1133 | |
| 1134 | # Check if the ServerHello time was printed |
| 1135 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 1136 | return 1 |
| 1137 | fi |
| 1138 | |
| 1139 | # Check the time in ServerHello is within acceptable bounds |
| 1140 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 1141 | # The time in ServerHello is at least 5 minutes before now |
| 1142 | return 1 |
| 1143 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 1144 | # The time in ServerHello is at least 5 minutes later than now |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1145 | return 1 |
| 1146 | else |
| 1147 | return 0 |
| 1148 | fi |
| 1149 | } |
| 1150 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1151 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 1152 | handshake_memory_get() { |
| 1153 | OUTPUT_VARIABLE="$1" |
| 1154 | OUTPUT_FILE="$2" |
| 1155 | |
| 1156 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 1157 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 1158 | |
| 1159 | # Check if memory usage was read |
| 1160 | if [ -z "$MEM_USAGE" ]; then |
| 1161 | echo "Error: Can not read the value of handshake memory usage" |
| 1162 | return 1 |
| 1163 | else |
| 1164 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 1165 | return 0 |
| 1166 | fi |
| 1167 | } |
| 1168 | |
| 1169 | # Get handshake memory usage from server or client output and check if this value |
| 1170 | # is not higher than the maximum given by the first argument |
| 1171 | handshake_memory_check() { |
| 1172 | MAX_MEMORY="$1" |
| 1173 | OUTPUT_FILE="$2" |
| 1174 | |
| 1175 | # Get memory usage |
| 1176 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 1177 | return 1 |
| 1178 | fi |
| 1179 | |
| 1180 | # Check if memory usage is below max value |
| 1181 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 1182 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 1183 | "but should be below $MAX_MEMORY bytes" |
| 1184 | return 1 |
| 1185 | else |
| 1186 | return 0 |
| 1187 | fi |
| 1188 | } |
| 1189 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1190 | # wait for client to terminate and set CLI_EXIT |
| 1191 | # must be called right after starting the client |
| 1192 | wait_client_done() { |
| 1193 | CLI_PID=$! |
| 1194 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1195 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 1196 | CLI_DELAY_FACTOR=1 |
| 1197 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1198 | ( sleep $CLI_DELAY; echo "===CLIENT_TIMEOUT===" >> $CLI_OUT; kill $CLI_PID ) & |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1199 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1200 | |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1201 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
| 1202 | # To remove it from stdout, redirect stdout/stderr to CLI_OUT |
| 1203 | wait $CLI_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1204 | CLI_EXIT=$? |
| 1205 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1206 | kill $DOG_PID >/dev/null 2>&1 |
Jerry Yu | fe52e55 | 2022-07-09 04:23:43 +0000 | [diff] [blame] | 1207 | wait $DOG_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1208 | |
| 1209 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1210 | |
| 1211 | sleep $SRV_DELAY_SECONDS |
| 1212 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1213 | } |
| 1214 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1215 | # check if the given command uses dtls and sets global variable DTLS |
| 1216 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1217 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 1218 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1219 | *) DTLS=0;; |
| 1220 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1221 | } |
| 1222 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1223 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 1224 | is_gnutls() { |
| 1225 | case "$1" in |
| 1226 | *gnutls-cli*) |
| 1227 | CMD_IS_GNUTLS=1 |
| 1228 | ;; |
| 1229 | *gnutls-serv*) |
| 1230 | CMD_IS_GNUTLS=1 |
| 1231 | ;; |
| 1232 | *) |
| 1233 | CMD_IS_GNUTLS=0 |
| 1234 | ;; |
| 1235 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1236 | } |
| 1237 | |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 1238 | # Some external tools (gnutls or openssl) might not have support for static ECDH |
| 1239 | # and this limit the tests that can be run with them. This function checks server |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1240 | # and client command lines, given as input, to verify if the current test |
| 1241 | # is using one of these tools. |
| 1242 | use_ext_tool_without_ecdh_support() { |
| 1243 | case "$1" in |
| 1244 | *$GNUTLS_SERV*|\ |
| 1245 | *${GNUTLS_NEXT_SERV:-"gnutls-serv-dummy"}*|\ |
| 1246 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1247 | echo "yes" |
| 1248 | return;; |
| 1249 | esac |
| 1250 | case "$2" in |
| 1251 | *$GNUTLS_CLI*|\ |
| 1252 | *${GNUTLS_NEXT_CLI:-"gnutls-cli-dummy"}*|\ |
| 1253 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1254 | echo "yes" |
| 1255 | return;; |
| 1256 | esac |
| 1257 | echo "no" |
| 1258 | } |
| 1259 | |
Jerry Yu | f467d46 | 2022-11-07 13:12:44 +0800 | [diff] [blame] | 1260 | # Generate random psk_list argument for ssl_server2 |
| 1261 | get_srv_psk_list () |
| 1262 | { |
| 1263 | case $(( TESTS % 3 )) in |
| 1264 | 0) echo "psk_list=abc,dead,def,beef,Client_identity,6162636465666768696a6b6c6d6e6f70";; |
| 1265 | 1) echo "psk_list=abc,dead,Client_identity,6162636465666768696a6b6c6d6e6f70,def,beef";; |
| 1266 | 2) echo "psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70,abc,dead,def,beef";; |
| 1267 | esac |
| 1268 | } |
| 1269 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1270 | # Determine what calc_verify trace is to be expected, if any. |
| 1271 | # |
| 1272 | # calc_verify is only called for two things: to calculate the |
| 1273 | # extended master secret, and to process client authentication. |
| 1274 | # |
| 1275 | # Warning: the current implementation assumes that extended_ms is not |
| 1276 | # disabled on the client or on the server. |
| 1277 | # |
| 1278 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1279 | # * $1: the value of the server auth_mode parameter. |
| 1280 | # 'required' if client authentication is expected, |
| 1281 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1282 | # * $CONFIGS_ENABLED |
| 1283 | # |
| 1284 | # Outputs: |
| 1285 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 1286 | set_maybe_calc_verify() { |
| 1287 | maybe_calc_verify= |
| 1288 | case $CONFIGS_ENABLED in |
| 1289 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 1290 | *) |
| 1291 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1292 | ''|none) return;; |
| 1293 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1294 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 1295 | esac |
| 1296 | esac |
| 1297 | case $CONFIGS_ENABLED in |
| 1298 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 1299 | *) maybe_calc_verify="<= calc verify";; |
| 1300 | esac |
| 1301 | } |
| 1302 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1303 | # Compare file content |
| 1304 | # Usage: find_in_both pattern file1 file2 |
| 1305 | # extract from file1 the first line matching the pattern |
| 1306 | # check in file2 that the same line can be found |
| 1307 | find_in_both() { |
| 1308 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 1309 | if [ -z "$srv_pattern" ]; then |
| 1310 | return 1; |
| 1311 | fi |
| 1312 | |
| 1313 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 1314 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1315 | else |
| 1316 | return 1; |
| 1317 | fi |
| 1318 | } |
| 1319 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1320 | SKIP_HANDSHAKE_CHECK="NO" |
| 1321 | skip_handshake_stage_check() { |
| 1322 | SKIP_HANDSHAKE_CHECK="YES" |
| 1323 | } |
| 1324 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1325 | # Analyze the commands that will be used in a test. |
| 1326 | # |
| 1327 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 1328 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 1329 | # |
| 1330 | # Inputs: |
| 1331 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 1332 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 1333 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 1334 | # |
| 1335 | # Outputs: |
| 1336 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1337 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1338 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 1339 | # as it provides timing info that's useful to debug failures |
Manuel Pégourié-Gonnard | 70fce98 | 2020-06-25 09:54:46 +0200 | [diff] [blame] | 1340 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1341 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 1342 | case " $SRV_CMD " in |
| 1343 | *' server_addr=::1 '*) |
| 1344 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 1345 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1346 | fi |
| 1347 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1348 | # update CMD_IS_GNUTLS variable |
| 1349 | is_gnutls "$SRV_CMD" |
| 1350 | |
| 1351 | # if the server uses gnutls but doesn't set priority, explicitly |
| 1352 | # set the default priority |
| 1353 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1354 | case "$SRV_CMD" in |
| 1355 | *--priority*) :;; |
| 1356 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 1357 | esac |
| 1358 | fi |
| 1359 | |
| 1360 | # update CMD_IS_GNUTLS variable |
| 1361 | is_gnutls "$CLI_CMD" |
| 1362 | |
| 1363 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1364 | # set the default priority |
| 1365 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1366 | case "$CLI_CMD" in |
| 1367 | *--priority*) :;; |
| 1368 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1369 | esac |
| 1370 | fi |
| 1371 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1372 | # fix client port |
| 1373 | if [ -n "$PXY_CMD" ]; then |
| 1374 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1375 | else |
| 1376 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 1377 | fi |
| 1378 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1379 | # prepend valgrind to our commands if active |
| 1380 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1381 | if is_polar "$SRV_CMD"; then |
| 1382 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1383 | fi |
| 1384 | if is_polar "$CLI_CMD"; then |
| 1385 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1386 | fi |
| 1387 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1388 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1389 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1390 | # Check for failure conditions after a test case. |
| 1391 | # |
| 1392 | # Inputs from run_test: |
| 1393 | # * positional parameters: test options (see run_test documentation) |
| 1394 | # * $CLI_EXIT: client return code |
| 1395 | # * $CLI_EXPECT: expected client return code |
| 1396 | # * $SRV_RET: server return code |
| 1397 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1398 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1399 | # |
| 1400 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1401 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1402 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1403 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1404 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1405 | if [ $TIMES_LEFT -gt 0 ] && |
| 1406 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1407 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1408 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1409 | return |
| 1410 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1411 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1412 | # check if the client and server went at least to the handshake stage |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1413 | # (useful to avoid tests with only negative assertions and non-zero |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1414 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1415 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1416 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1417 | then |
| 1418 | if is_polar "$SRV_CMD"; then |
| 1419 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1420 | else |
| 1421 | fail "server or client failed to reach handshake stage" |
| 1422 | return |
| 1423 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1424 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1425 | if is_polar "$CLI_CMD"; then |
| 1426 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1427 | else |
| 1428 | fail "server or client failed to reach handshake stage" |
| 1429 | return |
| 1430 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1431 | fi |
| 1432 | fi |
| 1433 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1434 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1435 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1436 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1437 | # care anyway), in case e.g. the server reports a memory leak. |
| 1438 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1439 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1440 | return |
| 1441 | fi |
| 1442 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1443 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1444 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1445 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1446 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1447 | fail "bad client exit code (expected $CLI_EXPECT, got $CLI_EXIT)" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1448 | return |
| 1449 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1450 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1451 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1452 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1453 | # lines with 'Serious error when reading debug info', are valgrind issues as well |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1454 | while [ $# -gt 0 ] |
| 1455 | do |
| 1456 | case $1 in |
| 1457 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1458 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1459 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1460 | return |
| 1461 | fi |
| 1462 | ;; |
| 1463 | |
| 1464 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1465 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1466 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1467 | return |
| 1468 | fi |
| 1469 | ;; |
| 1470 | |
| 1471 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1472 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 1473 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1474 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1475 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1476 | return |
| 1477 | fi |
| 1478 | ;; |
| 1479 | |
| 1480 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1481 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 1482 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1483 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1484 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1485 | return |
| 1486 | fi |
| 1487 | ;; |
| 1488 | |
| 1489 | # The filtering in the following two options (-u and -U) do the following |
| 1490 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1491 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1492 | # - keep one of each non-unique line |
| 1493 | # - count how many lines remain |
| 1494 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1495 | # if there were no duplicates. |
| 1496 | "-U") |
| 1497 | if [ $(grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep -A1 "$2" | grep -v "$2" | sort | uniq -d | wc -l) -gt 1 ]; then |
| 1498 | fail "lines following pattern '$2' must be unique in Server output" |
| 1499 | return |
| 1500 | fi |
| 1501 | ;; |
| 1502 | |
| 1503 | "-u") |
| 1504 | if [ $(grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep -A1 "$2" | grep -v "$2" | sort | uniq -d | wc -l) -gt 1 ]; then |
| 1505 | fail "lines following pattern '$2' must be unique in Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1506 | return |
| 1507 | fi |
| 1508 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1509 | "-F") |
| 1510 | if ! $2 "$SRV_OUT"; then |
| 1511 | fail "function call to '$2' failed on Server output" |
| 1512 | return |
| 1513 | fi |
| 1514 | ;; |
| 1515 | "-f") |
| 1516 | if ! $2 "$CLI_OUT"; then |
| 1517 | fail "function call to '$2' failed on Client output" |
| 1518 | return |
| 1519 | fi |
| 1520 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1521 | "-g") |
| 1522 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1523 | fail "function call to '$2' failed on Server and Client output" |
| 1524 | return |
| 1525 | fi |
| 1526 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1527 | |
| 1528 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1529 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1530 | exit 1 |
| 1531 | esac |
| 1532 | shift 2 |
| 1533 | done |
| 1534 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1535 | # check valgrind's results |
| 1536 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1537 | if is_polar "$SRV_CMD" && has_mem_err $SRV_OUT; then |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1538 | fail "Server has memory errors" |
| 1539 | return |
| 1540 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1541 | if is_polar "$CLI_CMD" && has_mem_err $CLI_OUT; then |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1542 | fail "Client has memory errors" |
| 1543 | return |
| 1544 | fi |
| 1545 | fi |
| 1546 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1547 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1548 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1549 | } |
| 1550 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1551 | # Run the current test case: start the server and if applicable the proxy, run |
| 1552 | # the client, wait for all processes to finish or time out. |
| 1553 | # |
| 1554 | # Inputs: |
| 1555 | # * $NAME: test case name |
| 1556 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1557 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1558 | # |
| 1559 | # Outputs: |
| 1560 | # * $CLI_EXIT: client return code |
| 1561 | # * $SRV_RET: server return code |
| 1562 | do_run_test_once() { |
| 1563 | # run the commands |
| 1564 | if [ -n "$PXY_CMD" ]; then |
| 1565 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1566 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1567 | PXY_PID=$! |
| 1568 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1569 | fi |
| 1570 | |
| 1571 | check_osrv_dtls |
| 1572 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1573 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1574 | SRV_PID=$! |
| 1575 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1576 | |
| 1577 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1578 | # The client must be a subprocess of the script in order for killing it to |
| 1579 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1580 | # not at the end of the line: the latter approach will spawn eval as a |
| 1581 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1582 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1583 | wait_client_done |
| 1584 | |
| 1585 | sleep 0.05 |
| 1586 | |
| 1587 | # terminate the server (and the proxy) |
| 1588 | kill $SRV_PID |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1589 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
Jerry Yu | 27d8092 | 2022-08-02 21:28:55 +0800 | [diff] [blame] | 1590 | # To remove it from stdout, redirect stdout/stderr to SRV_OUT |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1591 | wait $SRV_PID >> $SRV_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1592 | SRV_RET=$? |
| 1593 | |
| 1594 | if [ -n "$PXY_CMD" ]; then |
| 1595 | kill $PXY_PID >/dev/null 2>&1 |
Jerry Yu | 6969eee | 2022-10-10 10:25:26 +0800 | [diff] [blame] | 1596 | wait $PXY_PID >> $PXY_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1597 | fi |
| 1598 | } |
| 1599 | |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1600 | # Detect if the current test is going to use TLS 1.3 or TLS 1.2. |
Valerio Setti | 194e2bd | 2023-03-02 17:18:10 +0100 | [diff] [blame] | 1601 | # $1 and $2 contain the server and client command lines, respectively. |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1602 | # |
| 1603 | # Note: this function only provides some guess about TLS version by simply |
Yanray Wang | 7b320fa | 2023-11-08 10:33:30 +0800 | [diff] [blame] | 1604 | # looking at the server/client command lines. Even though this works |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1605 | # for the sake of tests' filtering (especially in conjunction with the |
| 1606 | # detect_required_features() function), it does NOT guarantee that the |
| 1607 | # result is accurate. It does not check other conditions, such as: |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1608 | # - we can force a ciphersuite which contains "WITH" in its name, meaning |
| 1609 | # that we are going to use TLS 1.2 |
| 1610 | # - etc etc |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1611 | get_tls_version() { |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1612 | # First check if the version is forced on an Mbed TLS peer |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1613 | case $1 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1614 | *tls12*) |
| 1615 | echo "TLS12" |
| 1616 | return;; |
| 1617 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1618 | echo "TLS13" |
| 1619 | return;; |
| 1620 | esac |
| 1621 | case $2 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1622 | *tls12*) |
| 1623 | echo "TLS12" |
| 1624 | return;; |
| 1625 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1626 | echo "TLS13" |
| 1627 | return;; |
| 1628 | esac |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1629 | # Second check if the version is forced on an OpenSSL or GnuTLS peer |
| 1630 | case $1 in |
| 1631 | tls1_2*) |
| 1632 | echo "TLS12" |
| 1633 | return;; |
| 1634 | *tls1_3) |
| 1635 | echo "TLS13" |
| 1636 | return;; |
| 1637 | esac |
| 1638 | case $2 in |
| 1639 | *tls1_2) |
| 1640 | echo "TLS12" |
| 1641 | return;; |
| 1642 | *tls1_3) |
| 1643 | echo "TLS13" |
| 1644 | return;; |
| 1645 | esac |
| 1646 | # Third if the version is not forced, if TLS 1.3 is enabled then the test |
| 1647 | # is aimed to run a TLS 1.3 handshake. |
| 1648 | if $P_QUERY -all MBEDTLS_SSL_PROTO_TLS1_3 |
| 1649 | then |
| 1650 | echo "TLS13" |
| 1651 | else |
| 1652 | echo "TLS12" |
| 1653 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1654 | } |
| 1655 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1656 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1657 | # Options: -s pattern pattern that must be present in server output |
| 1658 | # -c pattern pattern that must be present in client output |
| 1659 | # -u pattern lines after pattern must be unique in client output |
| 1660 | # -f call shell function on client output |
| 1661 | # -S pattern pattern that must be absent in server output |
| 1662 | # -C pattern pattern that must be absent in client output |
| 1663 | # -U pattern lines after pattern must be unique in server output |
| 1664 | # -F call shell function on server output |
| 1665 | # -g call shell function on server and client output |
| 1666 | run_test() { |
| 1667 | NAME="$1" |
| 1668 | shift 1 |
| 1669 | |
Tomás González | 787428a | 2023-08-23 15:27:19 +0100 | [diff] [blame] | 1670 | if is_excluded "$NAME"; then |
| 1671 | SKIP_NEXT="NO" |
| 1672 | # There was no request to run the test, so don't record its outcome. |
| 1673 | return |
| 1674 | fi |
| 1675 | |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1676 | if [ "$LIST_TESTS" -gt 0 ]; then |
Pengyu Lv | 3c170d3 | 2023-11-29 13:53:34 +0800 | [diff] [blame] | 1677 | printf "%s\n" "${TEST_SUITE_NAME:-ssl-opt};$NAME" |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1678 | return |
| 1679 | fi |
| 1680 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 1681 | # Use ssl-opt as default test suite name. Also see record_outcome function |
| 1682 | if is_excluded_test_suite "${TEST_SUITE_NAME:-ssl-opt}"; then |
| 1683 | # Do not skip next test and skip current test. |
| 1684 | SKIP_NEXT="NO" |
| 1685 | return |
| 1686 | fi |
| 1687 | |
Tomás González | 51cb704 | 2023-09-07 10:21:19 +0100 | [diff] [blame] | 1688 | print_name "$NAME" |
| 1689 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1690 | # Do we only run numbered tests? |
| 1691 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1692 | case ",$RUN_TEST_NUMBER," in |
| 1693 | *",$TESTS,"*) :;; |
| 1694 | *) SKIP_NEXT="YES";; |
| 1695 | esac |
| 1696 | fi |
| 1697 | |
| 1698 | # does this test use a proxy? |
| 1699 | if [ "X$1" = "X-p" ]; then |
| 1700 | PXY_CMD="$2" |
| 1701 | shift 2 |
| 1702 | else |
| 1703 | PXY_CMD="" |
| 1704 | fi |
| 1705 | |
| 1706 | # get commands and client output |
| 1707 | SRV_CMD="$1" |
| 1708 | CLI_CMD="$2" |
| 1709 | CLI_EXPECT="$3" |
| 1710 | shift 3 |
| 1711 | |
| 1712 | # Check if test uses files |
| 1713 | case "$SRV_CMD $CLI_CMD" in |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1714 | *$DATA_FILES_PATH/*) |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1715 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1716 | esac |
| 1717 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1718 | # Check if the test uses DTLS. |
| 1719 | detect_dtls "$SRV_CMD" |
| 1720 | if [ "$DTLS" -eq 1 ]; then |
| 1721 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1722 | fi |
| 1723 | |
Yanray Wang | 7b320fa | 2023-11-08 10:33:30 +0800 | [diff] [blame] | 1724 | # Check if we are trying to use an external tool which does not support ECDH |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1725 | EXT_WO_ECDH=$(use_ext_tool_without_ecdh_support "$SRV_CMD" "$CLI_CMD") |
| 1726 | |
Valerio Setti | 726ffbf | 2023-08-02 20:02:44 +0200 | [diff] [blame] | 1727 | # Guess the TLS version which is going to be used |
| 1728 | if [ "$EXT_WO_ECDH" = "no" ]; then |
| 1729 | TLS_VERSION=$(get_tls_version "$SRV_CMD" "$CLI_CMD") |
| 1730 | else |
| 1731 | TLS_VERSION="TLS12" |
| 1732 | fi |
| 1733 | |
| 1734 | # If the client or server requires certain features that can be detected |
Manuel Pégourié-Gonnard | f299efd | 2023-09-18 11:19:04 +0200 | [diff] [blame] | 1735 | # from their command-line arguments, check whether they're enabled. |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1736 | detect_required_features "$SRV_CMD" "server" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
| 1737 | detect_required_features "$CLI_CMD" "client" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1738 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 1739 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1740 | maybe_adapt_for_psk "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1741 | |
| 1742 | # should we skip? |
| 1743 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1744 | SKIP_NEXT="NO" |
| 1745 | record_outcome "SKIP" |
| 1746 | SKIPS=$(( $SKIPS + 1 )) |
| 1747 | return |
| 1748 | fi |
| 1749 | |
| 1750 | analyze_test_commands "$@" |
| 1751 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1752 | # One regular run and two retries |
| 1753 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1754 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1755 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1756 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1757 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1758 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1759 | check_test_failure "$@" |
| 1760 | case $outcome in |
| 1761 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1762 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1763 | FAIL) return;; |
| 1764 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1765 | done |
| 1766 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1767 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1768 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1769 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1770 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1771 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1772 | if [ -n "$PXY_CMD" ]; then |
| 1773 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1774 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1775 | fi |
| 1776 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1777 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1778 | } |
| 1779 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1780 | run_test_psa() { |
| 1781 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1782 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1783 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1784 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1785 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1786 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1787 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1788 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1789 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1790 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1791 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1792 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1793 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1794 | -S "error" \ |
| 1795 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1796 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1797 | } |
| 1798 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1799 | run_test_psa_force_curve() { |
| 1800 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1801 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1802 | run_test "PSA - ECDH with $1" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 1803 | "$P_SRV debug_level=4 force_version=tls12 groups=$1" \ |
| 1804 | "$P_CLI debug_level=4 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 groups=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1805 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1806 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1807 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1808 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1809 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1810 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1811 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1812 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1813 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1814 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1815 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1816 | } |
| 1817 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1818 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1819 | # a maximum fragment length. |
| 1820 | # first argument ($1) is MFL for SSL client |
| 1821 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1822 | run_test_memory_after_handshake_with_mfl() |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1823 | { |
| 1824 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1825 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1826 | |
| 1827 | # Leave some margin for robustness |
| 1828 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1829 | |
| 1830 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1831 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1832 | "$P_CLI debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1833 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1834 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1835 | 0 \ |
| 1836 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1837 | } |
| 1838 | |
| 1839 | |
| 1840 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1841 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1842 | run_tests_memory_after_handshake() |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1843 | { |
| 1844 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1845 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1846 | |
| 1847 | # first test with default MFU is to get reference memory usage |
| 1848 | MEMORY_USAGE_MFL_16K=0 |
| 1849 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1850 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1851 | "$P_CLI debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1852 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1853 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1854 | 0 \ |
| 1855 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1856 | |
| 1857 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1858 | run_test_memory_after_handshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1859 | |
| 1860 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1861 | run_test_memory_after_handshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1862 | |
| 1863 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1864 | run_test_memory_after_handshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1865 | |
| 1866 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1867 | run_test_memory_after_handshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1868 | } |
| 1869 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1870 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1871 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1872 | rm -f context_srv.txt |
| 1873 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1874 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1875 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1876 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1877 | test -n "${DOG_PID:-}" && kill $DOG_PID >/dev/null 2>&1 |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1878 | exit 1 |
| 1879 | } |
| 1880 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1881 | # |
| 1882 | # MAIN |
| 1883 | # |
| 1884 | |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 1885 | # Make the outcome file path relative to the original directory, not |
| 1886 | # to .../tests |
| 1887 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 1888 | [!/]*) |
| 1889 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 1890 | ;; |
| 1891 | esac |
| 1892 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 1893 | populate_enabled_hash_algs |
| 1894 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1895 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1896 | # patterns rather than regular expressions, use a case statement instead |
| 1897 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1898 | # detects simple cases: plain substring, everything, nothing. |
| 1899 | # |
| 1900 | # As an exception, the character '.' is treated as an ordinary character |
| 1901 | # if it is the only special character in the string. This is because it's |
| 1902 | # rare to need "any one character", but needing a literal '.' is common |
| 1903 | # (e.g. '-f "DTLS 1.2"'). |
| 1904 | need_grep= |
| 1905 | case "$FILTER" in |
| 1906 | '^$') simple_filter=;; |
| 1907 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1908 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1909 | need_grep=1;; |
| 1910 | *) # No regexp or shell-pattern special character |
| 1911 | simple_filter="*$FILTER*";; |
| 1912 | esac |
| 1913 | case "$EXCLUDE" in |
| 1914 | '^$') simple_exclude=;; |
| 1915 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1916 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1917 | need_grep=1;; |
| 1918 | *) # No regexp or shell-pattern special character |
| 1919 | simple_exclude="*$EXCLUDE*";; |
| 1920 | esac |
| 1921 | if [ -n "$need_grep" ]; then |
| 1922 | is_excluded () { |
| 1923 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1924 | } |
| 1925 | else |
| 1926 | is_excluded () { |
| 1927 | case "$1" in |
| 1928 | $simple_exclude) true;; |
| 1929 | $simple_filter) false;; |
| 1930 | *) true;; |
| 1931 | esac |
| 1932 | } |
| 1933 | fi |
| 1934 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 1935 | # Filter tests according to TEST_SUITE_NAME |
| 1936 | is_excluded_test_suite () { |
| 1937 | if [ -n "$RUN_TEST_SUITE" ] |
| 1938 | then |
| 1939 | case ",$RUN_TEST_SUITE," in |
| 1940 | *",$1,"*) false;; |
| 1941 | *) true;; |
| 1942 | esac |
| 1943 | else |
| 1944 | false |
| 1945 | fi |
| 1946 | |
| 1947 | } |
| 1948 | |
| 1949 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 1950 | if [ "$LIST_TESTS" -eq 0 ];then |
| 1951 | |
| 1952 | # sanity checks, avoid an avalanche of errors |
| 1953 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1954 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1955 | P_PXY_BIN="${P_PXY%%[ ]*}" |
| 1956 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1957 | echo "Command '$P_SRV_BIN' is not an executable file" |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1958 | exit 1 |
| 1959 | fi |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 1960 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1961 | echo "Command '$P_CLI_BIN' is not an executable file" |
| 1962 | exit 1 |
| 1963 | fi |
| 1964 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1965 | echo "Command '$P_PXY_BIN' is not an executable file" |
| 1966 | exit 1 |
| 1967 | fi |
| 1968 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1969 | if which valgrind >/dev/null 2>&1; then :; else |
| 1970 | echo "Memcheck not possible. Valgrind not found" |
| 1971 | exit 1 |
| 1972 | fi |
| 1973 | fi |
| 1974 | if which $OPENSSL >/dev/null 2>&1; then :; else |
| 1975 | echo "Command '$OPENSSL' not found" |
| 1976 | exit 1 |
| 1977 | fi |
| 1978 | |
| 1979 | # used by watchdog |
| 1980 | MAIN_PID="$$" |
| 1981 | |
| 1982 | # We use somewhat arbitrary delays for tests: |
| 1983 | # - how long do we wait for the server to start (when lsof not available)? |
| 1984 | # - how long do we allow for the client to finish? |
| 1985 | # (not to check performance, just to avoid waiting indefinitely) |
| 1986 | # Things are slower with valgrind, so give extra time here. |
| 1987 | # |
| 1988 | # Note: without lsof, there is a trade-off between the running time of this |
| 1989 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1990 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1991 | # the script, only the case where a client or server gets stuck. |
| 1992 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1993 | START_DELAY=6 |
| 1994 | DOG_DELAY=60 |
| 1995 | else |
| 1996 | START_DELAY=2 |
| 1997 | DOG_DELAY=20 |
| 1998 | fi |
| 1999 | |
| 2000 | # some particular tests need more time: |
| 2001 | # - for the client, we multiply the usual watchdog limit by a factor |
| 2002 | # - for the server, we sleep for a number of seconds after the client exits |
| 2003 | # see client_need_more_time() and server_needs_more_time() |
| 2004 | CLI_DELAY_FACTOR=1 |
| 2005 | SRV_DELAY_SECONDS=0 |
| 2006 | |
| 2007 | # fix commands to use this port, force IPv4 while at it |
| 2008 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
| 2009 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 2010 | # machines that will resolve to ::1, and we don't want ipv6 here. |
| 2011 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 2012 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
| 2013 | P_PXY="$P_PXY server_addr=127.0.0.1 server_port=$SRV_PORT listen_addr=127.0.0.1 listen_port=$PXY_PORT ${SEED:+"seed=$SEED"}" |
| 2014 | O_SRV="$O_SRV -accept $SRV_PORT" |
| 2015 | O_CLI="$O_CLI -connect 127.0.0.1:+SRV_PORT" |
| 2016 | G_SRV="$G_SRV -p $SRV_PORT" |
| 2017 | G_CLI="$G_CLI -p +SRV_PORT" |
| 2018 | |
| 2019 | # Newer versions of OpenSSL have a syntax to enable all "ciphers", even |
| 2020 | # low-security ones. This covers not just cipher suites but also protocol |
| 2021 | # versions. It is necessary, for example, to use (D)TLS 1.0/1.1 on |
| 2022 | # OpenSSL 1.1.1f from Ubuntu 20.04. The syntax was only introduced in |
| 2023 | # OpenSSL 1.1.0 (21e0c1d23afff48601eb93135defddae51f7e2e3) and I can't find |
| 2024 | # a way to discover it from -help, so check the openssl version. |
| 2025 | case $($OPENSSL version) in |
| 2026 | "OpenSSL 0"*|"OpenSSL 1.0"*) :;; |
| 2027 | *) |
| 2028 | O_CLI="$O_CLI -cipher ALL@SECLEVEL=0" |
| 2029 | O_SRV="$O_SRV -cipher ALL@SECLEVEL=0" |
| 2030 | ;; |
| 2031 | esac |
| 2032 | |
| 2033 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 2034 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
| 2035 | O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT" |
| 2036 | O_NEXT_SRV_EARLY_DATA="$O_NEXT_SRV_EARLY_DATA -accept $SRV_PORT" |
| 2037 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
| 2038 | O_NEXT_CLI_NO_CERT="$O_NEXT_CLI_NO_CERT -connect 127.0.0.1:+SRV_PORT" |
| 2039 | fi |
| 2040 | |
| 2041 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
| 2042 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 2043 | G_NEXT_SRV_NO_CERT="$G_NEXT_SRV_NO_CERT -p $SRV_PORT" |
| 2044 | fi |
| 2045 | |
| 2046 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
| 2047 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
| 2048 | G_NEXT_CLI_NO_CERT="$G_NEXT_CLI_NO_CERT -p +SRV_PORT localhost" |
| 2049 | fi |
| 2050 | |
| 2051 | # Allow SHA-1, because many of our test certificates use it |
| 2052 | P_SRV="$P_SRV allow_sha1=1" |
| 2053 | P_CLI="$P_CLI allow_sha1=1" |
| 2054 | |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 2055 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2056 | # Also pick a unique name for intermediate files |
| 2057 | SRV_OUT="srv_out.$$" |
| 2058 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 2059 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2060 | SESSION="session.$$" |
| 2061 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 2062 | SKIP_NEXT="NO" |
| 2063 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 2064 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 2065 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2066 | # Basic test |
| 2067 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2068 | # Checks that: |
| 2069 | # - things work with all ciphersuites active (used with config-full in all.sh) |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 2070 | # - the expected parameters are selected |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2071 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2072 | requires_hash_alg SHA_512 # "signature_algorithm ext: 6" |
Valerio Setti | 482a0b9 | 2023-08-18 15:55:10 +0200 | [diff] [blame] | 2073 | requires_any_configs_enabled "MBEDTLS_ECP_DP_CURVE25519_ENABLED \ |
| 2074 | PSA_WANT_ECC_MONTGOMERY_255" |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2075 | run_test "Default, TLS 1.2" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2076 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2077 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2078 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2079 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 2080 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2081 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 2082 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2083 | -S "error" \ |
| 2084 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2085 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2086 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2087 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2088 | run_test "Default, DTLS" \ |
| 2089 | "$P_SRV dtls=1" \ |
| 2090 | "$P_CLI dtls=1" \ |
| 2091 | 0 \ |
| 2092 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 2093 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2094 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 2095 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 2096 | run_test "TLS client auth: required" \ |
| 2097 | "$P_SRV auth_mode=required" \ |
| 2098 | "$P_CLI" \ |
| 2099 | 0 \ |
| 2100 | -s "Verifying peer X.509 certificate... ok" |
| 2101 | |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 2102 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2103 | "$P_SRV" \ |
| 2104 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2105 | 0 \ |
| 2106 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2107 | -c "Key size is 256" |
| 2108 | |
| 2109 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2110 | "$P_SRV" \ |
| 2111 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2112 | 0 \ |
| 2113 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2114 | -c "Key size is 128" |
| 2115 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2116 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2117 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2118 | # module does not support PSA dispatching so we need builtin support. |
| 2119 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2120 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2121 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2122 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2123 | run_test "TLS: password protected client key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2124 | "$P_SRV force_version=tls12 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2125 | "$P_CLI crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key.enc key_pwd=PolarSSLTest" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2126 | 0 |
| 2127 | |
| 2128 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2129 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2130 | # module does not support PSA dispatching so we need builtin support. |
| 2131 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2132 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2133 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2134 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2135 | run_test "TLS: password protected server key" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2136 | "$P_SRV crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key.enc key_pwd=PolarSSLTest" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2137 | "$P_CLI force_version=tls12" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2138 | 0 |
| 2139 | |
| 2140 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2141 | requires_config_enabled MBEDTLS_RSA_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2142 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2143 | # module does not support PSA dispatching so we need builtin support. |
| 2144 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2145 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2146 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2147 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2148 | run_test "TLS: password protected server key, two certificates" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2149 | "$P_SRV force_version=tls12\ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2150 | key_file=$DATA_FILES_PATH/server5.key.enc key_pwd=PolarSSLTest crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2151 | key_file2=$DATA_FILES_PATH/server2.key.enc key_pwd2=PolarSSLTest crt_file2=$DATA_FILES_PATH/server2.crt" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2152 | "$P_CLI" \ |
| 2153 | 0 |
| 2154 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2155 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2156 | run_test "CA callback on client" \ |
| 2157 | "$P_SRV debug_level=3" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame^] | 2158 | "$P_CLI ca_callback=1 debug_level=3 " \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2159 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2160 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2161 | -S "error" \ |
| 2162 | -C "error" |
| 2163 | |
| 2164 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2165 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2166 | requires_hash_alg SHA_256 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2167 | run_test "CA callback on server" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame^] | 2168 | "$P_SRV auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2169 | "$P_CLI ca_callback=1 debug_level=3 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2170 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2171 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2172 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2173 | -s "Verifying peer X.509 certificate... ok" \ |
| 2174 | -S "error" \ |
| 2175 | -C "error" |
| 2176 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2177 | # Test using an EC opaque private key for client authentication |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2178 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2179 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2180 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2181 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2182 | run_test "Opaque key for client authentication: ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2183 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2184 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 2185 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2186 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2187 | 0 \ |
| 2188 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2189 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2190 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2191 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2192 | -S "error" \ |
| 2193 | -C "error" |
| 2194 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2195 | # Test using a RSA opaque private key for client authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2196 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2197 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2198 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2199 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2200 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2201 | run_test "Opaque key for client authentication: ECDHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2202 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2203 | key_file=$DATA_FILES_PATH/server2.key" \ |
| 2204 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2205 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2206 | 0 \ |
| 2207 | -c "key type: Opaque" \ |
| 2208 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2209 | -s "Verifying peer X.509 certificate... ok" \ |
| 2210 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2211 | -S "error" \ |
| 2212 | -C "error" |
| 2213 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2214 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2215 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2216 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2217 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2218 | run_test "Opaque key for client authentication: DHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2219 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2220 | key_file=$DATA_FILES_PATH/server2.key" \ |
| 2221 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2222 | key_file=$DATA_FILES_PATH/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2223 | key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2224 | 0 \ |
| 2225 | -c "key type: Opaque" \ |
| 2226 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2227 | -s "Verifying peer X.509 certificate... ok" \ |
| 2228 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2229 | -S "error" \ |
| 2230 | -C "error" |
| 2231 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2232 | # Test using an EC opaque private key for server authentication |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2233 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2234 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2235 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2236 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2237 | run_test "Opaque key for server authentication: ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2238 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2239 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2240 | "$P_CLI force_version=tls12" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2241 | 0 \ |
| 2242 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2243 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2244 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2245 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2246 | -S "error" \ |
| 2247 | -C "error" |
| 2248 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2249 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2250 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2251 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2252 | run_test "Opaque key for server authentication: ECDH-" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2253 | "$P_SRV auth_mode=required key_opaque=1\ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2254 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt\ |
| 2255 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdh,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2256 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2257 | 0 \ |
| 2258 | -c "Verifying peer X.509 certificate... ok" \ |
| 2259 | -c "Ciphersuite is TLS-ECDH-" \ |
| 2260 | -s "key types: Opaque, none" \ |
| 2261 | -s "Ciphersuite is TLS-ECDH-" \ |
| 2262 | -S "error" \ |
| 2263 | -C "error" |
| 2264 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2265 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2266 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2267 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2268 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2269 | run_test "Opaque key for server authentication: invalid key: decrypt with ECC key, no async" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2270 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2271 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=rsa-decrypt,none \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2272 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2273 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2274 | 1 \ |
| 2275 | -s "key types: Opaque, none" \ |
| 2276 | -s "error" \ |
| 2277 | -c "error" \ |
| 2278 | -c "Public key type mismatch" |
| 2279 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2280 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2281 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2282 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2283 | requires_config_enabled MBEDTLS_RSA_C |
| 2284 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2285 | requires_hash_alg SHA_256 |
| 2286 | run_test "Opaque key for server authentication: invalid key: ecdh with RSA key, no async" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2287 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2288 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=ecdh,none \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2289 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2290 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2291 | 1 \ |
| 2292 | -s "key types: Opaque, none" \ |
| 2293 | -s "error" \ |
| 2294 | -c "error" \ |
| 2295 | -c "Public key type mismatch" |
| 2296 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2297 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2298 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2299 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2300 | requires_hash_alg SHA_256 |
| 2301 | run_test "Opaque key for server authentication: invalid alg: decrypt with ECC key, async" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2302 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2303 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=rsa-decrypt,none \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2304 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2305 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2306 | 1 \ |
| 2307 | -s "key types: Opaque, none" \ |
| 2308 | -s "got ciphersuites in common, but none of them usable" \ |
| 2309 | -s "error" \ |
| 2310 | -c "error" |
| 2311 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2312 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2313 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2314 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2315 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2316 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2317 | run_test "Opaque key for server authentication: invalid alg: ecdh with RSA key, async" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2318 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2319 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2320 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2321 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2322 | 1 \ |
| 2323 | -s "key types: Opaque, none" \ |
| 2324 | -s "got ciphersuites in common, but none of them usable" \ |
| 2325 | -s "error" \ |
| 2326 | -c "error" |
| 2327 | |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2328 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2329 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2330 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2331 | run_test "Opaque key for server authentication: invalid alg: ECDHE-ECDSA with ecdh" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2332 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2333 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2334 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2335 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2336 | 1 \ |
| 2337 | -s "key types: Opaque, none" \ |
| 2338 | -s "got ciphersuites in common, but none of them usable" \ |
| 2339 | -s "error" \ |
| 2340 | -c "error" |
| 2341 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2342 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2343 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2344 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2345 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2346 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2347 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2348 | "$P_SRV force_version=tls12 key_opaque=1 crt_file=$DATA_FILES_PATH/server7.crt \ |
| 2349 | key_file=$DATA_FILES_PATH/server7.key key_opaque_algs=ecdh,none \ |
| 2350 | crt_file2=$DATA_FILES_PATH/server5.crt key_file2=$DATA_FILES_PATH/server5.key \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2351 | key_opaque_algs2=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2352 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2353 | 0 \ |
| 2354 | -c "Verifying peer X.509 certificate... ok" \ |
| 2355 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2356 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2357 | -s "key types: Opaque, Opaque" \ |
| 2358 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2359 | -S "error" \ |
| 2360 | -C "error" |
| 2361 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2362 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2363 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2364 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2365 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2366 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDH-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2367 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server7.crt \ |
| 2368 | key_file=$DATA_FILES_PATH/server7.key key_opaque_algs=ecdsa-sign,none \ |
| 2369 | crt_file2=$DATA_FILES_PATH/server5.crt key_file2=$DATA_FILES_PATH/server5.key \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2370 | key_opaque_algs2=ecdh,none debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2371 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-ECDH-ECDSA-WITH-CAMELLIA-256-CBC-SHA384" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2372 | 0 \ |
| 2373 | -c "Verifying peer X.509 certificate... ok" \ |
| 2374 | -c "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2375 | -c "CN=Polarssl Test EC CA" \ |
| 2376 | -s "key types: Opaque, Opaque" \ |
| 2377 | -s "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2378 | -S "error" \ |
| 2379 | -C "error" |
| 2380 | |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2381 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2382 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2383 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2384 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2385 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2386 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2387 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2388 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2389 | key_file2=$DATA_FILES_PATH/server2.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2390 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2391 | 0 \ |
| 2392 | -c "Verifying peer X.509 certificate... ok" \ |
| 2393 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2394 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2395 | -s "key types: Opaque, Opaque" \ |
| 2396 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2397 | -S "error" \ |
| 2398 | -C "error" |
| 2399 | |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2400 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2401 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2402 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2403 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2404 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2405 | run_test "TLS 1.3 opaque key: no suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2406 | "$P_SRV debug_level=4 auth_mode=required key_opaque=1 key_opaque_algs=rsa-decrypt,none" \ |
Ronald Cron | e3196d2 | 2022-09-16 16:43:35 +0200 | [diff] [blame] | 2407 | "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2408 | 1 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2409 | -c "key type: Opaque" \ |
| 2410 | -s "key types: Opaque, Opaque" \ |
| 2411 | -c "error" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 2412 | -s "no suitable signature algorithm" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2413 | |
| 2414 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2415 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2416 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2417 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2418 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2419 | run_test "TLS 1.3 opaque key: suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2420 | "$P_SRV debug_level=4 auth_mode=required key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Ronald Cron | e3196d2 | 2022-09-16 16:43:35 +0200 | [diff] [blame] | 2421 | "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2422 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2423 | -c "key type: Opaque" \ |
| 2424 | -s "key types: Opaque, Opaque" \ |
| 2425 | -C "error" \ |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2426 | -S "error" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2427 | |
| 2428 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2429 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2430 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2431 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2432 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2433 | run_test "TLS 1.3 opaque key: first client sig alg not suitable" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2434 | "$P_SRV debug_level=4 auth_mode=required key_opaque=1 key_opaque_algs=rsa-sign-pss-sha512,none" \ |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2435 | "$P_CLI debug_level=4 sig_algs=rsa_pss_rsae_sha256,rsa_pss_rsae_sha512" \ |
| 2436 | 0 \ |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2437 | -s "key types: Opaque, Opaque" \ |
| 2438 | -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \ |
| 2439 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 2440 | -C "error" \ |
| 2441 | -S "error" \ |
| 2442 | |
| 2443 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2444 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2445 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2446 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2447 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2448 | run_test "TLS 1.3 opaque key: 2 keys on server, suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2449 | "$P_SRV debug_level=4 auth_mode=required key_opaque=1 key_opaque_algs2=ecdsa-sign,none key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Ronald Cron | e3196d2 | 2022-09-16 16:43:35 +0200 | [diff] [blame] | 2450 | "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2451 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2452 | -c "key type: Opaque" \ |
| 2453 | -s "key types: Opaque, Opaque" \ |
| 2454 | -C "error" \ |
| 2455 | -S "error" \ |
| 2456 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2457 | # Test using a RSA opaque private key for server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2458 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2459 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2460 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2461 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2462 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2463 | run_test "Opaque key for server authentication: ECDHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2464 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2465 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2466 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2467 | 0 \ |
| 2468 | -c "Verifying peer X.509 certificate... ok" \ |
| 2469 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2470 | -s "key types: Opaque, none" \ |
| 2471 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2472 | -S "error" \ |
| 2473 | -C "error" |
| 2474 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2475 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2476 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2477 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2478 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2479 | run_test "Opaque key for server authentication: DHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2480 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2481 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2482 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2483 | 0 \ |
| 2484 | -c "Verifying peer X.509 certificate... ok" \ |
| 2485 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2486 | -s "key types: Opaque, none" \ |
| 2487 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2488 | -S "error" \ |
| 2489 | -C "error" |
| 2490 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2491 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2492 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2493 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2494 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2495 | run_test "Opaque key for server authentication: RSA-PSK" \ |
| 2496 | "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 2497 | psk=73776f726466697368 psk_identity=foo" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2498 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 2499 | psk=73776f726466697368 psk_identity=foo" \ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2500 | 0 \ |
| 2501 | -c "Verifying peer X.509 certificate... ok" \ |
| 2502 | -c "Ciphersuite is TLS-RSA-PSK-" \ |
| 2503 | -s "key types: Opaque, Opaque" \ |
| 2504 | -s "Ciphersuite is TLS-RSA-PSK-" \ |
| 2505 | -S "error" \ |
| 2506 | -C "error" |
| 2507 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2508 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2509 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2510 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2511 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2512 | run_test "Opaque key for server authentication: RSA-" \ |
| 2513 | "$P_SRV debug_level=3 key_opaque=1 key_opaque_algs=rsa-decrypt,none " \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2514 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA256" \ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2515 | 0 \ |
| 2516 | -c "Verifying peer X.509 certificate... ok" \ |
| 2517 | -c "Ciphersuite is TLS-RSA-" \ |
| 2518 | -s "key types: Opaque, Opaque" \ |
| 2519 | -s "Ciphersuite is TLS-RSA-" \ |
| 2520 | -S "error" \ |
| 2521 | -C "error" |
| 2522 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2523 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2524 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2525 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2526 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2527 | run_test "Opaque key for server authentication: DHE-RSA, PSS instead of PKCS1" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2528 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2529 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ |
| 2530 | "$P_CLI crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2531 | key_file=$DATA_FILES_PATH/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2532 | 1 \ |
| 2533 | -s "key types: Opaque, none" \ |
| 2534 | -s "got ciphersuites in common, but none of them usable" \ |
| 2535 | -s "error" \ |
| 2536 | -c "error" |
| 2537 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2538 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2539 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2540 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2541 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2542 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2543 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2544 | run_test "Opaque keys for server authentication: RSA keys with different algs" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2545 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2546 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pss,none \ |
| 2547 | crt_file2=$DATA_FILES_PATH/server4.crt \ |
| 2548 | key_file2=$DATA_FILES_PATH/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2549 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2550 | 0 \ |
| 2551 | -c "Verifying peer X.509 certificate... ok" \ |
| 2552 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2553 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2554 | -s "key types: Opaque, Opaque" \ |
| 2555 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2556 | -S "error" \ |
| 2557 | -C "error" |
| 2558 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2559 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2560 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2561 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2562 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2563 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2564 | run_test "Opaque keys for server authentication: EC + RSA, force DHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2565 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2566 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2567 | crt_file2=$DATA_FILES_PATH/server4.crt \ |
| 2568 | key_file2=$DATA_FILES_PATH/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2569 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2570 | 0 \ |
| 2571 | -c "Verifying peer X.509 certificate... ok" \ |
| 2572 | -c "Ciphersuite is TLS-DHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2573 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2574 | -s "key types: Opaque, Opaque" \ |
| 2575 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2576 | -S "error" \ |
| 2577 | -C "error" |
| 2578 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2579 | # Test using an EC opaque private key for client/server authentication |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2580 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2581 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2582 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2583 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2584 | run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2585 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2586 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none" \ |
| 2587 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2588 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2589 | 0 \ |
| 2590 | -c "key type: Opaque" \ |
| 2591 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2592 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2593 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2594 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2595 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2596 | -S "error" \ |
| 2597 | -C "error" |
| 2598 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2599 | # Test using a RSA opaque private key for client/server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2600 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2601 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2602 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2603 | requires_hash_alg SHA_256 |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2604 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2605 | run_test "Opaque key for client/server authentication: ECDHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2606 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2607 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
| 2608 | "$P_CLI force_version=tls12 key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2609 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2610 | 0 \ |
| 2611 | -c "key type: Opaque" \ |
| 2612 | -c "Verifying peer X.509 certificate... ok" \ |
| 2613 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2614 | -s "key types: Opaque, none" \ |
| 2615 | -s "Verifying peer X.509 certificate... ok" \ |
| 2616 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2617 | -S "error" \ |
| 2618 | -C "error" |
| 2619 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2620 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2621 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2622 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2623 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2624 | run_test "Opaque key for client/server authentication: DHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2625 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2626 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
| 2627 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2628 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2629 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2630 | 0 \ |
| 2631 | -c "key type: Opaque" \ |
| 2632 | -c "Verifying peer X.509 certificate... ok" \ |
| 2633 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2634 | -s "key types: Opaque, none" \ |
| 2635 | -s "Verifying peer X.509 certificate... ok" \ |
| 2636 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2637 | -S "error" \ |
| 2638 | -C "error" |
| 2639 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2640 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2641 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 2642 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 2643 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 2644 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 2645 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 2646 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 2647 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 2648 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 2649 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 2650 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 2651 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 2652 | |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2653 | requires_config_enabled PSA_WANT_ECC_SECP_R1_521 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2654 | run_test_psa_force_curve "secp521r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2655 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_512 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2656 | run_test_psa_force_curve "brainpoolP512r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2657 | requires_config_enabled PSA_WANT_ECC_SECP_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2658 | run_test_psa_force_curve "secp384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2659 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2660 | run_test_psa_force_curve "brainpoolP384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2661 | requires_config_enabled PSA_WANT_ECC_SECP_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2662 | run_test_psa_force_curve "secp256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2663 | requires_config_enabled PSA_WANT_ECC_SECP_K1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2664 | run_test_psa_force_curve "secp256k1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2665 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2666 | run_test_psa_force_curve "brainpoolP256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2667 | requires_config_enabled PSA_WANT_ECC_SECP_R1_224 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2668 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2669 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 2670 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2671 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 2672 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 2673 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2674 | #requires_config_enabled PSA_WANT_ECC_SECP_K1_224 |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2675 | #run_test_psa_force_curve "secp224k1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2676 | requires_config_enabled PSA_WANT_ECC_SECP_R1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2677 | run_test_psa_force_curve "secp192r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2678 | requires_config_enabled PSA_WANT_ECC_SECP_K1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2679 | run_test_psa_force_curve "secp192k1" |
| 2680 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2681 | # Test current time in ServerHello |
| 2682 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 2683 | run_test "ServerHello contains gmt_unix_time" \ |
| 2684 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2685 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2686 | 0 \ |
| 2687 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2688 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2689 | |
| 2690 | # Test for uniqueness of IVs in AEAD ciphersuites |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2691 | run_test "Unique IV in GCM" \ |
| 2692 | "$P_SRV exchanges=20 debug_level=4" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 2693 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2694 | 0 \ |
| 2695 | -u "IV used" \ |
| 2696 | -U "IV used" |
| 2697 | |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2698 | # Test for correctness of sent single supported algorithm |
Valerio Setti | 482a0b9 | 2023-08-18 15:55:10 +0200 | [diff] [blame] | 2699 | requires_any_configs_enabled "MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2700 | PSA_WANT_ECC_SECP_R1_256" |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2701 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2702 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Paul Elliott | 3b4ceda | 2022-11-17 12:47:10 +0000 | [diff] [blame] | 2703 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2704 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 2705 | requires_pk_alg "ECDSA" |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2706 | requires_hash_alg SHA_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2707 | run_test "Single supported algorithm sending: mbedtls client" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2708 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2709 | "$P_CLI force_version=tls12 sig_algs=ecdsa_secp256r1_sha256 debug_level=3" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2710 | 0 \ |
| 2711 | -c "Supported Signature Algorithm found: 04 03" |
| 2712 | |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2714 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Valerio Setti | 482a0b9 | 2023-08-18 15:55:10 +0200 | [diff] [blame] | 2715 | requires_any_configs_enabled "MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2716 | PSA_WANT_ECC_SECP_R1_256" |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2717 | requires_hash_alg SHA_256 |
| 2718 | run_test "Single supported algorithm sending: openssl client" \ |
| 2719 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2720 | "$O_CLI -cert $DATA_FILES_PATH/server6.crt \ |
| 2721 | -key $DATA_FILES_PATH/server6.key" \ |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2722 | 0 |
| 2723 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2724 | # Tests for certificate verification callback |
| 2725 | run_test "Configuration-specific CRT verification callback" \ |
| 2726 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2727 | "$P_CLI force_version=tls12 context_crt_cb=0 debug_level=3" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2728 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2729 | -S "error" \ |
| 2730 | -c "Verify requested for " \ |
| 2731 | -c "Use configuration-specific verification callback" \ |
| 2732 | -C "Use context-specific verification callback" \ |
| 2733 | -C "error" |
| 2734 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2735 | run_test "Context-specific CRT verification callback" \ |
| 2736 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2737 | "$P_CLI force_version=tls12 context_crt_cb=1 debug_level=3" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2738 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2739 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2740 | -c "Verify requested for " \ |
| 2741 | -c "Use context-specific verification callback" \ |
| 2742 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2743 | -C "error" |
| 2744 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2745 | # Tests for SHA-1 support |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2746 | requires_hash_alg SHA_1 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2747 | run_test "SHA-1 forbidden by default in server certificate" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2748 | "$P_SRV key_file=$DATA_FILES_PATH/server2.key crt_file=$DATA_FILES_PATH/server2.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2749 | "$P_CLI debug_level=2 force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2750 | 1 \ |
| 2751 | -c "The certificate is signed with an unacceptable hash" |
| 2752 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2753 | requires_hash_alg SHA_1 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2754 | run_test "SHA-1 explicitly allowed in server certificate" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2755 | "$P_SRV key_file=$DATA_FILES_PATH/server2.key crt_file=$DATA_FILES_PATH/server2.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2756 | "$P_CLI force_version=tls12 allow_sha1=1" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2757 | 0 |
| 2758 | |
| 2759 | run_test "SHA-256 allowed by default in server certificate" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2760 | "$P_SRV key_file=$DATA_FILES_PATH/server2.key crt_file=$DATA_FILES_PATH/server2-sha256.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2761 | "$P_CLI force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2762 | 0 |
| 2763 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2764 | requires_hash_alg SHA_1 |
| 2765 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2766 | run_test "SHA-1 forbidden by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2767 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2768 | "$P_CLI key_file=$DATA_FILES_PATH/cli-rsa.key crt_file=$DATA_FILES_PATH/cli-rsa-sha1.crt" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2769 | 1 \ |
| 2770 | -s "The certificate is signed with an unacceptable hash" |
| 2771 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2772 | requires_hash_alg SHA_1 |
| 2773 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2774 | run_test "SHA-1 explicitly allowed in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2775 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=1" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2776 | "$P_CLI key_file=$DATA_FILES_PATH/cli-rsa.key crt_file=$DATA_FILES_PATH/cli-rsa-sha1.crt" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2777 | 0 |
| 2778 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2779 | requires_config_enabled MBEDTLS_RSA_C |
| 2780 | requires_hash_alg SHA_256 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2781 | run_test "SHA-256 allowed by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2782 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2783 | "$P_CLI key_file=$DATA_FILES_PATH/cli-rsa.key crt_file=$DATA_FILES_PATH/cli-rsa-sha256.crt" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2784 | 0 |
| 2785 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2786 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2787 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2788 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2789 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2790 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2791 | 0 \ |
| 2792 | -c "next record in same datagram" \ |
| 2793 | -s "next record in same datagram" |
| 2794 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2795 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2796 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2797 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2798 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2799 | 0 \ |
| 2800 | -s "next record in same datagram" \ |
| 2801 | -C "next record in same datagram" |
| 2802 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2804 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2805 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2806 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2807 | 0 \ |
| 2808 | -S "next record in same datagram" \ |
| 2809 | -c "next record in same datagram" |
| 2810 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2811 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2812 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2813 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2814 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2815 | 0 \ |
| 2816 | -S "next record in same datagram" \ |
| 2817 | -C "next record in same datagram" |
| 2818 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2819 | # Tests for Context serialization |
| 2820 | |
| 2821 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2822 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2823 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2824 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2825 | 0 \ |
| 2826 | -c "Deserializing connection..." \ |
| 2827 | -S "Deserializing connection..." |
| 2828 | |
| 2829 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2830 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2831 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2832 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2833 | 0 \ |
| 2834 | -c "Deserializing connection..." \ |
| 2835 | -S "Deserializing connection..." |
| 2836 | |
| 2837 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2838 | run_test "Context serialization, client serializes, GCM" \ |
| 2839 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2840 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2841 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2842 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2843 | -S "Deserializing connection..." |
| 2844 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2845 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2846 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2847 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2848 | run_test "Context serialization, client serializes, with CID" \ |
| 2849 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2850 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2851 | 0 \ |
| 2852 | -c "Deserializing connection..." \ |
| 2853 | -S "Deserializing connection..." |
| 2854 | |
| 2855 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2856 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2857 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2858 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2859 | 0 \ |
| 2860 | -C "Deserializing connection..." \ |
| 2861 | -s "Deserializing connection..." |
| 2862 | |
| 2863 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2864 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2865 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2866 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2867 | 0 \ |
| 2868 | -C "Deserializing connection..." \ |
| 2869 | -s "Deserializing connection..." |
| 2870 | |
| 2871 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2872 | run_test "Context serialization, server serializes, GCM" \ |
| 2873 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2874 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2875 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2876 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2877 | -s "Deserializing connection..." |
| 2878 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2879 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2880 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2881 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2882 | run_test "Context serialization, server serializes, with CID" \ |
| 2883 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2884 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2885 | 0 \ |
| 2886 | -C "Deserializing connection..." \ |
| 2887 | -s "Deserializing connection..." |
| 2888 | |
| 2889 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2890 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2891 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2892 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2893 | 0 \ |
| 2894 | -c "Deserializing connection..." \ |
| 2895 | -s "Deserializing connection..." |
| 2896 | |
| 2897 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2898 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2899 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2900 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2901 | 0 \ |
| 2902 | -c "Deserializing connection..." \ |
| 2903 | -s "Deserializing connection..." |
| 2904 | |
| 2905 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2906 | run_test "Context serialization, both serialize, GCM" \ |
| 2907 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2908 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2909 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2910 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2911 | -s "Deserializing connection..." |
| 2912 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2913 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2914 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2915 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2916 | run_test "Context serialization, both serialize, with CID" \ |
| 2917 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2918 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2919 | 0 \ |
| 2920 | -c "Deserializing connection..." \ |
| 2921 | -s "Deserializing connection..." |
| 2922 | |
| 2923 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2924 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2925 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2926 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2927 | 0 \ |
| 2928 | -c "Deserializing connection..." \ |
| 2929 | -S "Deserializing connection..." |
| 2930 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2931 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2932 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2933 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2934 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2935 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2936 | 0 \ |
| 2937 | -c "Deserializing connection..." \ |
| 2938 | -S "Deserializing connection..." |
| 2939 | |
| 2940 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2941 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2942 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2943 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2944 | 0 \ |
| 2945 | -c "Deserializing connection..." \ |
| 2946 | -S "Deserializing connection..." |
| 2947 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2948 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2949 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2950 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2951 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2952 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2953 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2954 | 0 \ |
| 2955 | -c "Deserializing connection..." \ |
| 2956 | -S "Deserializing connection..." |
| 2957 | |
| 2958 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2959 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2960 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2961 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2962 | 0 \ |
| 2963 | -C "Deserializing connection..." \ |
| 2964 | -s "Deserializing connection..." |
| 2965 | |
| 2966 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2967 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2968 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2969 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2970 | 0 \ |
| 2971 | -C "Deserializing connection..." \ |
| 2972 | -s "Deserializing connection..." |
| 2973 | |
| 2974 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2975 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2976 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2977 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2978 | 0 \ |
| 2979 | -C "Deserializing connection..." \ |
| 2980 | -s "Deserializing connection..." |
| 2981 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2982 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2983 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2984 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2985 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2986 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2987 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2988 | 0 \ |
| 2989 | -C "Deserializing connection..." \ |
| 2990 | -s "Deserializing connection..." |
| 2991 | |
| 2992 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2993 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2994 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2995 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2996 | 0 \ |
| 2997 | -c "Deserializing connection..." \ |
| 2998 | -s "Deserializing connection..." |
| 2999 | |
| 3000 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3001 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 3002 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3003 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 3004 | 0 \ |
| 3005 | -c "Deserializing connection..." \ |
| 3006 | -s "Deserializing connection..." |
| 3007 | |
| 3008 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3009 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 3010 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3011 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 3012 | 0 \ |
| 3013 | -c "Deserializing connection..." \ |
| 3014 | -s "Deserializing connection..." |
| 3015 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 3017 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3018 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3019 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 3020 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 3021 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 3022 | 0 \ |
| 3023 | -c "Deserializing connection..." \ |
| 3024 | -s "Deserializing connection..." |
| 3025 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3026 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 3027 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3028 | run_test "Saving the serialized context to a file" \ |
| 3029 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 3030 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 3031 | 0 \ |
| 3032 | -s "Save serialized context to a file... ok" \ |
| 3033 | -c "Save serialized context to a file... ok" |
| 3034 | rm -f context_srv.txt |
| 3035 | rm -f context_cli.txt |
| 3036 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3037 | # Tests for DTLS Connection ID extension |
| 3038 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3039 | # So far, the CID API isn't implemented, so we can't |
| 3040 | # grep for output witnessing its use. This needs to be |
| 3041 | # changed once the CID extension is implemented. |
| 3042 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3043 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3044 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3045 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3046 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 3047 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3048 | 0 \ |
| 3049 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3050 | -s "found CID extension" \ |
| 3051 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3052 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3053 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3054 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3055 | -C "found CID extension" \ |
| 3056 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3057 | -C "Copy CIDs into SSL transform" \ |
| 3058 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3059 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3060 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3061 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3062 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3063 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3064 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 3065 | 0 \ |
| 3066 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3067 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3068 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3069 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3070 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3071 | -C "found CID extension" \ |
| 3072 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3073 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 3074 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3075 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3076 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3077 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3078 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3079 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3080 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 3081 | 0 \ |
| 3082 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3083 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3084 | -c "client hello, adding CID extension" \ |
| 3085 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3086 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3087 | -s "server hello, adding CID extension" \ |
| 3088 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3089 | -c "Use of CID extension negotiated" \ |
| 3090 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3091 | -c "Copy CIDs into SSL transform" \ |
| 3092 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3093 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3094 | -s "Use of Connection ID has been negotiated" \ |
| 3095 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3096 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3097 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3098 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3099 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3100 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3101 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 3102 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 3103 | 0 \ |
| 3104 | -c "Enable use of CID extension." \ |
| 3105 | -s "Enable use of CID extension." \ |
| 3106 | -c "client hello, adding CID extension" \ |
| 3107 | -s "found CID extension" \ |
| 3108 | -s "Use of CID extension negotiated" \ |
| 3109 | -s "server hello, adding CID extension" \ |
| 3110 | -c "found CID extension" \ |
| 3111 | -c "Use of CID extension negotiated" \ |
| 3112 | -s "Copy CIDs into SSL transform" \ |
| 3113 | -c "Copy CIDs into SSL transform" \ |
| 3114 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3115 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3116 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3117 | -c "Use of Connection ID has been negotiated" \ |
| 3118 | -c "ignoring unexpected CID" \ |
| 3119 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3120 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3121 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3122 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3123 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 3124 | -p "$P_PXY mtu=800" \ |
| 3125 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3126 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3127 | 0 \ |
| 3128 | -c "Enable use of CID extension." \ |
| 3129 | -s "Enable use of CID extension." \ |
| 3130 | -c "client hello, adding CID extension" \ |
| 3131 | -s "found CID extension" \ |
| 3132 | -s "Use of CID extension negotiated" \ |
| 3133 | -s "server hello, adding CID extension" \ |
| 3134 | -c "found CID extension" \ |
| 3135 | -c "Use of CID extension negotiated" \ |
| 3136 | -s "Copy CIDs into SSL transform" \ |
| 3137 | -c "Copy CIDs into SSL transform" \ |
| 3138 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3139 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3140 | -s "Use of Connection ID has been negotiated" \ |
| 3141 | -c "Use of Connection ID has been negotiated" |
| 3142 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3143 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3144 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3145 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3146 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3147 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3148 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3149 | 0 \ |
| 3150 | -c "Enable use of CID extension." \ |
| 3151 | -s "Enable use of CID extension." \ |
| 3152 | -c "client hello, adding CID extension" \ |
| 3153 | -s "found CID extension" \ |
| 3154 | -s "Use of CID extension negotiated" \ |
| 3155 | -s "server hello, adding CID extension" \ |
| 3156 | -c "found CID extension" \ |
| 3157 | -c "Use of CID extension negotiated" \ |
| 3158 | -s "Copy CIDs into SSL transform" \ |
| 3159 | -c "Copy CIDs into SSL transform" \ |
| 3160 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3161 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3162 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3163 | -c "Use of Connection ID has been negotiated" \ |
| 3164 | -c "ignoring unexpected CID" \ |
| 3165 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3166 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3167 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3168 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3169 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3170 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3171 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3172 | 0 \ |
| 3173 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3174 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3175 | -c "client hello, adding CID extension" \ |
| 3176 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3177 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3178 | -s "server hello, adding CID extension" \ |
| 3179 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3180 | -c "Use of CID extension negotiated" \ |
| 3181 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3182 | -c "Copy CIDs into SSL transform" \ |
| 3183 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3184 | -s "Peer CID (length 0 Bytes):" \ |
| 3185 | -s "Use of Connection ID has been negotiated" \ |
| 3186 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3187 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3188 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3189 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3190 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3191 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3192 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3193 | 0 \ |
| 3194 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3195 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3196 | -c "client hello, adding CID extension" \ |
| 3197 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3198 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3199 | -s "server hello, adding CID extension" \ |
| 3200 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3201 | -c "Use of CID extension negotiated" \ |
| 3202 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3203 | -c "Copy CIDs into SSL transform" \ |
| 3204 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3205 | -c "Peer CID (length 0 Bytes):" \ |
| 3206 | -s "Use of Connection ID has been negotiated" \ |
| 3207 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3208 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3209 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3210 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3211 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3212 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3213 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3214 | 0 \ |
| 3215 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3216 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3217 | -c "client hello, adding CID extension" \ |
| 3218 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3219 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3220 | -s "server hello, adding CID extension" \ |
| 3221 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3222 | -c "Use of CID extension negotiated" \ |
| 3223 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3224 | -c "Copy CIDs into SSL transform" \ |
| 3225 | -S "Use of Connection ID has been negotiated" \ |
| 3226 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3227 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3228 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3229 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3230 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3231 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3232 | 0 \ |
| 3233 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3234 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3235 | -c "client hello, adding CID extension" \ |
| 3236 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3237 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3238 | -s "server hello, adding CID extension" \ |
| 3239 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3240 | -c "Use of CID extension negotiated" \ |
| 3241 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3242 | -c "Copy CIDs into SSL transform" \ |
| 3243 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3244 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3245 | -s "Use of Connection ID has been negotiated" \ |
| 3246 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3247 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3248 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3249 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3250 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3251 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3252 | 0 \ |
| 3253 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3254 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3255 | -c "client hello, adding CID extension" \ |
| 3256 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3257 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3258 | -s "server hello, adding CID extension" \ |
| 3259 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3260 | -c "Use of CID extension negotiated" \ |
| 3261 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3262 | -c "Copy CIDs into SSL transform" \ |
| 3263 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3264 | -s "Peer CID (length 0 Bytes):" \ |
| 3265 | -s "Use of Connection ID has been negotiated" \ |
| 3266 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3267 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3268 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3269 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3270 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3271 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3272 | 0 \ |
| 3273 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3274 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3275 | -c "client hello, adding CID extension" \ |
| 3276 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3277 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3278 | -s "server hello, adding CID extension" \ |
| 3279 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3280 | -c "Use of CID extension negotiated" \ |
| 3281 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3282 | -c "Copy CIDs into SSL transform" \ |
| 3283 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3284 | -c "Peer CID (length 0 Bytes):" \ |
| 3285 | -s "Use of Connection ID has been negotiated" \ |
| 3286 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3287 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3288 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3289 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3290 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3291 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3292 | 0 \ |
| 3293 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3294 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3295 | -c "client hello, adding CID extension" \ |
| 3296 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3297 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3298 | -s "server hello, adding CID extension" \ |
| 3299 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3300 | -c "Use of CID extension negotiated" \ |
| 3301 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3302 | -c "Copy CIDs into SSL transform" \ |
| 3303 | -S "Use of Connection ID has been negotiated" \ |
| 3304 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3305 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3306 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3307 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3308 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3309 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3310 | 0 \ |
| 3311 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3312 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3313 | -c "client hello, adding CID extension" \ |
| 3314 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3315 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3316 | -s "server hello, adding CID extension" \ |
| 3317 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3318 | -c "Use of CID extension negotiated" \ |
| 3319 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3320 | -c "Copy CIDs into SSL transform" \ |
| 3321 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3322 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3323 | -s "Use of Connection ID has been negotiated" \ |
| 3324 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3325 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3326 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3327 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3328 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3329 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3330 | 0 \ |
| 3331 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3332 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3333 | -c "client hello, adding CID extension" \ |
| 3334 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3335 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3336 | -s "server hello, adding CID extension" \ |
| 3337 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3338 | -c "Use of CID extension negotiated" \ |
| 3339 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3340 | -c "Copy CIDs into SSL transform" \ |
| 3341 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3342 | -s "Peer CID (length 0 Bytes):" \ |
| 3343 | -s "Use of Connection ID has been negotiated" \ |
| 3344 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3345 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3346 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3347 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3348 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3349 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3350 | 0 \ |
| 3351 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3352 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3353 | -c "client hello, adding CID extension" \ |
| 3354 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3355 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3356 | -s "server hello, adding CID extension" \ |
| 3357 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3358 | -c "Use of CID extension negotiated" \ |
| 3359 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3360 | -c "Copy CIDs into SSL transform" \ |
| 3361 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3362 | -c "Peer CID (length 0 Bytes):" \ |
| 3363 | -s "Use of Connection ID has been negotiated" \ |
| 3364 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3365 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3366 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3367 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3368 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3369 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3370 | 0 \ |
| 3371 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3372 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3373 | -c "client hello, adding CID extension" \ |
| 3374 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3375 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3376 | -s "server hello, adding CID extension" \ |
| 3377 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3378 | -c "Use of CID extension negotiated" \ |
| 3379 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3380 | -c "Copy CIDs into SSL transform" \ |
| 3381 | -S "Use of Connection ID has been negotiated" \ |
| 3382 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3383 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3384 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3385 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3386 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3387 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3388 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3389 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3390 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3391 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3392 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3393 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3394 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3395 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3396 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3397 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3398 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3399 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3400 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3401 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3402 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3403 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3404 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3405 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3406 | 0 \ |
| 3407 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3408 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3409 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3410 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3411 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3412 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3413 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3414 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3415 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3416 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3417 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3418 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3419 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 3420 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3421 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3422 | 0 \ |
| 3423 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3424 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3425 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3426 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3427 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3428 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3429 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3430 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3431 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3432 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3433 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3434 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3435 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3436 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3437 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3438 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3439 | 0 \ |
| 3440 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3441 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3442 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3443 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3444 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3445 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3446 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3447 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3448 | -c "ignoring unexpected CID" \ |
| 3449 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3450 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3451 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3452 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3453 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3454 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3455 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3456 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3457 | 0 \ |
| 3458 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3459 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3460 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3461 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3462 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3463 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3464 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3465 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3466 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3467 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3468 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3469 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3470 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 3471 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3472 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3473 | 0 \ |
| 3474 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3475 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3476 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3477 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3478 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3479 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3480 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3481 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3482 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3483 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3484 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3485 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3486 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3487 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3488 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3489 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3490 | 0 \ |
| 3491 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3492 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3493 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3494 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3495 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3496 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3497 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3498 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3499 | -c "ignoring unexpected CID" \ |
| 3500 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3501 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3502 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3503 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3504 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3505 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3506 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3507 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3508 | 0 \ |
| 3509 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3510 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3511 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3512 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3513 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3514 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3515 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3516 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3517 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3518 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3519 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 3520 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3521 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3522 | 0 \ |
| 3523 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3524 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3525 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3526 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3527 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3528 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3529 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3530 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3531 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3532 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3533 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3534 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3535 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3536 | "$P_CLI debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3537 | 0 \ |
| 3538 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3539 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3540 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3541 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3542 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3543 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3544 | -c "ignoring unexpected CID" \ |
| 3545 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3546 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3547 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3548 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3549 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3550 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3551 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3552 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3553 | 0 \ |
| 3554 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3555 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3556 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3557 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3558 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3559 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3560 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3561 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3562 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 3563 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3565 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3566 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3567 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3568 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3569 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3570 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3571 | 0 \ |
| 3572 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3573 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3574 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3575 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3576 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3577 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3578 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3579 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3580 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 3581 | -c "ignoring unexpected CID" \ |
| 3582 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3583 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3584 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3585 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3586 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3587 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 3588 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3589 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3590 | 0 \ |
| 3591 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3592 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3593 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3594 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3595 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3596 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3597 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3598 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3599 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 3600 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3601 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3602 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3603 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3604 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3605 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3606 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3607 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3608 | 0 \ |
| 3609 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3610 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3611 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3612 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3613 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3614 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3615 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3616 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3617 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 3618 | -c "ignoring unexpected CID" \ |
| 3619 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3620 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3621 | # This and the test below it require MAX_CONTENT_LEN to be at least MFL+1, because the |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3622 | # tests check that the buffer contents are reallocated when the message is |
| 3623 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3624 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3625 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3626 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3627 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 3628 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3629 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 3630 | 0 \ |
| 3631 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3632 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3633 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3634 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3635 | -s "Reallocating in_buf" \ |
| 3636 | -s "Reallocating out_buf" |
| 3637 | |
| 3638 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3639 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3640 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3641 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 3642 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3643 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 3644 | 0 \ |
| 3645 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3646 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3647 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3648 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3649 | -s "Reallocating in_buf" \ |
| 3650 | -s "Reallocating out_buf" |
| 3651 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3652 | # Tests for Encrypt-then-MAC extension |
| 3653 | |
| 3654 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3655 | "$P_SRV debug_level=3 \ |
| 3656 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3657 | "$P_CLI debug_level=3" \ |
| 3658 | 0 \ |
| 3659 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3660 | -s "found encrypt then mac extension" \ |
| 3661 | -s "server hello, adding encrypt then mac extension" \ |
| 3662 | -c "found encrypt_then_mac extension" \ |
| 3663 | -c "using encrypt then mac" \ |
| 3664 | -s "using encrypt then mac" |
| 3665 | |
| 3666 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3667 | "$P_SRV debug_level=3 etm=0 \ |
| 3668 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3669 | "$P_CLI debug_level=3 etm=1" \ |
| 3670 | 0 \ |
| 3671 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3672 | -s "found encrypt then mac extension" \ |
| 3673 | -S "server hello, adding encrypt then mac extension" \ |
| 3674 | -C "found encrypt_then_mac extension" \ |
| 3675 | -C "using encrypt then mac" \ |
| 3676 | -S "using encrypt then mac" |
| 3677 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3678 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3679 | "$P_SRV debug_level=3 etm=1 \ |
| 3680 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3681 | "$P_CLI debug_level=3 etm=1" \ |
| 3682 | 0 \ |
| 3683 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3684 | -s "found encrypt then mac extension" \ |
| 3685 | -S "server hello, adding encrypt then mac extension" \ |
| 3686 | -C "found encrypt_then_mac extension" \ |
| 3687 | -C "using encrypt then mac" \ |
| 3688 | -S "using encrypt then mac" |
| 3689 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3690 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3691 | "$P_SRV debug_level=3 etm=1 \ |
| 3692 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3693 | "$P_CLI debug_level=3 etm=0" \ |
| 3694 | 0 \ |
| 3695 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3696 | -S "found encrypt then mac extension" \ |
| 3697 | -S "server hello, adding encrypt then mac extension" \ |
| 3698 | -C "found encrypt_then_mac extension" \ |
| 3699 | -C "using encrypt then mac" \ |
| 3700 | -S "using encrypt then mac" |
| 3701 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3702 | # Tests for Extended Master Secret extension |
| 3703 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3704 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3705 | run_test "Extended Master Secret: default" \ |
| 3706 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3707 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3708 | 0 \ |
| 3709 | -c "client hello, adding extended_master_secret extension" \ |
| 3710 | -s "found extended master secret extension" \ |
| 3711 | -s "server hello, adding extended master secret extension" \ |
| 3712 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3713 | -c "session hash for extended master secret" \ |
| 3714 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3715 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3716 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3717 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3718 | "$P_SRV debug_level=3 extended_ms=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3719 | "$P_CLI force_version=tls12 debug_level=3 extended_ms=1" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3720 | 0 \ |
| 3721 | -c "client hello, adding extended_master_secret extension" \ |
| 3722 | -s "found extended master secret extension" \ |
| 3723 | -S "server hello, adding extended master secret extension" \ |
| 3724 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3725 | -C "session hash for extended master secret" \ |
| 3726 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3727 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3728 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3729 | run_test "Extended Master Secret: client disabled, server enabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3730 | "$P_SRV force_version=tls12 debug_level=3 extended_ms=1" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3731 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3732 | 0 \ |
| 3733 | -C "client hello, adding extended_master_secret extension" \ |
| 3734 | -S "found extended master secret extension" \ |
| 3735 | -S "server hello, adding extended master secret extension" \ |
| 3736 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3737 | -C "session hash for extended master secret" \ |
| 3738 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3739 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3740 | # Test sending and receiving empty application data records |
| 3741 | |
| 3742 | run_test "Encrypt then MAC: empty application data record" \ |
| 3743 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3744 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3745 | 0 \ |
| 3746 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3747 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3748 | -c "0 bytes written in 1 fragments" |
| 3749 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3750 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3751 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3752 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3753 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3754 | 0 \ |
| 3755 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3756 | -c "0 bytes written in 1 fragments" |
| 3757 | |
| 3758 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3759 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3760 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3761 | 0 \ |
| 3762 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3763 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3764 | -c "0 bytes written in 1 fragments" |
| 3765 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3766 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3767 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3768 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3769 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3770 | 0 \ |
| 3771 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3772 | -c "0 bytes written in 1 fragments" |
| 3773 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3774 | # Tests for CBC 1/n-1 record splitting |
| 3775 | |
| 3776 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3777 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3778 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3779 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3780 | 0 \ |
| 3781 | -s "Read from client: 123 bytes read" \ |
| 3782 | -S "Read from client: 1 bytes read" \ |
| 3783 | -S "122 bytes read" |
| 3784 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3785 | # Tests for Session Tickets |
| 3786 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3787 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3788 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3789 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3790 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3791 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3792 | -c "client hello, adding session ticket extension" \ |
| 3793 | -s "found session ticket extension" \ |
| 3794 | -s "server hello, adding session ticket extension" \ |
| 3795 | -c "found session_ticket extension" \ |
| 3796 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3797 | -S "session successfully restored from cache" \ |
| 3798 | -s "session successfully restored from ticket" \ |
| 3799 | -s "a session has been resumed" \ |
| 3800 | -c "a session has been resumed" |
| 3801 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3802 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3803 | run_test "Session resume using tickets: manual rotation" \ |
| 3804 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3805 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3806 | 0 \ |
| 3807 | -c "client hello, adding session ticket extension" \ |
| 3808 | -s "found session ticket extension" \ |
| 3809 | -s "server hello, adding session ticket extension" \ |
| 3810 | -c "found session_ticket extension" \ |
| 3811 | -c "parse new session ticket" \ |
| 3812 | -S "session successfully restored from cache" \ |
| 3813 | -s "session successfully restored from ticket" \ |
| 3814 | -s "a session has been resumed" \ |
| 3815 | -c "a session has been resumed" |
| 3816 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3817 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3818 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3819 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3820 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3821 | 0 \ |
| 3822 | -c "client hello, adding session ticket extension" \ |
| 3823 | -s "found session ticket extension" \ |
| 3824 | -s "server hello, adding session ticket extension" \ |
| 3825 | -c "found session_ticket extension" \ |
| 3826 | -c "parse new session ticket" \ |
| 3827 | -S "session successfully restored from cache" \ |
| 3828 | -s "session successfully restored from ticket" \ |
| 3829 | -s "a session has been resumed" \ |
| 3830 | -c "a session has been resumed" |
| 3831 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3832 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3833 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3834 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3835 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1 reco_delay=2000" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3836 | 0 \ |
| 3837 | -c "client hello, adding session ticket extension" \ |
| 3838 | -s "found session ticket extension" \ |
| 3839 | -s "server hello, adding session ticket extension" \ |
| 3840 | -c "found session_ticket extension" \ |
| 3841 | -c "parse new session ticket" \ |
| 3842 | -S "session successfully restored from cache" \ |
| 3843 | -S "session successfully restored from ticket" \ |
| 3844 | -S "a session has been resumed" \ |
| 3845 | -C "a session has been resumed" |
| 3846 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3847 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3848 | run_test "Session resume using tickets: session copy" \ |
| 3849 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3850 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3851 | 0 \ |
| 3852 | -c "client hello, adding session ticket extension" \ |
| 3853 | -s "found session ticket extension" \ |
| 3854 | -s "server hello, adding session ticket extension" \ |
| 3855 | -c "found session_ticket extension" \ |
| 3856 | -c "parse new session ticket" \ |
| 3857 | -S "session successfully restored from cache" \ |
| 3858 | -s "session successfully restored from ticket" \ |
| 3859 | -s "a session has been resumed" \ |
| 3860 | -c "a session has been resumed" |
| 3861 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3862 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3863 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3864 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3865 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3866 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3867 | 0 \ |
| 3868 | -c "client hello, adding session ticket extension" \ |
| 3869 | -c "found session_ticket extension" \ |
| 3870 | -c "parse new session ticket" \ |
| 3871 | -c "a session has been resumed" |
| 3872 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3874 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3875 | run_test "Session resume using tickets: openssl client" \ |
Gilles Peskine | 01fde2c | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 3876 | "$P_SRV force_version=tls12 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3877 | "( $O_CLI -sess_out $SESSION; \ |
| 3878 | $O_CLI -sess_in $SESSION; \ |
| 3879 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3880 | 0 \ |
| 3881 | -s "found session ticket extension" \ |
| 3882 | -s "server hello, adding session ticket extension" \ |
| 3883 | -S "session successfully restored from cache" \ |
| 3884 | -s "session successfully restored from ticket" \ |
| 3885 | -s "a session has been resumed" |
| 3886 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3887 | requires_cipher_enabled "AES" "GCM" |
Norbert Fabritius | 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-GCM" \ |
| 3890 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3891 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3892 | 0 \ |
| 3893 | -c "client hello, adding session ticket extension" \ |
| 3894 | -s "found session ticket extension" \ |
| 3895 | -s "server hello, adding session ticket extension" \ |
| 3896 | -c "found session_ticket extension" \ |
| 3897 | -c "parse new session ticket" \ |
| 3898 | -S "session successfully restored from cache" \ |
| 3899 | -s "session successfully restored from ticket" \ |
| 3900 | -s "a session has been resumed" \ |
| 3901 | -c "a session has been resumed" |
| 3902 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3903 | requires_cipher_enabled "AES" "GCM" |
Norbert Fabritius | 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-GCM" \ |
| 3906 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3907 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3908 | 0 \ |
| 3909 | -c "client hello, adding session ticket extension" \ |
| 3910 | -s "found session ticket extension" \ |
| 3911 | -s "server hello, adding session ticket extension" \ |
| 3912 | -c "found session_ticket extension" \ |
| 3913 | -c "parse new session ticket" \ |
| 3914 | -S "session successfully restored from cache" \ |
| 3915 | -s "session successfully restored from ticket" \ |
| 3916 | -s "a session has been resumed" \ |
| 3917 | -c "a session has been resumed" |
| 3918 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3919 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | 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-128-CCM" \ |
| 3922 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3923 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3924 | 0 \ |
| 3925 | -c "client hello, adding session ticket extension" \ |
| 3926 | -s "found session ticket extension" \ |
| 3927 | -s "server hello, adding session ticket extension" \ |
| 3928 | -c "found session_ticket extension" \ |
| 3929 | -c "parse new session ticket" \ |
| 3930 | -S "session successfully restored from cache" \ |
| 3931 | -s "session successfully restored from ticket" \ |
| 3932 | -s "a session has been resumed" \ |
| 3933 | -c "a session has been resumed" |
| 3934 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3935 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | 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: AES-192-CCM" \ |
| 3938 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3939 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3940 | 0 \ |
| 3941 | -c "client hello, adding session ticket extension" \ |
| 3942 | -s "found session ticket extension" \ |
| 3943 | -s "server hello, adding session ticket extension" \ |
| 3944 | -c "found session_ticket extension" \ |
| 3945 | -c "parse new session ticket" \ |
| 3946 | -S "session successfully restored from cache" \ |
| 3947 | -s "session successfully restored from ticket" \ |
| 3948 | -s "a session has been resumed" \ |
| 3949 | -c "a session has been resumed" |
| 3950 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3951 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | 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: AES-256-CCM" \ |
| 3954 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3955 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3956 | 0 \ |
| 3957 | -c "client hello, adding session ticket extension" \ |
| 3958 | -s "found session ticket extension" \ |
| 3959 | -s "server hello, adding session ticket extension" \ |
| 3960 | -c "found session_ticket extension" \ |
| 3961 | -c "parse new session ticket" \ |
| 3962 | -S "session successfully restored from cache" \ |
| 3963 | -s "session successfully restored from ticket" \ |
| 3964 | -s "a session has been resumed" \ |
| 3965 | -c "a session has been resumed" |
| 3966 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3967 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | 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-128-CCM" \ |
| 3970 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3971 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3972 | 0 \ |
| 3973 | -c "client hello, adding session ticket extension" \ |
| 3974 | -s "found session ticket extension" \ |
| 3975 | -s "server hello, adding session ticket extension" \ |
| 3976 | -c "found session_ticket extension" \ |
| 3977 | -c "parse new session ticket" \ |
| 3978 | -S "session successfully restored from cache" \ |
| 3979 | -s "session successfully restored from ticket" \ |
| 3980 | -s "a session has been resumed" \ |
| 3981 | -c "a session has been resumed" |
| 3982 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3983 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | 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: CAMELLIA-192-CCM" \ |
| 3986 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3987 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3988 | 0 \ |
| 3989 | -c "client hello, adding session ticket extension" \ |
| 3990 | -s "found session ticket extension" \ |
| 3991 | -s "server hello, adding session ticket extension" \ |
| 3992 | -c "found session_ticket extension" \ |
| 3993 | -c "parse new session ticket" \ |
| 3994 | -S "session successfully restored from cache" \ |
| 3995 | -s "session successfully restored from ticket" \ |
| 3996 | -s "a session has been resumed" \ |
| 3997 | -c "a session has been resumed" |
| 3998 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3999 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | 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: CAMELLIA-256-CCM" \ |
| 4002 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4003 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4004 | 0 \ |
| 4005 | -c "client hello, adding session ticket extension" \ |
| 4006 | -s "found session ticket extension" \ |
| 4007 | -s "server hello, adding session ticket extension" \ |
| 4008 | -c "found session_ticket extension" \ |
| 4009 | -c "parse new session ticket" \ |
| 4010 | -S "session successfully restored from cache" \ |
| 4011 | -s "session successfully restored from ticket" \ |
| 4012 | -s "a session has been resumed" \ |
| 4013 | -c "a session has been resumed" |
| 4014 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4015 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | 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-128-GCM" \ |
| 4018 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4019 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4020 | 0 \ |
| 4021 | -c "client hello, adding session ticket extension" \ |
| 4022 | -s "found session ticket extension" \ |
| 4023 | -s "server hello, adding session ticket extension" \ |
| 4024 | -c "found session_ticket extension" \ |
| 4025 | -c "parse new session ticket" \ |
| 4026 | -S "session successfully restored from cache" \ |
| 4027 | -s "session successfully restored from ticket" \ |
| 4028 | -s "a session has been resumed" \ |
| 4029 | -c "a session has been resumed" |
| 4030 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4031 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | 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-192-GCM" \ |
| 4034 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4035 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4036 | 0 \ |
| 4037 | -c "client hello, adding session ticket extension" \ |
| 4038 | -s "found session ticket extension" \ |
| 4039 | -s "server hello, adding session ticket extension" \ |
| 4040 | -c "found session_ticket extension" \ |
| 4041 | -c "parse new session ticket" \ |
| 4042 | -S "session successfully restored from cache" \ |
| 4043 | -s "session successfully restored from ticket" \ |
| 4044 | -s "a session has been resumed" \ |
| 4045 | -c "a session has been resumed" |
| 4046 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4047 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | 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-256-GCM" \ |
| 4050 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4051 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4052 | 0 \ |
| 4053 | -c "client hello, adding session ticket extension" \ |
| 4054 | -s "found session ticket extension" \ |
| 4055 | -s "server hello, adding session ticket extension" \ |
| 4056 | -c "found session_ticket extension" \ |
| 4057 | -c "parse new session ticket" \ |
| 4058 | -S "session successfully restored from cache" \ |
| 4059 | -s "session successfully restored from ticket" \ |
| 4060 | -s "a session has been resumed" \ |
| 4061 | -c "a session has been resumed" |
| 4062 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4063 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | 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-128-CCM" \ |
| 4066 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4067 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4068 | 0 \ |
| 4069 | -c "client hello, adding session ticket extension" \ |
| 4070 | -s "found session ticket extension" \ |
| 4071 | -s "server hello, adding session ticket extension" \ |
| 4072 | -c "found session_ticket extension" \ |
| 4073 | -c "parse new session ticket" \ |
| 4074 | -S "session successfully restored from cache" \ |
| 4075 | -s "session successfully restored from ticket" \ |
| 4076 | -s "a session has been resumed" \ |
| 4077 | -c "a session has been resumed" |
| 4078 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4079 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4080 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4081 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 4082 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4083 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4084 | 0 \ |
| 4085 | -c "client hello, adding session ticket extension" \ |
| 4086 | -s "found session ticket extension" \ |
| 4087 | -s "server hello, adding session ticket extension" \ |
| 4088 | -c "found session_ticket extension" \ |
| 4089 | -c "parse new session ticket" \ |
| 4090 | -S "session successfully restored from cache" \ |
| 4091 | -s "session successfully restored from ticket" \ |
| 4092 | -s "a session has been resumed" \ |
| 4093 | -c "a session has been resumed" |
| 4094 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4095 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4096 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4097 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 4098 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4099 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4100 | 0 \ |
| 4101 | -c "client hello, adding session ticket extension" \ |
| 4102 | -s "found session ticket extension" \ |
| 4103 | -s "server hello, adding session ticket extension" \ |
| 4104 | -c "found session_ticket extension" \ |
| 4105 | -c "parse new session ticket" \ |
| 4106 | -S "session successfully restored from cache" \ |
| 4107 | -s "session successfully restored from ticket" \ |
| 4108 | -s "a session has been resumed" \ |
| 4109 | -c "a session has been resumed" |
| 4110 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4111 | requires_cipher_enabled "CHACHA20" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4112 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4113 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 4114 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4115 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4116 | 0 \ |
| 4117 | -c "client hello, adding session ticket extension" \ |
| 4118 | -s "found session ticket extension" \ |
| 4119 | -s "server hello, adding session ticket extension" \ |
| 4120 | -c "found session_ticket extension" \ |
| 4121 | -c "parse new session ticket" \ |
| 4122 | -S "session successfully restored from cache" \ |
| 4123 | -s "session successfully restored from ticket" \ |
| 4124 | -s "a session has been resumed" \ |
| 4125 | -c "a session has been resumed" |
| 4126 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4127 | # Tests for Session Tickets with DTLS |
| 4128 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4129 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 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: basic" \ |
| 4132 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4133 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4134 | 0 \ |
| 4135 | -c "client hello, adding session ticket extension" \ |
| 4136 | -s "found session ticket extension" \ |
| 4137 | -s "server hello, adding session ticket extension" \ |
| 4138 | -c "found session_ticket extension" \ |
| 4139 | -c "parse new session ticket" \ |
| 4140 | -S "session successfully restored from cache" \ |
| 4141 | -s "session successfully restored from ticket" \ |
| 4142 | -s "a session has been resumed" \ |
| 4143 | -c "a session has been resumed" |
| 4144 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4145 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4146 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4147 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 4148 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4149 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4150 | 0 \ |
| 4151 | -c "client hello, adding session ticket extension" \ |
| 4152 | -s "found session ticket extension" \ |
| 4153 | -s "server hello, adding session ticket extension" \ |
| 4154 | -c "found session_ticket extension" \ |
| 4155 | -c "parse new session ticket" \ |
| 4156 | -S "session successfully restored from cache" \ |
| 4157 | -s "session successfully restored from ticket" \ |
| 4158 | -s "a session has been resumed" \ |
| 4159 | -c "a session has been resumed" |
| 4160 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4161 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4162 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4163 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 4164 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4165 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1 reco_delay=2000" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4166 | 0 \ |
| 4167 | -c "client hello, adding session ticket extension" \ |
| 4168 | -s "found session ticket extension" \ |
| 4169 | -s "server hello, adding session ticket extension" \ |
| 4170 | -c "found session_ticket extension" \ |
| 4171 | -c "parse new session ticket" \ |
| 4172 | -S "session successfully restored from cache" \ |
| 4173 | -S "session successfully restored from ticket" \ |
| 4174 | -S "a session has been resumed" \ |
| 4175 | -C "a session has been resumed" |
| 4176 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4177 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4178 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4179 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 4180 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4181 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1 reco_mode=0" \ |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4182 | 0 \ |
| 4183 | -c "client hello, adding session ticket extension" \ |
| 4184 | -s "found session ticket extension" \ |
| 4185 | -s "server hello, adding session ticket extension" \ |
| 4186 | -c "found session_ticket extension" \ |
| 4187 | -c "parse new session ticket" \ |
| 4188 | -S "session successfully restored from cache" \ |
| 4189 | -s "session successfully restored from ticket" \ |
| 4190 | -s "a session has been resumed" \ |
| 4191 | -c "a session has been resumed" |
| 4192 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4193 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4194 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4195 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 4196 | "$O_SRV -dtls" \ |
| 4197 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 4198 | 0 \ |
| 4199 | -c "client hello, adding session ticket extension" \ |
| 4200 | -c "found session_ticket extension" \ |
| 4201 | -c "parse new session ticket" \ |
| 4202 | -c "a session has been resumed" |
| 4203 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4204 | # For reasons that aren't fully understood, this test randomly fails with high |
Paul Elliott | 09cfa18 | 2021-10-13 16:13:44 +0100 | [diff] [blame] | 4205 | # probability with OpenSSL 1.0.2g on the CI, see #5012. |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4206 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4207 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4208 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4209 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 4210 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4211 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4212 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4213 | rm -f $SESSION )" \ |
| 4214 | 0 \ |
| 4215 | -s "found session ticket extension" \ |
| 4216 | -s "server hello, adding session ticket extension" \ |
| 4217 | -S "session successfully restored from cache" \ |
| 4218 | -s "session successfully restored from ticket" \ |
| 4219 | -s "a session has been resumed" |
| 4220 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4221 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4222 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4223 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4224 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4225 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4226 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4227 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4228 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4229 | -c "client hello, adding session ticket extension" \ |
| 4230 | -s "found session ticket extension" \ |
| 4231 | -S "server hello, adding session ticket extension" \ |
| 4232 | -C "found session_ticket extension" \ |
| 4233 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4234 | -s "session successfully restored from cache" \ |
| 4235 | -S "session successfully restored from ticket" \ |
| 4236 | -s "a session has been resumed" \ |
| 4237 | -c "a session has been resumed" |
| 4238 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4239 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4240 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4241 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4242 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4243 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4244 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4245 | -C "client hello, adding session ticket extension" \ |
| 4246 | -S "found session ticket extension" \ |
| 4247 | -S "server hello, adding session ticket extension" \ |
| 4248 | -C "found session_ticket extension" \ |
| 4249 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4250 | -s "session successfully restored from cache" \ |
| 4251 | -S "session successfully restored from ticket" \ |
| 4252 | -s "a session has been resumed" \ |
| 4253 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4254 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4255 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4256 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4257 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4258 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4259 | 0 \ |
| 4260 | -S "session successfully restored from cache" \ |
| 4261 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4262 | -S "a session has been resumed" \ |
| 4263 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4264 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4265 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4266 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4267 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4268 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4269 | 0 \ |
| 4270 | -s "session successfully restored from cache" \ |
| 4271 | -S "session successfully restored from ticket" \ |
| 4272 | -s "a session has been resumed" \ |
| 4273 | -c "a session has been resumed" |
| 4274 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4275 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4276 | run_test "Session resume using cache: cache removed" \ |
| 4277 | "$P_SRV debug_level=3 tickets=0 cache_remove=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4278 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4279 | 0 \ |
| 4280 | -C "client hello, adding session ticket extension" \ |
| 4281 | -S "found session ticket extension" \ |
| 4282 | -S "server hello, adding session ticket extension" \ |
| 4283 | -C "found session_ticket extension" \ |
| 4284 | -C "parse new session ticket" \ |
| 4285 | -S "session successfully restored from cache" \ |
| 4286 | -S "session successfully restored from ticket" \ |
| 4287 | -S "a session has been resumed" \ |
| 4288 | -C "a session has been resumed" |
| 4289 | |
| 4290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4291 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 4292 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4293 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4294 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4295 | 0 \ |
| 4296 | -s "session successfully restored from cache" \ |
| 4297 | -S "session successfully restored from ticket" \ |
| 4298 | -s "a session has been resumed" \ |
| 4299 | -c "a session has been resumed" |
| 4300 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4301 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4302 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4303 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4304 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1 reco_delay=2000" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4305 | 0 \ |
| 4306 | -S "session successfully restored from cache" \ |
| 4307 | -S "session successfully restored from ticket" \ |
| 4308 | -S "a session has been resumed" \ |
| 4309 | -C "a session has been resumed" |
| 4310 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4311 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4312 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4313 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4314 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1 reco_delay=2000" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4315 | 0 \ |
| 4316 | -s "session successfully restored from cache" \ |
| 4317 | -S "session successfully restored from ticket" \ |
| 4318 | -s "a session has been resumed" \ |
| 4319 | -c "a session has been resumed" |
| 4320 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4321 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4322 | run_test "Session resume using cache: session copy" \ |
| 4323 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4324 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4325 | 0 \ |
| 4326 | -s "session successfully restored from cache" \ |
| 4327 | -S "session successfully restored from ticket" \ |
| 4328 | -s "a session has been resumed" \ |
| 4329 | -c "a session has been resumed" |
| 4330 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4331 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4332 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4333 | run_test "Session resume using cache: openssl client" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4334 | "$P_SRV force_version=tls12 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 4335 | "( $O_CLI -sess_out $SESSION; \ |
| 4336 | $O_CLI -sess_in $SESSION; \ |
| 4337 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4338 | 0 \ |
| 4339 | -s "found session ticket extension" \ |
| 4340 | -S "server hello, adding session ticket extension" \ |
| 4341 | -s "session successfully restored from cache" \ |
| 4342 | -S "session successfully restored from ticket" \ |
| 4343 | -s "a session has been resumed" |
| 4344 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4345 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4346 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4347 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4348 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4349 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4350 | 0 \ |
| 4351 | -C "found session_ticket extension" \ |
| 4352 | -C "parse new session ticket" \ |
| 4353 | -c "a session has been resumed" |
| 4354 | |
Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 4355 | # Tests for Session resume and extensions |
| 4356 | |
| 4357 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4358 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 4359 | run_test "Session resume and connection ID" \ |
| 4360 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 4361 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 4362 | 0 \ |
| 4363 | -c "Enable use of CID extension." \ |
| 4364 | -s "Enable use of CID extension." \ |
| 4365 | -c "client hello, adding CID extension" \ |
| 4366 | -s "found CID extension" \ |
| 4367 | -s "Use of CID extension negotiated" \ |
| 4368 | -s "server hello, adding CID extension" \ |
| 4369 | -c "found CID extension" \ |
| 4370 | -c "Use of CID extension negotiated" \ |
| 4371 | -s "Copy CIDs into SSL transform" \ |
| 4372 | -c "Copy CIDs into SSL transform" \ |
| 4373 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 4374 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 4375 | -s "Use of Connection ID has been negotiated" \ |
| 4376 | -c "Use of Connection ID has been negotiated" |
| 4377 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4378 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 4379 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4380 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4381 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4382 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4383 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 4384 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4385 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4386 | 0 \ |
| 4387 | -c "client hello, adding session ticket extension" \ |
| 4388 | -s "found session ticket extension" \ |
| 4389 | -S "server hello, adding session ticket extension" \ |
| 4390 | -C "found session_ticket extension" \ |
| 4391 | -C "parse new session ticket" \ |
| 4392 | -s "session successfully restored from cache" \ |
| 4393 | -S "session successfully restored from ticket" \ |
| 4394 | -s "a session has been resumed" \ |
| 4395 | -c "a session has been resumed" |
| 4396 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4397 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4398 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4399 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4400 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 4401 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4402 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4403 | 0 \ |
| 4404 | -C "client hello, adding session ticket extension" \ |
| 4405 | -S "found session ticket extension" \ |
| 4406 | -S "server hello, adding session ticket extension" \ |
| 4407 | -C "found session_ticket extension" \ |
| 4408 | -C "parse new session ticket" \ |
| 4409 | -s "session successfully restored from cache" \ |
| 4410 | -S "session successfully restored from ticket" \ |
| 4411 | -s "a session has been resumed" \ |
| 4412 | -c "a session has been resumed" |
| 4413 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4414 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4415 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4416 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 4417 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4418 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4419 | 0 \ |
| 4420 | -S "session successfully restored from cache" \ |
| 4421 | -S "session successfully restored from ticket" \ |
| 4422 | -S "a session has been resumed" \ |
| 4423 | -C "a session has been resumed" |
| 4424 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4425 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4426 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4427 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 4428 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4429 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4430 | 0 \ |
| 4431 | -s "session successfully restored from cache" \ |
| 4432 | -S "session successfully restored from ticket" \ |
| 4433 | -s "a session has been resumed" \ |
| 4434 | -c "a session has been resumed" |
| 4435 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4436 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4437 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4438 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 4439 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4440 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=0" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4441 | 0 \ |
| 4442 | -s "session successfully restored from cache" \ |
| 4443 | -S "session successfully restored from ticket" \ |
| 4444 | -s "a session has been resumed" \ |
| 4445 | -c "a session has been resumed" |
| 4446 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4447 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4448 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4449 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 4450 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4451 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=2000" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4452 | 0 \ |
| 4453 | -S "session successfully restored from cache" \ |
| 4454 | -S "session successfully restored from ticket" \ |
| 4455 | -S "a session has been resumed" \ |
| 4456 | -C "a session has been resumed" |
| 4457 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4458 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4459 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4460 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 4461 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4462 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=2000" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4463 | 0 \ |
| 4464 | -s "session successfully restored from cache" \ |
| 4465 | -S "session successfully restored from ticket" \ |
| 4466 | -s "a session has been resumed" \ |
| 4467 | -c "a session has been resumed" |
| 4468 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4469 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4470 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4471 | run_test "Session resume using cache, DTLS: session copy" \ |
| 4472 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4473 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_mode=0" \ |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4474 | 0 \ |
| 4475 | -s "session successfully restored from cache" \ |
| 4476 | -S "session successfully restored from ticket" \ |
| 4477 | -s "a session has been resumed" \ |
| 4478 | -c "a session has been resumed" |
| 4479 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4480 | # For reasons that aren't fully understood, this test randomly fails with high |
Paul Elliott | 09cfa18 | 2021-10-13 16:13:44 +0100 | [diff] [blame] | 4481 | # probability with OpenSSL 1.0.2g on the CI, see #5012. |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4482 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4483 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4484 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4485 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4486 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 4487 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4488 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4489 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4490 | rm -f $SESSION )" \ |
| 4491 | 0 \ |
| 4492 | -s "found session ticket extension" \ |
| 4493 | -S "server hello, adding session ticket extension" \ |
| 4494 | -s "session successfully restored from cache" \ |
| 4495 | -S "session successfully restored from ticket" \ |
| 4496 | -s "a session has been resumed" |
| 4497 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4498 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4499 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4500 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 4501 | "$O_SRV -dtls" \ |
| 4502 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 4503 | 0 \ |
| 4504 | -C "found session_ticket extension" \ |
| 4505 | -C "parse new session ticket" \ |
| 4506 | -c "a session has been resumed" |
| 4507 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4508 | # Tests for Max Fragment Length extension |
| 4509 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4510 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4511 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4512 | run_test "Max fragment length: enabled, default" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4513 | "$P_SRV debug_level=3 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4514 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4515 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4516 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4517 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4518 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4519 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4520 | -C "client hello, adding max_fragment_length extension" \ |
| 4521 | -S "found max fragment length extension" \ |
| 4522 | -S "server hello, max_fragment_length extension" \ |
| 4523 | -C "found max_fragment_length extension" |
| 4524 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4525 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4527 | run_test "Max fragment length: enabled, default, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4528 | "$P_SRV debug_level=3 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4529 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4530 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4531 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4532 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4533 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4534 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4535 | -C "client hello, adding max_fragment_length extension" \ |
| 4536 | -S "found max fragment length extension" \ |
| 4537 | -S "server hello, max_fragment_length extension" \ |
| 4538 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4539 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4540 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4541 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4542 | |
| 4543 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4545 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 4546 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4547 | "$P_CLI debug_level=3 dtls=1 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4548 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4549 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4550 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4551 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4552 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4553 | -C "client hello, adding max_fragment_length extension" \ |
| 4554 | -S "found max fragment length extension" \ |
| 4555 | -S "server hello, max_fragment_length extension" \ |
| 4556 | -C "found max_fragment_length extension" \ |
| 4557 | -c "fragment larger than.*maximum " |
| 4558 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4559 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 4560 | # (session fragment length will be 16384 regardless of mbedtls |
| 4561 | # content length configuration.) |
| 4562 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4563 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4565 | run_test "Max fragment length: disabled, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4566 | "$P_SRV debug_level=3 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4567 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4568 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4569 | -C "Maximum incoming record payload length is 16384" \ |
| 4570 | -C "Maximum outgoing record payload length is 16384" \ |
| 4571 | -S "Maximum incoming record payload length is 16384" \ |
| 4572 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4573 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4574 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4575 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4576 | |
| 4577 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4578 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4579 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4580 | "$P_SRV debug_level=3 dtls=1 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4581 | "$P_CLI debug_level=3 dtls=1 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4582 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4583 | -C "Maximum incoming record payload length is 16384" \ |
| 4584 | -C "Maximum outgoing record payload length is 16384" \ |
| 4585 | -S "Maximum incoming record payload length is 16384" \ |
| 4586 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4587 | -c "fragment larger than.*maximum " |
| 4588 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4589 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4590 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4591 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4592 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4593 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4594 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4595 | -c "Maximum incoming record payload length is 4096" \ |
| 4596 | -c "Maximum outgoing record payload length is 4096" \ |
| 4597 | -s "Maximum incoming record payload length is 4096" \ |
| 4598 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4599 | -c "client hello, adding max_fragment_length extension" \ |
| 4600 | -s "found max fragment length extension" \ |
| 4601 | -s "server hello, max_fragment_length extension" \ |
| 4602 | -c "found max_fragment_length extension" |
| 4603 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4604 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4605 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4606 | run_test "Max fragment length: client 512, server 1024" \ |
| 4607 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4608 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4609 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4610 | -c "Maximum incoming record payload length is 512" \ |
| 4611 | -c "Maximum outgoing record payload length is 512" \ |
| 4612 | -s "Maximum incoming record payload length is 512" \ |
| 4613 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4614 | -c "client hello, adding max_fragment_length extension" \ |
| 4615 | -s "found max fragment length extension" \ |
| 4616 | -s "server hello, max_fragment_length extension" \ |
| 4617 | -c "found max_fragment_length extension" |
| 4618 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4619 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4620 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4621 | run_test "Max fragment length: client 512, server 2048" \ |
| 4622 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4623 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4624 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4625 | -c "Maximum incoming record payload length is 512" \ |
| 4626 | -c "Maximum outgoing record payload length is 512" \ |
| 4627 | -s "Maximum incoming record payload length is 512" \ |
| 4628 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4629 | -c "client hello, adding max_fragment_length extension" \ |
| 4630 | -s "found max fragment length extension" \ |
| 4631 | -s "server hello, max_fragment_length extension" \ |
| 4632 | -c "found max_fragment_length extension" |
| 4633 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4634 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4635 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4636 | run_test "Max fragment length: client 512, server 4096" \ |
| 4637 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4638 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4639 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4640 | -c "Maximum incoming record payload length is 512" \ |
| 4641 | -c "Maximum outgoing record payload length is 512" \ |
| 4642 | -s "Maximum incoming record payload length is 512" \ |
| 4643 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4644 | -c "client hello, adding max_fragment_length extension" \ |
| 4645 | -s "found max fragment length extension" \ |
| 4646 | -s "server hello, max_fragment_length extension" \ |
| 4647 | -c "found max_fragment_length extension" |
| 4648 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4649 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4650 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4651 | run_test "Max fragment length: client 1024, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4652 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4653 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4654 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4655 | -c "Maximum incoming record payload length is 1024" \ |
| 4656 | -c "Maximum outgoing record payload length is 1024" \ |
| 4657 | -s "Maximum incoming record payload length is 1024" \ |
| 4658 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4659 | -c "client hello, adding max_fragment_length extension" \ |
| 4660 | -s "found max fragment length extension" \ |
| 4661 | -s "server hello, max_fragment_length extension" \ |
| 4662 | -c "found max_fragment_length extension" |
| 4663 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4664 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4665 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4666 | run_test "Max fragment length: client 1024, server 2048" \ |
| 4667 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4668 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4669 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4670 | -c "Maximum incoming record payload length is 1024" \ |
| 4671 | -c "Maximum outgoing record payload length is 1024" \ |
| 4672 | -s "Maximum incoming record payload length is 1024" \ |
| 4673 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4674 | -c "client hello, adding max_fragment_length extension" \ |
| 4675 | -s "found max fragment length extension" \ |
| 4676 | -s "server hello, max_fragment_length extension" \ |
| 4677 | -c "found max_fragment_length extension" |
| 4678 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4679 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4680 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4681 | run_test "Max fragment length: client 1024, server 4096" \ |
| 4682 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4683 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4684 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4685 | -c "Maximum incoming record payload length is 1024" \ |
| 4686 | -c "Maximum outgoing record payload length is 1024" \ |
| 4687 | -s "Maximum incoming record payload length is 1024" \ |
| 4688 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4689 | -c "client hello, adding max_fragment_length extension" \ |
| 4690 | -s "found max fragment length extension" \ |
| 4691 | -s "server hello, max_fragment_length extension" \ |
| 4692 | -c "found max_fragment_length extension" |
| 4693 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4694 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4695 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4696 | run_test "Max fragment length: client 2048, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4697 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4698 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4699 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4700 | -c "Maximum incoming record payload length is 2048" \ |
| 4701 | -c "Maximum outgoing record payload length is 2048" \ |
| 4702 | -s "Maximum incoming record payload length is 2048" \ |
| 4703 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4704 | -c "client hello, adding max_fragment_length extension" \ |
| 4705 | -s "found max fragment length extension" \ |
| 4706 | -s "server hello, max_fragment_length extension" \ |
| 4707 | -c "found max_fragment_length extension" |
| 4708 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4709 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4710 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4711 | run_test "Max fragment length: client 2048, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4712 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4713 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4714 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4715 | -c "Maximum incoming record payload length is 2048" \ |
| 4716 | -c "Maximum outgoing record payload length is 2048" \ |
| 4717 | -s "Maximum incoming record payload length is 2048" \ |
| 4718 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4719 | -c "client hello, adding max_fragment_length extension" \ |
| 4720 | -s "found max fragment length extension" \ |
| 4721 | -s "server hello, max_fragment_length extension" \ |
| 4722 | -c "found max_fragment_length extension" |
| 4723 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4724 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4725 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4726 | run_test "Max fragment length: client 2048, server 4096" \ |
| 4727 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4728 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4729 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4730 | -c "Maximum incoming record payload length is 2048" \ |
| 4731 | -c "Maximum outgoing record payload length is 2048" \ |
| 4732 | -s "Maximum incoming record payload length is 2048" \ |
| 4733 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4734 | -c "client hello, adding max_fragment_length extension" \ |
| 4735 | -s "found max fragment length extension" \ |
| 4736 | -s "server hello, max_fragment_length extension" \ |
| 4737 | -c "found max_fragment_length extension" |
| 4738 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4739 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4740 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4741 | run_test "Max fragment length: client 4096, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4742 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4743 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4744 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4745 | -c "Maximum incoming record payload length is 4096" \ |
| 4746 | -c "Maximum outgoing record payload length is 4096" \ |
| 4747 | -s "Maximum incoming record payload length is 4096" \ |
| 4748 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4749 | -c "client hello, adding max_fragment_length extension" \ |
| 4750 | -s "found max fragment length extension" \ |
| 4751 | -s "server hello, max_fragment_length extension" \ |
| 4752 | -c "found max_fragment_length extension" |
| 4753 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4754 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4755 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4756 | run_test "Max fragment length: client 4096, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4757 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4758 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4759 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4760 | -c "Maximum incoming record payload length is 4096" \ |
| 4761 | -c "Maximum outgoing record payload length is 4096" \ |
| 4762 | -s "Maximum incoming record payload length is 4096" \ |
| 4763 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4764 | -c "client hello, adding max_fragment_length extension" \ |
| 4765 | -s "found max fragment length extension" \ |
| 4766 | -s "server hello, max_fragment_length extension" \ |
| 4767 | -c "found max_fragment_length extension" |
| 4768 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4769 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4770 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4771 | run_test "Max fragment length: client 4096, server 2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4772 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4773 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4774 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4775 | -c "Maximum incoming record payload length is 4096" \ |
| 4776 | -c "Maximum outgoing record payload length is 4096" \ |
| 4777 | -s "Maximum incoming record payload length is 4096" \ |
| 4778 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4779 | -c "client hello, adding max_fragment_length extension" \ |
| 4780 | -s "found max fragment length extension" \ |
| 4781 | -s "server hello, max_fragment_length extension" \ |
| 4782 | -c "found max_fragment_length extension" |
| 4783 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4784 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4785 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4786 | run_test "Max fragment length: used by server" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4787 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4788 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4789 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4790 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4791 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4792 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4793 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4794 | -C "client hello, adding max_fragment_length extension" \ |
| 4795 | -S "found max fragment length extension" \ |
| 4796 | -S "server hello, max_fragment_length extension" \ |
| 4797 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4798 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4799 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4800 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4801 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4802 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4803 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4804 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4805 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4806 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4807 | -c "Maximum incoming record payload length is 4096" \ |
| 4808 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4809 | -c "client hello, adding max_fragment_length extension" \ |
| 4810 | -c "found max_fragment_length extension" |
| 4811 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4812 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4813 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4814 | run_test "Max fragment length: client, message just fits" \ |
| 4815 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4816 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048 request_size=2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4817 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4818 | -c "Maximum incoming record payload length is 2048" \ |
| 4819 | -c "Maximum outgoing record payload length is 2048" \ |
| 4820 | -s "Maximum incoming record payload length is 2048" \ |
| 4821 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4822 | -c "client hello, adding max_fragment_length extension" \ |
| 4823 | -s "found max fragment length extension" \ |
| 4824 | -s "server hello, max_fragment_length extension" \ |
| 4825 | -c "found max_fragment_length extension" \ |
| 4826 | -c "2048 bytes written in 1 fragments" \ |
| 4827 | -s "2048 bytes read" |
| 4828 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4829 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4830 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4831 | run_test "Max fragment length: client, larger message" \ |
| 4832 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4833 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048 request_size=2345" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4834 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4835 | -c "Maximum incoming record payload length is 2048" \ |
| 4836 | -c "Maximum outgoing record payload length is 2048" \ |
| 4837 | -s "Maximum incoming record payload length is 2048" \ |
| 4838 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4839 | -c "client hello, adding max_fragment_length extension" \ |
| 4840 | -s "found max fragment length extension" \ |
| 4841 | -s "server hello, max_fragment_length extension" \ |
| 4842 | -c "found max_fragment_length extension" \ |
| 4843 | -c "2345 bytes written in 2 fragments" \ |
| 4844 | -s "2048 bytes read" \ |
| 4845 | -s "297 bytes read" |
| 4846 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4847 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4848 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4849 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4850 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4851 | "$P_SRV debug_level=3 dtls=1" \ |
| 4852 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4853 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4854 | -c "Maximum incoming record payload length is 2048" \ |
| 4855 | -c "Maximum outgoing record payload length is 2048" \ |
| 4856 | -s "Maximum incoming record payload length is 2048" \ |
| 4857 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4858 | -c "client hello, adding max_fragment_length extension" \ |
| 4859 | -s "found max fragment length extension" \ |
| 4860 | -s "server hello, max_fragment_length extension" \ |
| 4861 | -c "found max_fragment_length extension" \ |
| 4862 | -c "fragment larger than.*maximum" |
| 4863 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4864 | # Tests for Record Size Limit extension |
| 4865 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4866 | requires_gnutls_tls1_3 |
| 4867 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4868 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4869 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4870 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4871 | run_test "Record Size Limit: TLS 1.3: Server-side parsing and debug output" \ |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4872 | "$P_SRV debug_level=3 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4873 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4874 | 0 \ |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4875 | -s "RecordSizeLimit: 16385 Bytes" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4876 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4877 | -s "Maximum outgoing record payload length is 16383" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4878 | -s "bytes written in 1 fragments" |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4879 | |
| 4880 | requires_gnutls_tls1_3 |
| 4881 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4882 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4883 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4884 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4885 | run_test "Record Size Limit: TLS 1.3: Client-side parsing and debug output" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4886 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL --disable-client-cert -d 4" \ |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4887 | "$P_CLI debug_level=4 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4888 | 0 \ |
Yanray Wang | 42017cd | 2023-11-08 11:15:23 +0800 | [diff] [blame] | 4889 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 4890 | -c "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 4891 | -c "EncryptedExtensions: record_size_limit(28) extension received." \ |
Yanray Wang | 42017cd | 2023-11-08 11:15:23 +0800 | [diff] [blame] | 4892 | -c "RecordSizeLimit: 16385 Bytes" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4893 | |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 4894 | # In the following tests, --recordsize is the value used by the G_NEXT_CLI (3.7.2) to configure the |
| 4895 | # maximum record size using gnutls_record_set_max_size() |
| 4896 | # (https://gnutls.org/reference/gnutls-gnutls.html#gnutls-record-set-max-size). |
| 4897 | # There is currently a lower limit of 512, caused by gnutls_record_set_max_size() |
| 4898 | # not respecting the "%ALLOW_SMALL_RECORDS" priority string and not using the |
| 4899 | # more recent function gnutls_record_set_max_recv_size() |
| 4900 | # (https://gnutls.org/reference/gnutls-gnutls.html#gnutls-record-set-max-recv-size). |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4901 | # There is currently an upper limit of 4096, caused by the cli arg parser: |
| 4902 | # https://gitlab.com/gnutls/gnutls/-/blob/3.7.2/src/cli-args.def#L395. |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 4903 | # Thus, these tests are currently limited to the value range 512-4096. |
| 4904 | # Also, the value sent in the extension will be one larger than the value |
| 4905 | # set at the command line: |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4906 | # https://gitlab.com/gnutls/gnutls/-/blob/3.7.2/lib/ext/record_size_limit.c#L142 |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4907 | |
| 4908 | # Currently test certificates being used do not fit in 513 record size limit |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4909 | # so for 513 record size limit tests we use preshared key to avoid sending |
| 4910 | # the certificate. |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4911 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4912 | requires_gnutls_tls1_3 |
| 4913 | requires_gnutls_record_size_limit |
| 4914 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
| 4915 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4916 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4917 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 1 fragment" \ |
| 4918 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4919 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4920 | response_size=256" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4921 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4922 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4923 | 0 \ |
| 4924 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4925 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4926 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4927 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4928 | -s "Maximum outgoing record payload length is 511" \ |
| 4929 | -s "256 bytes written in 1 fragments" |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4930 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4931 | requires_gnutls_tls1_3 |
| 4932 | requires_gnutls_record_size_limit |
| 4933 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
| 4934 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4935 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4936 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 2 fragments" \ |
| 4937 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4938 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4939 | response_size=768" \ |
| 4940 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4941 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
| 4942 | 0 \ |
| 4943 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4944 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4945 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4946 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4947 | -s "Maximum outgoing record payload length is 511" \ |
| 4948 | -s "768 bytes written in 2 fragments" |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4949 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4950 | requires_gnutls_tls1_3 |
| 4951 | requires_gnutls_record_size_limit |
| 4952 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
| 4953 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4954 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4955 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 3 fragments" \ |
| 4956 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4957 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4958 | response_size=1280" \ |
| 4959 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4960 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
| 4961 | 0 \ |
| 4962 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4963 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4964 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4965 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4966 | -s "Maximum outgoing record payload length is 511" \ |
| 4967 | -s "1280 bytes written in 3 fragments" |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4968 | |
| 4969 | requires_gnutls_tls1_3 |
| 4970 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4971 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4972 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4973 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4974 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 1 fragment" \ |
| 4975 | "$P_SRV debug_level=3 force_version=tls13 response_size=512" \ |
| 4976 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 4977 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4978 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 4979 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 4980 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4981 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4982 | -s "Maximum outgoing record payload length is 1023" \ |
| 4983 | -s "512 bytes written in 1 fragments" |
| 4984 | |
| 4985 | requires_gnutls_tls1_3 |
| 4986 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4987 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4988 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4989 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4990 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 2 fragments" \ |
| 4991 | "$P_SRV debug_level=3 force_version=tls13 response_size=1536" \ |
| 4992 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 4993 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4994 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 4995 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 4996 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4997 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4998 | -s "Maximum outgoing record payload length is 1023" \ |
| 4999 | -s "1536 bytes written in 2 fragments" |
| 5000 | |
| 5001 | requires_gnutls_tls1_3 |
| 5002 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5003 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5004 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5005 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5006 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 3 fragments" \ |
| 5007 | "$P_SRV debug_level=3 force_version=tls13 response_size=2560" \ |
| 5008 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 5009 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5010 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 5011 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5012 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5013 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5014 | -s "Maximum outgoing record payload length is 1023" \ |
| 5015 | -s "2560 bytes written in 3 fragments" |
| 5016 | |
| 5017 | requires_gnutls_tls1_3 |
| 5018 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5019 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5020 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5021 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5022 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 1 fragment" \ |
| 5023 | "$P_SRV debug_level=3 force_version=tls13 response_size=2048" \ |
| 5024 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5025 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5026 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5027 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5028 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5029 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5030 | -s "Maximum outgoing record payload length is 4095" \ |
| 5031 | -s "2048 bytes written in 1 fragments" |
| 5032 | |
| 5033 | requires_gnutls_tls1_3 |
| 5034 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5035 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5036 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5037 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5038 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 2 fragments" \ |
| 5039 | "$P_SRV debug_level=3 force_version=tls13 response_size=6144" \ |
| 5040 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5041 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5042 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5043 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5044 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5045 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5046 | -s "Maximum outgoing record payload length is 4095" \ |
| 5047 | -s "6144 bytes written in 2 fragments" |
| 5048 | |
| 5049 | requires_gnutls_tls1_3 |
| 5050 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5051 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5052 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5053 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5054 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 3 fragments" \ |
| 5055 | "$P_SRV debug_level=3 force_version=tls13 response_size=10240" \ |
| 5056 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5057 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5058 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5059 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5060 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5061 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5062 | -s "Maximum outgoing record payload length is 4095" \ |
| 5063 | -s "10240 bytes written in 3 fragments" |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 5064 | |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5065 | requires_gnutls_tls1_3 |
| 5066 | requires_gnutls_record_size_limit |
| 5067 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5068 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5069 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5070 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 1 fragment" \ |
| 5071 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5072 | "$P_CLI debug_level=4 force_version=tls13 request_size=256" \ |
| 5073 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5074 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5075 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5076 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5077 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5078 | -c "Maximum outgoing record payload length is 511" \ |
| 5079 | -c "256 bytes written in 1 fragments" |
| 5080 | |
| 5081 | requires_gnutls_tls1_3 |
| 5082 | requires_gnutls_record_size_limit |
| 5083 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5084 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5085 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5086 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 2 fragments" \ |
| 5087 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5088 | "$P_CLI debug_level=4 force_version=tls13 request_size=768" \ |
| 5089 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5090 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5091 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5092 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5093 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5094 | -c "Maximum outgoing record payload length is 511" \ |
| 5095 | -c "768 bytes written in 2 fragments" |
| 5096 | |
| 5097 | requires_gnutls_tls1_3 |
| 5098 | requires_gnutls_record_size_limit |
| 5099 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5100 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5101 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5102 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 3 fragments" \ |
| 5103 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5104 | "$P_CLI debug_level=4 force_version=tls13 request_size=1280" \ |
| 5105 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5106 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5107 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5108 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5109 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5110 | -c "Maximum outgoing record payload length is 511" \ |
| 5111 | -c "1280 bytes written in 3 fragments" |
| 5112 | |
| 5113 | requires_gnutls_tls1_3 |
| 5114 | requires_gnutls_record_size_limit |
| 5115 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5116 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5117 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5118 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 1 fragment" \ |
| 5119 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5120 | "$P_CLI debug_level=4 force_version=tls13 request_size=512" \ |
| 5121 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5122 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5123 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5124 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5125 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5126 | -c "Maximum outgoing record payload length is 1023" \ |
| 5127 | -c "512 bytes written in 1 fragments" |
| 5128 | |
| 5129 | requires_gnutls_tls1_3 |
| 5130 | requires_gnutls_record_size_limit |
| 5131 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5132 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5133 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5134 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 2 fragments" \ |
| 5135 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5136 | "$P_CLI debug_level=4 force_version=tls13 request_size=1536" \ |
| 5137 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5138 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5139 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5140 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5141 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5142 | -c "Maximum outgoing record payload length is 1023" \ |
| 5143 | -c "1536 bytes written in 2 fragments" |
| 5144 | |
| 5145 | requires_gnutls_tls1_3 |
| 5146 | requires_gnutls_record_size_limit |
| 5147 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5148 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5149 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5150 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 3 fragments" \ |
| 5151 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5152 | "$P_CLI debug_level=4 force_version=tls13 request_size=2560" \ |
| 5153 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5154 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5155 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5156 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5157 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5158 | -c "Maximum outgoing record payload length is 1023" \ |
| 5159 | -c "2560 bytes written in 3 fragments" |
| 5160 | |
| 5161 | requires_gnutls_tls1_3 |
| 5162 | requires_gnutls_record_size_limit |
| 5163 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5164 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5165 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5166 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 1 fragment" \ |
| 5167 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5168 | "$P_CLI debug_level=4 force_version=tls13 request_size=2048" \ |
| 5169 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5170 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5171 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5172 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5173 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5174 | -c "Maximum outgoing record payload length is 4095" \ |
| 5175 | -c "2048 bytes written in 1 fragments" |
| 5176 | |
| 5177 | requires_gnutls_tls1_3 |
| 5178 | requires_gnutls_record_size_limit |
| 5179 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5180 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5181 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5182 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 2 fragments" \ |
| 5183 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5184 | "$P_CLI debug_level=4 force_version=tls13 request_size=6144" \ |
| 5185 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5186 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5187 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5188 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5189 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5190 | -c "Maximum outgoing record payload length is 4095" \ |
| 5191 | -c "6144 bytes written in 2 fragments" |
| 5192 | |
| 5193 | requires_gnutls_tls1_3 |
| 5194 | requires_gnutls_record_size_limit |
| 5195 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5196 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5197 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5198 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 3 fragments" \ |
| 5199 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5200 | "$P_CLI debug_level=4 force_version=tls13 request_size=10240" \ |
| 5201 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5202 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5203 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5204 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5205 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5206 | -c "Maximum outgoing record payload length is 4095" \ |
| 5207 | -c "10240 bytes written in 3 fragments" |
| 5208 | |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5209 | # TODO: For time being, we send fixed value of RecordSizeLimit defined by |
| 5210 | # MBEDTLS_SSL_IN_CONTENT_LEN. Once we support variable buffer length of |
| 5211 | # RecordSizeLimit, we need to modify value of RecordSizeLimit in below test. |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5212 | requires_config_value_equals "MBEDTLS_SSL_IN_CONTENT_LEN" 16384 |
| 5213 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5214 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5215 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5216 | run_test "Record Size Limit: TLS 1.3 m->m: both peer comply with record size limit (default)" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5217 | "$P_SRV debug_level=4 force_version=tls13" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5218 | "$P_CLI debug_level=4" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5219 | 0 \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5220 | -c "Sent RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5221 | -c "RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5222 | -s "RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5223 | -s "Sent RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5224 | -s "Maximum outgoing record payload length is 16383" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5225 | -s "Maximum incoming record payload length is 16384" |
| 5226 | |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 5227 | # End of Record size limit tests |
| 5228 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5229 | # Tests for renegotiation |
| 5230 | |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5231 | # G_NEXT_SRV is used in renegotiation tests becuase of the increased |
| 5232 | # extensions limit since we exceed the limit in G_SRV when we send |
| 5233 | # TLS 1.3 extensions in the initial handshake. |
| 5234 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5235 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5236 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5237 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5238 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5239 | 0 \ |
| 5240 | -C "client hello, adding renegotiation extension" \ |
| 5241 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5242 | -S "found renegotiation extension" \ |
| 5243 | -s "server hello, secure renegotiation extension" \ |
| 5244 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5245 | -C "=> renegotiate" \ |
| 5246 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5247 | -S "write hello request" |
| 5248 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5249 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5250 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5251 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5252 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5253 | 0 \ |
| 5254 | -c "client hello, adding renegotiation extension" \ |
| 5255 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5256 | -s "found renegotiation extension" \ |
| 5257 | -s "server hello, secure renegotiation extension" \ |
| 5258 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5259 | -c "=> renegotiate" \ |
| 5260 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5261 | -S "write hello request" |
| 5262 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5263 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5264 | run_test "Renegotiation: server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5265 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5266 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5267 | 0 \ |
| 5268 | -c "client hello, adding renegotiation extension" \ |
| 5269 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5270 | -s "found renegotiation extension" \ |
| 5271 | -s "server hello, secure renegotiation extension" \ |
| 5272 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5273 | -c "=> renegotiate" \ |
| 5274 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5275 | -s "write hello request" |
| 5276 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5277 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 5278 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 5279 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5280 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5281 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 5282 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5283 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5284 | 0 \ |
| 5285 | -c "client hello, adding renegotiation extension" \ |
| 5286 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5287 | -s "found renegotiation extension" \ |
| 5288 | -s "server hello, secure renegotiation extension" \ |
| 5289 | -c "found renegotiation extension" \ |
| 5290 | -c "=> renegotiate" \ |
| 5291 | -s "=> renegotiate" \ |
| 5292 | -S "write hello request" \ |
| 5293 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 5294 | |
| 5295 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 5296 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 5297 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5298 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5299 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5300 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5301 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 5302 | 0 \ |
| 5303 | -c "client hello, adding renegotiation extension" \ |
| 5304 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5305 | -s "found renegotiation extension" \ |
| 5306 | -s "server hello, secure renegotiation extension" \ |
| 5307 | -c "found renegotiation extension" \ |
| 5308 | -c "=> renegotiate" \ |
| 5309 | -s "=> renegotiate" \ |
| 5310 | -s "write hello request" \ |
| 5311 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 5312 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5313 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5314 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5315 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5316 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5317 | 0 \ |
| 5318 | -c "client hello, adding renegotiation extension" \ |
| 5319 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5320 | -s "found renegotiation extension" \ |
| 5321 | -s "server hello, secure renegotiation extension" \ |
| 5322 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5323 | -c "=> renegotiate" \ |
| 5324 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5325 | -s "write hello request" |
| 5326 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5327 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5328 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 5329 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5330 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5331 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5332 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 max_frag_len=2048 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 5333 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 5334 | -c "Maximum incoming record payload length is 2048" \ |
| 5335 | -c "Maximum outgoing record payload length is 2048" \ |
| 5336 | -s "Maximum incoming record payload length is 2048" \ |
| 5337 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5338 | -c "client hello, adding max_fragment_length extension" \ |
| 5339 | -s "found max fragment length extension" \ |
| 5340 | -s "server hello, max_fragment_length extension" \ |
| 5341 | -c "found max_fragment_length extension" \ |
| 5342 | -c "client hello, adding renegotiation extension" \ |
| 5343 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5344 | -s "found renegotiation extension" \ |
| 5345 | -s "server hello, secure renegotiation extension" \ |
| 5346 | -c "found renegotiation extension" \ |
| 5347 | -c "=> renegotiate" \ |
| 5348 | -s "=> renegotiate" \ |
| 5349 | -s "write hello request" |
| 5350 | |
| 5351 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5352 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5353 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5354 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5355 | 1 \ |
| 5356 | -c "client hello, adding renegotiation extension" \ |
| 5357 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5358 | -S "found renegotiation extension" \ |
| 5359 | -s "server hello, secure renegotiation extension" \ |
| 5360 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5361 | -c "=> renegotiate" \ |
| 5362 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5363 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 5364 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5365 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5366 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5367 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5368 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5369 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5370 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5371 | 0 \ |
| 5372 | -C "client hello, adding renegotiation extension" \ |
| 5373 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5374 | -S "found renegotiation extension" \ |
| 5375 | -s "server hello, secure renegotiation extension" \ |
| 5376 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5377 | -C "=> renegotiate" \ |
| 5378 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5379 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 5380 | -S "SSL - An unexpected message was received from our peer" \ |
| 5381 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5382 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5383 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5384 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5385 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5386 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5387 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5388 | 0 \ |
| 5389 | -C "client hello, adding renegotiation extension" \ |
| 5390 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5391 | -S "found renegotiation extension" \ |
| 5392 | -s "server hello, secure renegotiation extension" \ |
| 5393 | -c "found renegotiation extension" \ |
| 5394 | -C "=> renegotiate" \ |
| 5395 | -S "=> renegotiate" \ |
| 5396 | -s "write hello request" \ |
| 5397 | -S "SSL - An unexpected message was received from our peer" \ |
| 5398 | -S "failed" |
| 5399 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5400 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5401 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5402 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5403 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5404 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5405 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5406 | 0 \ |
| 5407 | -C "client hello, adding renegotiation extension" \ |
| 5408 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5409 | -S "found renegotiation extension" \ |
| 5410 | -s "server hello, secure renegotiation extension" \ |
| 5411 | -c "found renegotiation extension" \ |
| 5412 | -C "=> renegotiate" \ |
| 5413 | -S "=> renegotiate" \ |
| 5414 | -s "write hello request" \ |
| 5415 | -S "SSL - An unexpected message was received from our peer" \ |
| 5416 | -S "failed" |
| 5417 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5418 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5419 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5420 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5421 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5422 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5423 | 0 \ |
| 5424 | -C "client hello, adding renegotiation extension" \ |
| 5425 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5426 | -S "found renegotiation extension" \ |
| 5427 | -s "server hello, secure renegotiation extension" \ |
| 5428 | -c "found renegotiation extension" \ |
| 5429 | -C "=> renegotiate" \ |
| 5430 | -S "=> renegotiate" \ |
| 5431 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5432 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5433 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5434 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5435 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5436 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5437 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5438 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5439 | 0 \ |
| 5440 | -c "client hello, adding renegotiation extension" \ |
| 5441 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5442 | -s "found renegotiation extension" \ |
| 5443 | -s "server hello, secure renegotiation extension" \ |
| 5444 | -c "found renegotiation extension" \ |
| 5445 | -c "=> renegotiate" \ |
| 5446 | -s "=> renegotiate" \ |
| 5447 | -s "write hello request" \ |
| 5448 | -S "SSL - An unexpected message was received from our peer" \ |
| 5449 | -S "failed" |
| 5450 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5451 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5452 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5453 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5454 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5455 | 0 \ |
| 5456 | -C "client hello, adding renegotiation extension" \ |
| 5457 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5458 | -S "found renegotiation extension" \ |
| 5459 | -s "server hello, secure renegotiation extension" \ |
| 5460 | -c "found renegotiation extension" \ |
| 5461 | -S "record counter limit reached: renegotiate" \ |
| 5462 | -C "=> renegotiate" \ |
| 5463 | -S "=> renegotiate" \ |
| 5464 | -S "write hello request" \ |
| 5465 | -S "SSL - An unexpected message was received from our peer" \ |
| 5466 | -S "failed" |
| 5467 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 5468 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5469 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5470 | run_test "Renegotiation: periodic, just above period" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5471 | "$P_SRV force_version=tls12 debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 5472 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5473 | 0 \ |
| 5474 | -c "client hello, adding renegotiation extension" \ |
| 5475 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5476 | -s "found renegotiation extension" \ |
| 5477 | -s "server hello, secure renegotiation extension" \ |
| 5478 | -c "found renegotiation extension" \ |
| 5479 | -s "record counter limit reached: renegotiate" \ |
| 5480 | -c "=> renegotiate" \ |
| 5481 | -s "=> renegotiate" \ |
| 5482 | -s "write hello request" \ |
| 5483 | -S "SSL - An unexpected message was received from our peer" \ |
| 5484 | -S "failed" |
| 5485 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5486 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5487 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5488 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5489 | "$P_CLI force_version=tls12 debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5490 | 0 \ |
| 5491 | -c "client hello, adding renegotiation extension" \ |
| 5492 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5493 | -s "found renegotiation extension" \ |
| 5494 | -s "server hello, secure renegotiation extension" \ |
| 5495 | -c "found renegotiation extension" \ |
| 5496 | -s "record counter limit reached: renegotiate" \ |
| 5497 | -c "=> renegotiate" \ |
| 5498 | -s "=> renegotiate" \ |
| 5499 | -s "write hello request" \ |
| 5500 | -S "SSL - An unexpected message was received from our peer" \ |
| 5501 | -S "failed" |
| 5502 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5503 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5504 | run_test "Renegotiation: periodic, above period, disabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5505 | "$P_SRV force_version=tls12 debug_level=3 exchanges=9 renegotiation=0 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5506 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 5507 | 0 \ |
| 5508 | -C "client hello, adding renegotiation extension" \ |
| 5509 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5510 | -S "found renegotiation extension" \ |
| 5511 | -s "server hello, secure renegotiation extension" \ |
| 5512 | -c "found renegotiation extension" \ |
| 5513 | -S "record counter limit reached: renegotiate" \ |
| 5514 | -C "=> renegotiate" \ |
| 5515 | -S "=> renegotiate" \ |
| 5516 | -S "write hello request" \ |
| 5517 | -S "SSL - An unexpected message was received from our peer" \ |
| 5518 | -S "failed" |
| 5519 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5520 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5521 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5522 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5523 | "$P_CLI force_version=tls12 debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | f07f421 | 2014-08-15 19:04:47 +0200 | [diff] [blame] | 5524 | 0 \ |
| 5525 | -c "client hello, adding renegotiation extension" \ |
| 5526 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5527 | -s "found renegotiation extension" \ |
| 5528 | -s "server hello, secure renegotiation extension" \ |
| 5529 | -c "found renegotiation extension" \ |
| 5530 | -c "=> renegotiate" \ |
| 5531 | -s "=> renegotiate" \ |
| 5532 | -S "write hello request" |
| 5533 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5534 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5535 | run_test "Renegotiation: nbio, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5536 | "$P_SRV force_version=tls12 debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5537 | "$P_CLI debug_level=3 nbio=2 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | f07f421 | 2014-08-15 19:04:47 +0200 | [diff] [blame] | 5538 | 0 \ |
| 5539 | -c "client hello, adding renegotiation extension" \ |
| 5540 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5541 | -s "found renegotiation extension" \ |
| 5542 | -s "server hello, secure renegotiation extension" \ |
| 5543 | -c "found renegotiation extension" \ |
| 5544 | -c "=> renegotiate" \ |
| 5545 | -s "=> renegotiate" \ |
| 5546 | -s "write hello request" |
| 5547 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5548 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5549 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5550 | run_test "Renegotiation: openssl server, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5551 | "$O_SRV -www -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5552 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5553 | 0 \ |
| 5554 | -c "client hello, adding renegotiation extension" \ |
| 5555 | -c "found renegotiation extension" \ |
| 5556 | -c "=> renegotiate" \ |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5557 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5558 | -C "error" \ |
| 5559 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5560 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5561 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5562 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5563 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5564 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5565 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5566 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5567 | 0 \ |
| 5568 | -c "client hello, adding renegotiation extension" \ |
| 5569 | -c "found renegotiation extension" \ |
| 5570 | -c "=> renegotiate" \ |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5571 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5572 | -C "error" \ |
| 5573 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5574 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5575 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5576 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5577 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5578 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5579 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5580 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5581 | 1 \ |
| 5582 | -c "client hello, adding renegotiation extension" \ |
| 5583 | -C "found renegotiation extension" \ |
| 5584 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5585 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5586 | -c "error" \ |
| 5587 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5588 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5589 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5590 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5591 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5592 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5593 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5594 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5595 | allow_legacy=0" \ |
| 5596 | 1 \ |
| 5597 | -c "client hello, adding renegotiation extension" \ |
| 5598 | -C "found renegotiation extension" \ |
| 5599 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5600 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5601 | -c "error" \ |
| 5602 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5603 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5604 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5605 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5606 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5607 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5608 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5609 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5610 | allow_legacy=1" \ |
| 5611 | 0 \ |
| 5612 | -c "client hello, adding renegotiation extension" \ |
| 5613 | -C "found renegotiation extension" \ |
| 5614 | -c "=> renegotiate" \ |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5615 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5616 | -C "error" \ |
| 5617 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5618 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5619 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5620 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 5621 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 5622 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 5623 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5624 | 0 \ |
| 5625 | -c "client hello, adding renegotiation extension" \ |
| 5626 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5627 | -s "found renegotiation extension" \ |
| 5628 | -s "server hello, secure renegotiation extension" \ |
| 5629 | -c "found renegotiation extension" \ |
| 5630 | -c "=> renegotiate" \ |
| 5631 | -s "=> renegotiate" \ |
| 5632 | -S "write hello request" |
| 5633 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5634 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5635 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5636 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 5637 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | df9a0a8 | 2014-10-02 14:17:18 +0200 | [diff] [blame] | 5638 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 5639 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5640 | 0 \ |
| 5641 | -c "client hello, adding renegotiation extension" \ |
| 5642 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5643 | -s "found renegotiation extension" \ |
| 5644 | -s "server hello, secure renegotiation extension" \ |
| 5645 | -c "found renegotiation extension" \ |
| 5646 | -c "=> renegotiate" \ |
| 5647 | -s "=> renegotiate" \ |
| 5648 | -s "write hello request" |
| 5649 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5650 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5651 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5652 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 5653 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 5654 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 5655 | 0 \ |
| 5656 | -c "client hello, adding renegotiation extension" \ |
| 5657 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5658 | -s "found renegotiation extension" \ |
| 5659 | -s "server hello, secure renegotiation extension" \ |
| 5660 | -s "record counter limit reached: renegotiate" \ |
| 5661 | -c "=> renegotiate" \ |
| 5662 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5663 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5664 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5665 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5666 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5667 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5668 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5669 | "$G_NEXT_SRV -u --mtu 4096" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5670 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5671 | 0 \ |
| 5672 | -c "client hello, adding renegotiation extension" \ |
| 5673 | -c "found renegotiation extension" \ |
| 5674 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5675 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5676 | -C "error" \ |
| 5677 | -s "Extra-header:" |
| 5678 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5679 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5680 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5681 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5682 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5683 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5684 | run_test "Renego ext: gnutls server strict, client default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5685 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5686 | "$P_CLI debug_level=3" \ |
| 5687 | 0 \ |
| 5688 | -c "found renegotiation extension" \ |
| 5689 | -C "error" \ |
| 5690 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5691 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5692 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5693 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5694 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5695 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5696 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5697 | "$P_CLI debug_level=3" \ |
| 5698 | 0 \ |
| 5699 | -C "found renegotiation extension" \ |
| 5700 | -C "error" \ |
| 5701 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5702 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5703 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5704 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5705 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5706 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5707 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5708 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 5709 | 1 \ |
| 5710 | -C "found renegotiation extension" \ |
| 5711 | -c "error" \ |
| 5712 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5713 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5714 | requires_gnutls |
Gilles Peskine | 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 strict, 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:%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 default" \ |
| 5728 | "$P_SRV debug_level=3" \ |
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 | 0 \ |
| 5731 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5732 | -S "server hello, secure renegotiation extension" |
| 5733 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5734 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5735 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5736 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5737 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 5738 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Gilles Peskine | 01fde2c | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5739 | "$G_CLI --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5740 | 1 \ |
| 5741 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5742 | -S "server hello, secure renegotiation extension" |
| 5743 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5744 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 5745 | |
| 5746 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5748 | run_test "DER format: no trailing bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5749 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der0.crt \ |
| 5750 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5751 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5752 | 0 \ |
| 5753 | -c "Handshake was completed" \ |
| 5754 | |
| 5755 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5756 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5757 | run_test "DER format: with a trailing zero byte" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5758 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der1a.crt \ |
| 5759 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5760 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5761 | 0 \ |
| 5762 | -c "Handshake was completed" \ |
| 5763 | |
| 5764 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5765 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5766 | run_test "DER format: with a trailing random byte" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5767 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der1b.crt \ |
| 5768 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5769 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5770 | 0 \ |
| 5771 | -c "Handshake was completed" \ |
| 5772 | |
| 5773 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5774 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5775 | run_test "DER format: with 2 trailing random bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5776 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der2.crt \ |
| 5777 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5778 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5779 | 0 \ |
| 5780 | -c "Handshake was completed" \ |
| 5781 | |
| 5782 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5783 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5784 | run_test "DER format: with 4 trailing random bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5785 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der4.crt \ |
| 5786 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5787 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5788 | 0 \ |
| 5789 | -c "Handshake was completed" \ |
| 5790 | |
| 5791 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5792 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5793 | run_test "DER format: with 8 trailing random bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5794 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der8.crt \ |
| 5795 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5796 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5797 | 0 \ |
| 5798 | -c "Handshake was completed" \ |
| 5799 | |
| 5800 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5801 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5802 | run_test "DER format: with 9 trailing random bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5803 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der9.crt \ |
| 5804 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5805 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5806 | 0 \ |
| 5807 | -c "Handshake was completed" \ |
| 5808 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5809 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 5810 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5811 | |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5812 | # The next 4 cases test the 3 auth modes with a badly signed server cert. |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5813 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5814 | run_test "Authentication: server badcert, client required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5815 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5816 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5817 | "$P_CLI debug_level=3 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5818 | 1 \ |
| 5819 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5820 | -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] | 5821 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5822 | -c "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5823 | -c "X509 - Certificate verification failed" |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5824 | # MBEDTLS_X509_BADCERT_NOT_TRUSTED -> MBEDTLS_SSL_ALERT_MSG_UNKNOWN_CA |
| 5825 | # We don't check that the server receives the alert because it might |
| 5826 | # detect that its write end of the connection is closed and abort |
| 5827 | # before reading the alert message. |
| 5828 | |
| 5829 | run_test "Authentication: server badcert, client required (1.2)" \ |
| 5830 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5831 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 5832 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=required" \ |
| 5833 | 1 \ |
| 5834 | -c "x509_verify_cert() returned" \ |
| 5835 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5836 | -c "! mbedtls_ssl_handshake returned" \ |
| 5837 | -c "send alert level=2 message=48" \ |
| 5838 | -c "X509 - Certificate verification failed" |
| 5839 | # 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] | 5840 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5841 | run_test "Authentication: server badcert, client optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5842 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5843 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 58ab9ba | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 5844 | "$P_CLI force_version=tls13 debug_level=3 auth_mode=optional" \ |
| 5845 | 0 \ |
| 5846 | -c "x509_verify_cert() returned" \ |
| 5847 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5848 | -C "! mbedtls_ssl_handshake returned" \ |
| 5849 | -C "send alert level=2 message=48" \ |
| 5850 | -C "X509 - Certificate verification failed" |
| 5851 | |
| 5852 | run_test "Authentication: server badcert, client optional (1.2)" \ |
| 5853 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5854 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5855 | "$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] | 5856 | 0 \ |
| 5857 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5858 | -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] | 5859 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5860 | -C "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5861 | -C "X509 - Certificate verification failed" |
| 5862 | |
Manuel Pégourié-Gonnard | 946d14a | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 5863 | run_test "Authentication: server badcert, client none" \ |
| 5864 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5865 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 6901504 | 2024-08-14 10:44:02 +0200 | [diff] [blame] | 5866 | "$P_CLI debug_level=3 auth_mode=none" \ |
| 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" \ |
| 5871 | -C "send alert level=2 message=48" \ |
| 5872 | -C "X509 - Certificate verification failed" |
| 5873 | |
| 5874 | run_test "Authentication: server badcert, client none (1.2)" \ |
| 5875 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5876 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5877 | "$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] | 5878 | 0 \ |
| 5879 | -C "x509_verify_cert() returned" \ |
| 5880 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5881 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5882 | -C "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 946d14a | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 5883 | -C "X509 - Certificate verification failed" |
| 5884 | |
Manuel Pégourié-Gonnard | 18dd213 | 2024-08-14 10:34:53 +0200 | [diff] [blame] | 5885 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
| 5886 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 5887 | "$P_SRV" \ |
| 5888 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5889 | 1 \ |
| 5890 | -c "x509_verify_cert() returned" \ |
| 5891 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5892 | -c "! Certificate verification flags"\ |
| 5893 | -c "! mbedtls_ssl_handshake returned" \ |
| 5894 | -c "SSL - No CA Chain is set, but required to operate" |
| 5895 | |
| 5896 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 5897 | run_test "Authentication: server goodcert, client required, no trusted CA (1.2)" \ |
| 5898 | "$P_SRV force_version=tls12" \ |
| 5899 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5900 | 1 \ |
| 5901 | -c "x509_verify_cert() returned" \ |
| 5902 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5903 | -c "! Certificate verification flags"\ |
| 5904 | -c "! mbedtls_ssl_handshake returned" \ |
| 5905 | -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] | 5906 | |
| 5907 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5908 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 5909 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | 58ab9ba | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 5910 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 5911 | 0 \ |
| 5912 | -c "x509_verify_cert() returned" \ |
| 5913 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5914 | -c "! Certificate verification flags"\ |
| 5915 | -C "! mbedtls_ssl_handshake returned" \ |
| 5916 | -C "X509 - Certificate verification failed" \ |
| 5917 | -C "SSL - No CA Chain is set, but required to operate" |
| 5918 | |
| 5919 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 5920 | run_test "Authentication: server goodcert, client optional, no trusted CA (1.2)" \ |
| 5921 | "$P_SRV" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5922 | "$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] | 5923 | 0 \ |
| 5924 | -c "x509_verify_cert() returned" \ |
| 5925 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5926 | -c "! Certificate verification flags"\ |
| 5927 | -C "! mbedtls_ssl_handshake returned" \ |
| 5928 | -C "X509 - Certificate verification failed" \ |
| 5929 | -C "SSL - No CA Chain is set, but required to operate" |
| 5930 | |
Manuel Pégourié-Gonnard | 6901504 | 2024-08-14 10:44:02 +0200 | [diff] [blame] | 5931 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
| 5932 | run_test "Authentication: server goodcert, client none, no trusted CA" \ |
| 5933 | "$P_SRV" \ |
| 5934 | "$P_CLI debug_level=3 auth_mode=none ca_file=none ca_path=none" \ |
| 5935 | 0 \ |
| 5936 | -C "x509_verify_cert() returned" \ |
| 5937 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5938 | -C "! Certificate verification flags"\ |
| 5939 | -C "! mbedtls_ssl_handshake returned" \ |
| 5940 | -C "X509 - Certificate verification failed" \ |
| 5941 | -C "SSL - No CA Chain is set, but required to operate" |
| 5942 | |
| 5943 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 5944 | run_test "Authentication: server goodcert, client none, no trusted CA (1.2)" \ |
| 5945 | "$P_SRV" \ |
| 5946 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=none ca_file=none ca_path=none" \ |
| 5947 | 0 \ |
| 5948 | -C "x509_verify_cert() returned" \ |
| 5949 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5950 | -C "! Certificate verification flags"\ |
| 5951 | -C "! mbedtls_ssl_handshake returned" \ |
| 5952 | -C "X509 - Certificate verification failed" \ |
| 5953 | -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] | 5954 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5955 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5956 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5957 | # the client informs the server about the supported curves - it does, though, in the |
| 5958 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5959 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5960 | # different means to have the server ignoring the client's supported curve list. |
| 5961 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5962 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5963 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 5964 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 5965 | "$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] | 5966 | 1 \ |
| 5967 | -c "bad certificate (EC key curve)"\ |
| 5968 | -c "! Certificate verification flags"\ |
| 5969 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5970 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5971 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5972 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 5973 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 5974 | "$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] | 5975 | 1 \ |
| 5976 | -c "bad certificate (EC key curve)"\ |
| 5977 | -c "! Certificate verification flags"\ |
| 5978 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5979 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5980 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5981 | run_test "Authentication: client SHA256, server required" \ |
| 5982 | "$P_SRV auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5983 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 5984 | key_file=$DATA_FILES_PATH/server6.key \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5985 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5986 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5987 | -c "Supported Signature Algorithm found: 04 " \ |
| 5988 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5989 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5990 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5991 | run_test "Authentication: client SHA384, server required" \ |
| 5992 | "$P_SRV auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5993 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 5994 | key_file=$DATA_FILES_PATH/server6.key \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5995 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5996 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5997 | -c "Supported Signature Algorithm found: 04 " \ |
| 5998 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5999 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6000 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6001 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 6002 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 6003 | "$P_CLI debug_level=3 crt_file=none \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6004 | key_file=$DATA_FILES_PATH/server5.key" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6005 | 1 \ |
| 6006 | -S "skip write certificate request" \ |
| 6007 | -C "skip parse certificate request" \ |
| 6008 | -c "got a certificate request" \ |
| 6009 | -c "= write certificate$" \ |
| 6010 | -C "skip write certificate$" \ |
| 6011 | -S "x509_verify_cert() returned" \ |
Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 6012 | -s "peer has no certificate" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6013 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6014 | -s "No client certification received from the client, but required by the authentication mode" |
| 6015 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6016 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6017 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6018 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6019 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6020 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6021 | 1 \ |
| 6022 | -S "skip write certificate request" \ |
| 6023 | -C "skip parse certificate request" \ |
| 6024 | -c "got a certificate request" \ |
| 6025 | -C "skip write certificate" \ |
| 6026 | -C "skip write certificate verify" \ |
| 6027 | -S "skip parse certificate verify" \ |
| 6028 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6029 | -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] | 6030 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 6031 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6032 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 6033 | # We don't check that the client receives the alert because it might |
| 6034 | # detect that its write end of the connection is closed and abort |
| 6035 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6036 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6037 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 6038 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6039 | "$P_SRV debug_level=3 auth_mode=required ca_file=$DATA_FILES_PATH/server5-selfsigned.crt" \ |
| 6040 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6041 | key_file=$DATA_FILES_PATH/server5.key" \ |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 6042 | 0 \ |
| 6043 | -S "skip write certificate request" \ |
| 6044 | -C "skip parse certificate request" \ |
| 6045 | -c "got a certificate request" \ |
| 6046 | -C "skip write certificate" \ |
| 6047 | -C "skip write certificate verify" \ |
| 6048 | -S "skip parse certificate verify" \ |
| 6049 | -S "x509_verify_cert() returned" \ |
| 6050 | -S "! The certificate is not correctly signed" \ |
| 6051 | -S "X509 - Certificate verification failed" |
| 6052 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6053 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6054 | run_test "Authentication: client cert not trusted, server required" \ |
| 6055 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6056 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6057 | key_file=$DATA_FILES_PATH/server5.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6058 | 1 \ |
| 6059 | -S "skip write certificate request" \ |
| 6060 | -C "skip parse certificate request" \ |
| 6061 | -c "got a certificate request" \ |
| 6062 | -C "skip write certificate" \ |
| 6063 | -C "skip write certificate verify" \ |
| 6064 | -S "skip parse certificate verify" \ |
| 6065 | -s "x509_verify_cert() returned" \ |
| 6066 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6067 | -s "! mbedtls_ssl_handshake returned" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6068 | -s "X509 - Certificate verification failed" |
| 6069 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6070 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6071 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6072 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6073 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6074 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6075 | 0 \ |
| 6076 | -S "skip write certificate request" \ |
| 6077 | -C "skip parse certificate request" \ |
| 6078 | -c "got a certificate request" \ |
| 6079 | -C "skip write certificate" \ |
| 6080 | -C "skip write certificate verify" \ |
| 6081 | -S "skip parse certificate verify" \ |
| 6082 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6083 | -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] | 6084 | -S "! mbedtls_ssl_handshake returned" \ |
| 6085 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6086 | -S "X509 - Certificate verification failed" |
| 6087 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6088 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6089 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6090 | "$P_SRV debug_level=3 auth_mode=none" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6091 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6092 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6093 | 0 \ |
| 6094 | -s "skip write certificate request" \ |
| 6095 | -C "skip parse certificate request" \ |
| 6096 | -c "got no certificate request" \ |
| 6097 | -c "skip write certificate" \ |
| 6098 | -c "skip write certificate verify" \ |
| 6099 | -s "skip parse certificate verify" \ |
| 6100 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6101 | -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] | 6102 | -S "! mbedtls_ssl_handshake returned" \ |
| 6103 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6104 | -S "X509 - Certificate verification failed" |
| 6105 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6106 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6107 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6108 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 6109 | "$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] | 6110 | 0 \ |
| 6111 | -S "skip write certificate request" \ |
| 6112 | -C "skip parse certificate request" \ |
| 6113 | -c "got a certificate request" \ |
| 6114 | -C "skip write certificate$" \ |
| 6115 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6116 | -c "skip write certificate verify" \ |
| 6117 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6118 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6119 | -S "! mbedtls_ssl_handshake returned" \ |
| 6120 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6121 | -S "X509 - Certificate verification failed" |
| 6122 | |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 6123 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6124 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6125 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6126 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6127 | "$O_NEXT_CLI_NO_CERT -no_middlebox" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6128 | 0 \ |
| 6129 | -S "skip write certificate request" \ |
| 6130 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6131 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6132 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6133 | -S "X509 - Certificate verification failed" |
| 6134 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6135 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6136 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6137 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6138 | "$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] | 6139 | 0 \ |
| 6140 | -C "skip parse certificate request" \ |
| 6141 | -c "got a certificate request" \ |
| 6142 | -C "skip write certificate$" \ |
| 6143 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6144 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6145 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6147 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6148 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6149 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 6150 | 1 \ |
| 6151 | -C "skip parse certificate request" \ |
| 6152 | -c "got a certificate request" \ |
| 6153 | -C "skip write certificate$" \ |
| 6154 | -c "skip write certificate verify" \ |
| 6155 | -c "! mbedtls_ssl_handshake returned" |
| 6156 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 6157 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 6158 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 6159 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 6160 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 6161 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 6162 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 6163 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 6164 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 6165 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 6166 | # 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] | 6167 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6168 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6169 | run_test "Authentication: server max_int chain, client default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6170 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6171 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
| 6172 | "$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] | 6173 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6174 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6175 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6176 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6177 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6178 | run_test "Authentication: server max_int+1 chain, client default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6179 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6180 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6181 | "$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] | 6182 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6183 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6184 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6185 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6186 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6187 | run_test "Authentication: server max_int+1 chain, client optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6188 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6189 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 58ab9ba | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 6190 | "$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] | 6191 | auth_mode=optional" \ |
| 6192 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6193 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6194 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6195 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6196 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6197 | run_test "Authentication: server max_int+1 chain, client none" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6198 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6199 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6200 | "$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] | 6201 | auth_mode=none" \ |
| 6202 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6203 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6204 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6205 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6206 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6207 | run_test "Authentication: client max_int+1 chain, server default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6208 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt" \ |
| 6209 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6210 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6211 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6212 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6213 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6214 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6215 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6216 | run_test "Authentication: client max_int+1 chain, server optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6217 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=optional" \ |
| 6218 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6219 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6220 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6221 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6222 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6223 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6224 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6225 | run_test "Authentication: client max_int+1 chain, server required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6226 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
| 6227 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6228 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6229 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6230 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6231 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6232 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6233 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6234 | run_test "Authentication: client max_int chain, server required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6235 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
| 6236 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6237 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6238 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6239 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6240 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6241 | # Tests for CA list in CertificateRequest messages |
| 6242 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6243 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6244 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 6245 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6246 | "$P_CLI force_version=tls12 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6247 | key_file=$DATA_FILES_PATH/server6.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6248 | 0 \ |
| 6249 | -s "requested DN" |
| 6250 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6251 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6252 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 6253 | "$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] | 6254 | "$P_CLI force_version=tls12 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6255 | key_file=$DATA_FILES_PATH/server6.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6256 | 0 \ |
| 6257 | -S "requested DN" |
| 6258 | |
| 6259 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6260 | "$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] | 6261 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6262 | key_file=$DATA_FILES_PATH/server5.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6263 | 1 \ |
| 6264 | -S "requested DN" \ |
| 6265 | -s "x509_verify_cert() returned" \ |
| 6266 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6267 | -s "! mbedtls_ssl_handshake returned" \ |
| 6268 | -c "! mbedtls_ssl_handshake returned" \ |
| 6269 | -s "X509 - Certificate verification failed" |
| 6270 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6271 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6272 | run_test "Authentication: send alt conf DN hints in CertificateRequest" \ |
| 6273 | "$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] | 6274 | crt_file2=$DATA_FILES_PATH/server1.crt \ |
| 6275 | key_file2=$DATA_FILES_PATH/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6276 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6277 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6278 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6279 | 0 \ |
| 6280 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 6281 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6282 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6283 | run_test "Authentication: send alt conf DN hints in CertificateRequest (2)" \ |
| 6284 | "$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] | 6285 | crt_file2=$DATA_FILES_PATH/server2.crt \ |
| 6286 | key_file2=$DATA_FILES_PATH/server2.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6287 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6288 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6289 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6290 | 0 \ |
| 6291 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" |
| 6292 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6293 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6294 | run_test "Authentication: send alt hs DN hints in CertificateRequest" \ |
| 6295 | "$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] | 6296 | crt_file2=$DATA_FILES_PATH/server1.crt \ |
| 6297 | key_file2=$DATA_FILES_PATH/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6298 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6299 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6300 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6301 | 0 \ |
| 6302 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 6303 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 6304 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 6305 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6306 | |
| 6307 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6308 | run_test "Authentication, CA callback: server badcert, client required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6309 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6310 | key_file=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame^] | 6311 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6312 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6313 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6314 | -c "x509_verify_cert() returned" \ |
| 6315 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6316 | -c "! mbedtls_ssl_handshake returned" \ |
| 6317 | -c "X509 - Certificate verification failed" |
| 6318 | |
| 6319 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6320 | run_test "Authentication, CA callback: server badcert, client optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6321 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6322 | key_file=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame^] | 6323 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6324 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6325 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6326 | -c "x509_verify_cert() returned" \ |
| 6327 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6328 | -C "! mbedtls_ssl_handshake returned" \ |
| 6329 | -C "X509 - Certificate verification failed" |
| 6330 | |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame^] | 6331 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6332 | run_test "Authentication, CA callback: server badcert, client none" \ |
| 6333 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6334 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 6335 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=none" \ |
| 6336 | 0 \ |
| 6337 | -C "use CA callback for X.509 CRT verification" \ |
| 6338 | -C "x509_verify_cert() returned" \ |
| 6339 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6340 | -C "! mbedtls_ssl_handshake returned" \ |
| 6341 | -C "X509 - Certificate verification failed" |
| 6342 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6343 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 6344 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 6345 | # the client informs the server about the supported curves - it does, though, in the |
| 6346 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 6347 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 6348 | # different means to have the server ignoring the client's supported curve list. |
| 6349 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6350 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6351 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6352 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6353 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6354 | "$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] | 6355 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6356 | -c "use CA callback for X.509 CRT verification" \ |
| 6357 | -c "bad certificate (EC key curve)" \ |
| 6358 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6359 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 6360 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6361 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6362 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6363 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6364 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6365 | "$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] | 6366 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6367 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6368 | -c "bad certificate (EC key curve)"\ |
| 6369 | -c "! Certificate verification flags"\ |
| 6370 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 6371 | |
| 6372 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6373 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 7a442c9 | 2024-04-03 08:57:09 +0200 | [diff] [blame] | 6374 | run_test "Authentication, CA callback: client SHA384, server required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6375 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6376 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6377 | key_file=$DATA_FILES_PATH/server6.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6378 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 6379 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6380 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6381 | -c "Supported Signature Algorithm found: 04 " \ |
| 6382 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6383 | |
| 6384 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6385 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 7a442c9 | 2024-04-03 08:57:09 +0200 | [diff] [blame] | 6386 | run_test "Authentication, CA callback: client SHA256, server required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6387 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6388 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6389 | key_file=$DATA_FILES_PATH/server6.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6390 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 6391 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6392 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6393 | -c "Supported Signature Algorithm found: 04 " \ |
| 6394 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6395 | |
| 6396 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6397 | run_test "Authentication, CA callback: client badcert, server required" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame^] | 6398 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6399 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6400 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6401 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6402 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6403 | -S "skip write certificate request" \ |
| 6404 | -C "skip parse certificate request" \ |
| 6405 | -c "got a certificate request" \ |
| 6406 | -C "skip write certificate" \ |
| 6407 | -C "skip write certificate verify" \ |
| 6408 | -S "skip parse certificate verify" \ |
| 6409 | -s "x509_verify_cert() returned" \ |
| 6410 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6411 | -s "! mbedtls_ssl_handshake returned" \ |
| 6412 | -s "send alert level=2 message=48" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6413 | -s "X509 - Certificate verification failed" |
| 6414 | # We don't check that the client receives the alert because it might |
| 6415 | # detect that its write end of the connection is closed and abort |
| 6416 | # before reading the alert message. |
| 6417 | |
| 6418 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6419 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame^] | 6420 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6421 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6422 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6423 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6424 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6425 | -S "skip write certificate request" \ |
| 6426 | -C "skip parse certificate request" \ |
| 6427 | -c "got a certificate request" \ |
| 6428 | -C "skip write certificate" \ |
| 6429 | -C "skip write certificate verify" \ |
| 6430 | -S "skip parse certificate verify" \ |
| 6431 | -s "x509_verify_cert() returned" \ |
| 6432 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6433 | -s "! mbedtls_ssl_handshake returned" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6434 | -s "X509 - Certificate verification failed" |
| 6435 | |
| 6436 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6437 | run_test "Authentication, CA callback: client badcert, server optional" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame^] | 6438 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6439 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6440 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6441 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6442 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6443 | -S "skip write certificate request" \ |
| 6444 | -C "skip parse certificate request" \ |
| 6445 | -c "got a certificate request" \ |
| 6446 | -C "skip write certificate" \ |
| 6447 | -C "skip write certificate verify" \ |
| 6448 | -S "skip parse certificate verify" \ |
| 6449 | -s "x509_verify_cert() returned" \ |
| 6450 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6451 | -S "! mbedtls_ssl_handshake returned" \ |
| 6452 | -C "! mbedtls_ssl_handshake returned" \ |
| 6453 | -S "X509 - Certificate verification failed" |
| 6454 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6455 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6456 | requires_full_size_output_buffer |
| 6457 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6458 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6459 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6460 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame^] | 6461 | "$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] | 6462 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6463 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6464 | -C "X509 - A fatal error occurred" |
| 6465 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6466 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6467 | requires_full_size_output_buffer |
| 6468 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6469 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6470 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6471 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame^] | 6472 | "$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] | 6473 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6474 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6475 | -c "X509 - A fatal error occurred" |
| 6476 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6477 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6478 | requires_full_size_output_buffer |
| 6479 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6480 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6481 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6482 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame^] | 6483 | "$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] | 6484 | debug_level=3 auth_mode=optional" \ |
| 6485 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6486 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6487 | -c "X509 - A fatal error occurred" |
| 6488 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6489 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6490 | requires_full_size_output_buffer |
| 6491 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6492 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame^] | 6493 | "$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] | 6494 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6495 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6496 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6497 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6498 | -s "X509 - A fatal error occurred" |
| 6499 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6500 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6501 | requires_full_size_output_buffer |
| 6502 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6503 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame^] | 6504 | "$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] | 6505 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6506 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6507 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6508 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6509 | -s "X509 - A fatal error occurred" |
| 6510 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6511 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6512 | requires_full_size_output_buffer |
| 6513 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6514 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame^] | 6515 | "$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] | 6516 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6517 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6518 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6519 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6520 | -S "X509 - A fatal error occurred" |
| 6521 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 6522 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6523 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6524 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6525 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6526 | "$P_SRV force_version=tls12 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 6527 | key_file=$DATA_FILES_PATH/server5.key \ |
| 6528 | crt_file2=$DATA_FILES_PATH/server5-sha1.crt \ |
| 6529 | key_file2=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6530 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6531 | 0 \ |
| 6532 | -c "signed using.*ECDSA with SHA256" \ |
| 6533 | -C "signed using.*ECDSA with SHA1" |
| 6534 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6535 | # tests for SNI |
| 6536 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6537 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6538 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6539 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6540 | "$P_SRV debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6541 | 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] | 6542 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6543 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6544 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6545 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6546 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6547 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6548 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6549 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6550 | "$P_SRV debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6551 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6552 | 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] | 6553 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6554 | 0 \ |
| 6555 | -s "parse ServerName extension" \ |
| 6556 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6557 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6558 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6559 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6560 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6561 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6562 | "$P_SRV debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6563 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6564 | 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] | 6565 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6566 | 0 \ |
| 6567 | -s "parse ServerName extension" \ |
| 6568 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6569 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6570 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6571 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6572 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6573 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6574 | "$P_SRV debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6575 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6576 | 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] | 6577 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6578 | 1 \ |
| 6579 | -s "parse ServerName extension" \ |
| 6580 | -s "ssl_sni_wrapper() returned" \ |
| 6581 | -s "mbedtls_ssl_handshake returned" \ |
| 6582 | -c "mbedtls_ssl_handshake returned" \ |
| 6583 | -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] | 6584 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6585 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6586 | run_test "SNI: client auth no override: optional" \ |
| 6587 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6588 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6589 | 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] | 6590 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6591 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [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 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6599 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6600 | run_test "SNI: client auth override: none -> optional" \ |
| 6601 | "$P_SRV debug_level=3 auth_mode=none \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6602 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6603 | 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] | 6604 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6605 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6606 | -S "skip write certificate request" \ |
| 6607 | -C "skip parse certificate request" \ |
| 6608 | -c "got a certificate request" \ |
| 6609 | -C "skip write certificate" \ |
| 6610 | -C "skip write certificate verify" \ |
| 6611 | -S "skip parse certificate verify" |
| 6612 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6613 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6614 | run_test "SNI: client auth override: optional -> none" \ |
| 6615 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6616 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6617 | 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] | 6618 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6619 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6620 | -s "skip write certificate request" \ |
| 6621 | -C "skip parse certificate request" \ |
| 6622 | -c "got no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 6623 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6624 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6625 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6626 | run_test "SNI: CA no override" \ |
| 6627 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6628 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6629 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6630 | 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] | 6631 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6632 | 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] | 6633 | 1 \ |
| 6634 | -S "skip write certificate request" \ |
| 6635 | -C "skip parse certificate request" \ |
| 6636 | -c "got a certificate request" \ |
| 6637 | -C "skip write certificate" \ |
| 6638 | -C "skip write certificate verify" \ |
| 6639 | -S "skip parse certificate verify" \ |
| 6640 | -s "x509_verify_cert() returned" \ |
| 6641 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6642 | -S "The certificate has been revoked (is on a CRL)" |
| 6643 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6644 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6645 | run_test "SNI: CA override" \ |
| 6646 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6647 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6648 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6649 | 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] | 6650 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6651 | 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] | 6652 | 0 \ |
| 6653 | -S "skip write certificate request" \ |
| 6654 | -C "skip parse certificate request" \ |
| 6655 | -c "got a certificate request" \ |
| 6656 | -C "skip write certificate" \ |
| 6657 | -C "skip write certificate verify" \ |
| 6658 | -S "skip parse certificate verify" \ |
| 6659 | -S "x509_verify_cert() returned" \ |
| 6660 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6661 | -S "The certificate has been revoked (is on a CRL)" |
| 6662 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6663 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6664 | run_test "SNI: CA override with CRL" \ |
| 6665 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6666 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6667 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6668 | 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] | 6669 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6670 | 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] | 6671 | 1 \ |
| 6672 | -S "skip write certificate request" \ |
| 6673 | -C "skip parse certificate request" \ |
| 6674 | -c "got a certificate request" \ |
| 6675 | -C "skip write certificate" \ |
| 6676 | -C "skip write certificate verify" \ |
| 6677 | -S "skip parse certificate verify" \ |
| 6678 | -s "x509_verify_cert() returned" \ |
| 6679 | -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] | 6680 | -s "send alert level=2 message=44" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6681 | -s "The certificate has been revoked (is on a CRL)" |
Manuel Pégourié-Gonnard | 2ffa53a | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6682 | # MBEDTLS_X509_BADCERT_REVOKED -> MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6683 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6684 | # Tests for SNI and DTLS |
| 6685 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6686 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6687 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6688 | run_test "SNI: DTLS, no SNI callback" \ |
| 6689 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6690 | 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] | 6691 | "$P_CLI server_name=localhost dtls=1" \ |
| 6692 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6693 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6694 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6695 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6696 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6697 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6698 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6699 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6700 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6701 | 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] | 6702 | "$P_CLI server_name=localhost dtls=1" \ |
| 6703 | 0 \ |
| 6704 | -s "parse ServerName extension" \ |
| 6705 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6706 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6707 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6708 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6710 | run_test "SNI: DTLS, matching cert 2" \ |
| 6711 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6712 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6713 | 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] | 6714 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 6715 | 0 \ |
| 6716 | -s "parse ServerName extension" \ |
| 6717 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6718 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6719 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6720 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6721 | run_test "SNI: DTLS, no matching cert" \ |
| 6722 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6723 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6724 | 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] | 6725 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 6726 | 1 \ |
| 6727 | -s "parse ServerName extension" \ |
| 6728 | -s "ssl_sni_wrapper() returned" \ |
| 6729 | -s "mbedtls_ssl_handshake returned" \ |
| 6730 | -c "mbedtls_ssl_handshake returned" \ |
| 6731 | -c "SSL - A fatal alert message was received from our peer" |
| 6732 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6733 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6734 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 6735 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6736 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6737 | 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] | 6738 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6739 | 0 \ |
| 6740 | -S "skip write certificate request" \ |
| 6741 | -C "skip parse certificate request" \ |
| 6742 | -c "got a certificate request" \ |
| 6743 | -C "skip write certificate" \ |
| 6744 | -C "skip write certificate verify" \ |
| 6745 | -S "skip parse certificate verify" |
| 6746 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6748 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 6749 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6750 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6751 | 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] | 6752 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6753 | 0 \ |
| 6754 | -S "skip write certificate request" \ |
| 6755 | -C "skip parse certificate request" \ |
| 6756 | -c "got a certificate request" \ |
| 6757 | -C "skip write certificate" \ |
| 6758 | -C "skip write certificate verify" \ |
| 6759 | -S "skip parse certificate verify" |
| 6760 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6761 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6762 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 6763 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6764 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6765 | 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] | 6766 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6767 | 0 \ |
| 6768 | -s "skip write certificate request" \ |
| 6769 | -C "skip parse certificate request" \ |
| 6770 | -c "got no certificate request" \ |
| 6771 | -c "skip write certificate" \ |
| 6772 | -c "skip write certificate verify" \ |
| 6773 | -s "skip parse certificate verify" |
| 6774 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6775 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6776 | run_test "SNI: DTLS, CA no override" \ |
| 6777 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6778 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6779 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6780 | 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] | 6781 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6782 | 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] | 6783 | 1 \ |
| 6784 | -S "skip write certificate request" \ |
| 6785 | -C "skip parse certificate request" \ |
| 6786 | -c "got a certificate request" \ |
| 6787 | -C "skip write certificate" \ |
| 6788 | -C "skip write certificate verify" \ |
| 6789 | -S "skip parse certificate verify" \ |
| 6790 | -s "x509_verify_cert() returned" \ |
| 6791 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6792 | -S "The certificate has been revoked (is on a CRL)" |
| 6793 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6795 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6796 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6797 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6798 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6799 | 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] | 6800 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6801 | 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] | 6802 | 0 \ |
| 6803 | -S "skip write certificate request" \ |
| 6804 | -C "skip parse certificate request" \ |
| 6805 | -c "got a certificate request" \ |
| 6806 | -C "skip write certificate" \ |
| 6807 | -C "skip write certificate verify" \ |
| 6808 | -S "skip parse certificate verify" \ |
| 6809 | -S "x509_verify_cert() returned" \ |
| 6810 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6811 | -S "The certificate has been revoked (is on a CRL)" |
| 6812 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6813 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6814 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6815 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6816 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key dtls=1 \ |
| 6817 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6818 | 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] | 6819 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6820 | 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] | 6821 | 1 \ |
| 6822 | -S "skip write certificate request" \ |
| 6823 | -C "skip parse certificate request" \ |
| 6824 | -c "got a certificate request" \ |
| 6825 | -C "skip write certificate" \ |
| 6826 | -C "skip write certificate verify" \ |
| 6827 | -S "skip parse certificate verify" \ |
| 6828 | -s "x509_verify_cert() returned" \ |
| 6829 | -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] | 6830 | -s "send alert level=2 message=44" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6831 | -s "The certificate has been revoked (is on a CRL)" |
Manuel Pégourié-Gonnard | 2ffa53a | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6832 | # MBEDTLS_X509_BADCERT_REVOKED -> MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6833 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6834 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 6835 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6836 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6837 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6838 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6839 | "$P_CLI nbio=2 tickets=0" \ |
| 6840 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6841 | -S "mbedtls_ssl_handshake returned" \ |
| 6842 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6843 | -c "Read from server: .* bytes read" |
| 6844 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6845 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6846 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6847 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 6848 | "$P_CLI nbio=2 tickets=0" \ |
| 6849 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6850 | -S "mbedtls_ssl_handshake returned" \ |
| 6851 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6852 | -c "Read from server: .* bytes read" |
| 6853 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6854 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6855 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6856 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6857 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6858 | "$P_CLI nbio=2 tickets=1" \ |
| 6859 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6860 | -S "mbedtls_ssl_handshake returned" \ |
| 6861 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6862 | -c "Read from server: .* bytes read" |
| 6863 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6864 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6865 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6866 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6867 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6868 | "$P_CLI nbio=2 tickets=1" \ |
| 6869 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6870 | -S "mbedtls_ssl_handshake returned" \ |
| 6871 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6872 | -c "Read from server: .* bytes read" |
| 6873 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6874 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6875 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6876 | 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] | 6877 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6878 | "$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] | 6879 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6880 | -S "mbedtls_ssl_handshake returned" \ |
| 6881 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6882 | -c "Read from server: .* bytes read" |
| 6883 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6884 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6885 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6886 | 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] | 6887 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6888 | run_test "Non-blocking I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 6889 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6890 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6891 | 0 \ |
| 6892 | -S "mbedtls_ssl_handshake returned" \ |
| 6893 | -C "mbedtls_ssl_handshake returned" \ |
| 6894 | -c "Read from server: .* bytes read" |
| 6895 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6896 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6897 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6898 | 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] | 6899 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6900 | "$P_CLI force_version=tls12 nbio=2 tickets=1 reconnect=1" \ |
| 6901 | 0 \ |
| 6902 | -S "mbedtls_ssl_handshake returned" \ |
| 6903 | -C "mbedtls_ssl_handshake returned" \ |
| 6904 | -c "Read from server: .* bytes read" |
| 6905 | |
| 6906 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6907 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6908 | 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] | 6909 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6910 | run_test "Non-blocking I/O: TLS 1.3 + ticket + resume" \ |
| 6911 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6912 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6913 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6914 | -S "mbedtls_ssl_handshake returned" \ |
| 6915 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6916 | -c "Read from server: .* bytes read" |
| 6917 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6918 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6919 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6920 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6921 | "$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] | 6922 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6923 | -S "mbedtls_ssl_handshake returned" \ |
| 6924 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6925 | -c "Read from server: .* bytes read" |
| 6926 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6927 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 6928 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6929 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6930 | run_test "Event-driven I/O: basic handshake" \ |
| 6931 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6932 | "$P_CLI event=1 tickets=0" \ |
| 6933 | 0 \ |
| 6934 | -S "mbedtls_ssl_handshake returned" \ |
| 6935 | -C "mbedtls_ssl_handshake returned" \ |
| 6936 | -c "Read from server: .* bytes read" |
| 6937 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6938 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6939 | run_test "Event-driven I/O: client auth" \ |
| 6940 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 6941 | "$P_CLI event=1 tickets=0" \ |
| 6942 | 0 \ |
| 6943 | -S "mbedtls_ssl_handshake returned" \ |
| 6944 | -C "mbedtls_ssl_handshake returned" \ |
| 6945 | -c "Read from server: .* bytes read" |
| 6946 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6947 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6948 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6949 | run_test "Event-driven I/O: ticket" \ |
| 6950 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6951 | "$P_CLI event=1 tickets=1" \ |
| 6952 | 0 \ |
| 6953 | -S "mbedtls_ssl_handshake returned" \ |
| 6954 | -C "mbedtls_ssl_handshake returned" \ |
| 6955 | -c "Read from server: .* bytes read" |
| 6956 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6957 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6958 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6959 | run_test "Event-driven I/O: ticket + client auth" \ |
| 6960 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6961 | "$P_CLI event=1 tickets=1" \ |
| 6962 | 0 \ |
| 6963 | -S "mbedtls_ssl_handshake returned" \ |
| 6964 | -C "mbedtls_ssl_handshake returned" \ |
| 6965 | -c "Read from server: .* bytes read" |
| 6966 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6967 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6968 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6969 | 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] | 6970 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6971 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6972 | 0 \ |
| 6973 | -S "mbedtls_ssl_handshake returned" \ |
| 6974 | -C "mbedtls_ssl_handshake returned" \ |
| 6975 | -c "Read from server: .* bytes read" |
| 6976 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6977 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6978 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6979 | 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] | 6980 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6981 | run_test "Event-driven I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 6982 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6983 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6984 | 0 \ |
| 6985 | -S "mbedtls_ssl_handshake returned" \ |
| 6986 | -C "mbedtls_ssl_handshake returned" \ |
| 6987 | -c "Read from server: .* bytes read" |
| 6988 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6989 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6990 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6991 | run_test "Event-driven I/O: TLS 1.2 + ticket + resume" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6992 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6993 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
| 6994 | 0 \ |
| 6995 | -S "mbedtls_ssl_handshake returned" \ |
| 6996 | -C "mbedtls_ssl_handshake returned" \ |
| 6997 | -c "Read from server: .* bytes read" |
| 6998 | |
| 6999 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7000 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 7001 | 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] | 7002 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7003 | run_test "Event-driven I/O: TLS 1.3 + ticket + resume" \ |
| 7004 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 7005 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7006 | 0 \ |
| 7007 | -S "mbedtls_ssl_handshake returned" \ |
| 7008 | -C "mbedtls_ssl_handshake returned" \ |
| 7009 | -c "Read from server: .* bytes read" |
| 7010 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7011 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7012 | run_test "Event-driven I/O: session-id resume" \ |
| 7013 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 7014 | "$P_CLI force_version=tls12 event=1 tickets=0 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7015 | 0 \ |
| 7016 | -S "mbedtls_ssl_handshake returned" \ |
| 7017 | -C "mbedtls_ssl_handshake returned" \ |
| 7018 | -c "Read from server: .* bytes read" |
| 7019 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7020 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7021 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 7022 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 7023 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 7024 | 0 \ |
| 7025 | -c "Read from server: .* bytes read" |
| 7026 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7027 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7028 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 7029 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 7030 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 7031 | 0 \ |
| 7032 | -c "Read from server: .* bytes read" |
| 7033 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7034 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7035 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7036 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 7037 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 7038 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 7039 | 0 \ |
| 7040 | -c "Read from server: .* bytes read" |
| 7041 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7042 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7043 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7044 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 7045 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 7046 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 7047 | 0 \ |
| 7048 | -c "Read from server: .* bytes read" |
| 7049 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7050 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7051 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7052 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 7053 | "$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] | 7054 | "$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] | 7055 | 0 \ |
| 7056 | -c "Read from server: .* bytes read" |
| 7057 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7058 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7059 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7060 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 7061 | "$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] | 7062 | "$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] | 7063 | 0 \ |
| 7064 | -c "Read from server: .* bytes read" |
| 7065 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7066 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7067 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 7068 | "$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] | 7069 | "$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] | 7070 | 0 \ |
| 7071 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7072 | |
| 7073 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 7074 | # During session resumption, the client will send its ApplicationData record |
| 7075 | # within the same datagram as the Finished messages. In this situation, the |
| 7076 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 7077 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7078 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7079 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7080 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7081 | "$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] | 7082 | "$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] | 7083 | 0 \ |
| 7084 | -c "Read from server: .* bytes read" |
| 7085 | |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7086 | # Tests for version negotiation. Some information to ease the understanding |
| 7087 | # of the version negotiation test titles below: |
| 7088 | # . 1.2/1.3 means that only TLS 1.2/TLS 1.3 is enabled. |
| 7089 | # . 1.2+1.3 means that both TLS 1.2 and TLS 1.3 are enabled. |
| 7090 | # . 1.2+(1.3)/(1.2)+1.3 means that TLS 1.2/1.3 is enabled and that |
| 7091 | # TLS 1.3/1.2 may be enabled or not. |
| 7092 | # . max=1.2 means that both TLS 1.2 and TLS 1.3 are enabled at build time but |
| 7093 | # TLS 1.3 is disabled at runtime (maximum negotiable version is TLS 1.2). |
| 7094 | # . min=1.3 means that both TLS 1.2 and TLS 1.3 are enabled at build time but |
| 7095 | # TLS 1.2 is disabled at runtime (minimum negotiable version is TLS 1.3). |
| 7096 | |
Ronald Cron | fe18d8d | 2024-03-06 15:19:55 +0100 | [diff] [blame] | 7097 | # Tests for version negotiation, MbedTLS client and server |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7098 | |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7099 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C |
| 7100 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7101 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7102 | 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] | 7103 | "$P_SRV" \ |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7104 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7105 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7106 | -S "mbedtls_ssl_handshake returned" \ |
| 7107 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7108 | -s "Protocol is TLSv1.2" \ |
| 7109 | -c "Protocol is TLSv1.2" |
| 7110 | |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7111 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7112 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7113 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7114 | 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] | 7115 | "$P_SRV max_version=tls12" \ |
| 7116 | "$P_CLI max_version=tls12" \ |
| 7117 | 0 \ |
| 7118 | -S "mbedtls_ssl_handshake returned" \ |
| 7119 | -C "mbedtls_ssl_handshake returned" \ |
| 7120 | -s "Protocol is TLSv1.2" \ |
| 7121 | -c "Protocol is TLSv1.2" |
| 7122 | |
| 7123 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7124 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 7125 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7126 | 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] | 7127 | "$P_SRV" \ |
| 7128 | "$P_CLI" \ |
| 7129 | 0 \ |
| 7130 | -S "mbedtls_ssl_handshake returned" \ |
| 7131 | -C "mbedtls_ssl_handshake returned" \ |
| 7132 | -s "Protocol is TLSv1.3" \ |
| 7133 | -c "Protocol is TLSv1.3" |
| 7134 | |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7135 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7136 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7137 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7138 | 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] | 7139 | "$P_SRV min_version=tls13" \ |
| 7140 | "$P_CLI min_version=tls13" \ |
| 7141 | 0 \ |
| 7142 | -S "mbedtls_ssl_handshake returned" \ |
| 7143 | -C "mbedtls_ssl_handshake returned" \ |
| 7144 | -s "Protocol is TLSv1.3" \ |
| 7145 | -c "Protocol is TLSv1.3" |
| 7146 | |
| 7147 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7148 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7149 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7150 | 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] | 7151 | "$P_SRV" \ |
| 7152 | "$P_CLI" \ |
| 7153 | 0 \ |
| 7154 | -S "mbedtls_ssl_handshake returned" \ |
| 7155 | -C "mbedtls_ssl_handshake returned" \ |
| 7156 | -s "Protocol is TLSv1.3" \ |
| 7157 | -c "Protocol is TLSv1.3" |
| 7158 | |
| 7159 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7160 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7161 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7162 | 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] | 7163 | "$P_SRV min_version=tls13" \ |
| 7164 | "$P_CLI" \ |
| 7165 | 0 \ |
| 7166 | -S "mbedtls_ssl_handshake returned" \ |
| 7167 | -C "mbedtls_ssl_handshake returned" \ |
| 7168 | -s "Protocol is TLSv1.3" \ |
| 7169 | -c "Protocol is TLSv1.3" |
| 7170 | |
| 7171 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7172 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7173 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7174 | 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] | 7175 | "$P_SRV max_version=tls12" \ |
| 7176 | "$P_CLI" \ |
| 7177 | 0 \ |
| 7178 | -S "mbedtls_ssl_handshake returned" \ |
| 7179 | -C "mbedtls_ssl_handshake returned" \ |
| 7180 | -s "Protocol is TLSv1.2" \ |
| 7181 | -c "Protocol is TLSv1.2" |
| 7182 | |
| 7183 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7184 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7185 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7186 | 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] | 7187 | "$P_SRV" \ |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7188 | "$P_CLI max_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7189 | 0 \ |
| 7190 | -S "mbedtls_ssl_handshake returned" \ |
| 7191 | -C "mbedtls_ssl_handshake returned" \ |
| 7192 | -s "Protocol is TLSv1.2" \ |
| 7193 | -c "Protocol is TLSv1.2" |
| 7194 | |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7195 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7196 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7197 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7198 | 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] | 7199 | "$P_SRV" \ |
| 7200 | "$P_CLI min_version=tls13" \ |
| 7201 | 0 \ |
| 7202 | -S "mbedtls_ssl_handshake returned" \ |
| 7203 | -C "mbedtls_ssl_handshake returned" \ |
| 7204 | -s "Protocol is TLSv1.3" \ |
| 7205 | -c "Protocol is TLSv1.3" |
| 7206 | |
| 7207 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7208 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7209 | 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] | 7210 | "$P_SRV min_version=tls13" \ |
| 7211 | "$P_CLI max_version=tls12" \ |
| 7212 | 1 \ |
| 7213 | -s "Handshake protocol not within min/max boundaries" \ |
| 7214 | -S "Protocol is TLSv1.2" \ |
| 7215 | -C "Protocol is TLSv1.2" \ |
| 7216 | -S "Protocol is TLSv1.3" \ |
| 7217 | -C "Protocol is TLSv1.3" |
Ronald Cron | fe18d8d | 2024-03-06 15:19:55 +0100 | [diff] [blame] | 7218 | |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7219 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7220 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7221 | 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] | 7222 | "$P_SRV max_version=tls12" \ |
| 7223 | "$P_CLI min_version=tls13" \ |
| 7224 | 1 \ |
| 7225 | -s "The handshake negotiation failed" \ |
| 7226 | -S "Protocol is TLSv1.2" \ |
| 7227 | -C "Protocol is TLSv1.2" \ |
| 7228 | -S "Protocol is TLSv1.3" \ |
| 7229 | -C "Protocol is TLSv1.3" |
| 7230 | |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7231 | # Tests of version negotiation on server side against GnuTLS client |
| 7232 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7233 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7234 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7235 | 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] | 7236 | "$P_SRV" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7237 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7238 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7239 | -S "mbedtls_ssl_handshake returned" \ |
| 7240 | -s "Protocol is TLSv1.2" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7241 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7242 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7243 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7244 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7245 | 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] | 7246 | "$P_SRV max_version=tls12" \ |
| 7247 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7248 | 0 \ |
| 7249 | -S "mbedtls_ssl_handshake returned" \ |
| 7250 | -s "Protocol is TLSv1.2" |
| 7251 | |
| 7252 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7253 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7254 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7255 | 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] | 7256 | "$P_SRV" \ |
| 7257 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7258 | 0 \ |
| 7259 | -S "mbedtls_ssl_handshake returned" \ |
| 7260 | -s "Protocol is TLSv1.3" |
| 7261 | |
| 7262 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7263 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7264 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7265 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7266 | 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] | 7267 | "$P_SRV min_version=tls13" \ |
| 7268 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7269 | 0 \ |
| 7270 | -S "mbedtls_ssl_handshake returned" \ |
| 7271 | -s "Protocol is TLSv1.3" |
| 7272 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7273 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7274 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7275 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7276 | 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] | 7277 | "$P_SRV" \ |
| 7278 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7279 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7280 | -S "mbedtls_ssl_handshake returned" \ |
| 7281 | -s "Protocol is TLSv1.3" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7282 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7283 | requires_gnutls_next_disable_tls13_compat |
| 7284 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7285 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7286 | 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] | 7287 | "$P_SRV" \ |
| 7288 | "$G_NEXT_CLI localhost --priority=NORMAL:%DISABLE_TLS13_COMPAT_MODE" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7289 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7290 | -S "mbedtls_ssl_handshake returned" \ |
| 7291 | -s "Protocol is TLSv1.3" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7292 | |
| 7293 | # GnuTLS can be setup to send a ClientHello containing a supported versions |
| 7294 | # extension proposing TLS 1.2 (preferred) and then TLS 1.3. In that case, |
| 7295 | # a TLS 1.3 and TLS 1.2 capable server is supposed to negotiate TLS 1.2 and |
| 7296 | # to indicate in the ServerHello that it downgrades from TLS 1.3. The GnuTLS |
| 7297 | # client then detects the downgrade indication and aborts the handshake even |
| 7298 | # if TLS 1.2 was its preferred version. Keeping the test even if the |
| 7299 | # handshake fails eventually as it exercices parts of the Mbed TLS |
| 7300 | # implementation that are otherwise not exercised. |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7301 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7302 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7303 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7304 | 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] | 7305 | "$P_SRV" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7306 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3" \ |
| 7307 | 1 \ |
| 7308 | -c "Detected downgrade to TLS 1.2 from TLS 1.3" |
| 7309 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7310 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7311 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7312 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7313 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7314 | 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] | 7315 | "$P_SRV min_version=tls13" \ |
| 7316 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7317 | 0 \ |
| 7318 | -S "mbedtls_ssl_handshake returned" \ |
| 7319 | -s "Protocol is TLSv1.3" |
| 7320 | |
| 7321 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7322 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7323 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7324 | 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] | 7325 | "$P_SRV" \ |
| 7326 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7327 | 0 \ |
| 7328 | -S "mbedtls_ssl_handshake returned" \ |
| 7329 | -s "Protocol is TLSv1.2" |
| 7330 | |
| 7331 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7332 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7333 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7334 | 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] | 7335 | "$P_SRV max_version=tls12" \ |
| 7336 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7337 | 0 \ |
| 7338 | -S "mbedtls_ssl_handshake returned" \ |
| 7339 | -s "Protocol is TLSv1.2" |
| 7340 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7341 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7342 | 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] | 7343 | "$P_SRV" \ |
| 7344 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 7345 | 1 \ |
| 7346 | -s "Handshake protocol not within min/max boundaries" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7347 | -S "Protocol is TLSv1.0" |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7348 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7349 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7350 | 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] | 7351 | "$P_SRV" \ |
| 7352 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 7353 | 1 \ |
| 7354 | -s "Handshake protocol not within min/max boundaries" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7355 | -S "Protocol is TLSv1.1" |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7356 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7357 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7358 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7359 | 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] | 7360 | "$P_SRV" \ |
| 7361 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7362 | 1 \ |
| 7363 | -s "Handshake protocol not within min/max boundaries" \ |
| 7364 | -S "Protocol is TLSv1.2" |
| 7365 | |
| 7366 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7367 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7368 | 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] | 7369 | "$P_SRV" \ |
| 7370 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7371 | 1 \ |
| 7372 | -S "Handshake protocol not within min/max boundaries" \ |
| 7373 | -s "The handshake negotiation failed" \ |
| 7374 | -S "Protocol is TLSv1.3" |
| 7375 | |
| 7376 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7377 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7378 | 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] | 7379 | "$P_SRV min_version=tls13" \ |
| 7380 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7381 | 1 \ |
| 7382 | -s "Handshake protocol not within min/max boundaries" \ |
| 7383 | -S "Protocol is TLSv1.2" |
| 7384 | |
| 7385 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7386 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7387 | 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] | 7388 | "$P_SRV max_version=tls12" \ |
| 7389 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7390 | 1 \ |
| 7391 | -S "Handshake protocol not within min/max boundaries" \ |
| 7392 | -s "The handshake negotiation failed" \ |
| 7393 | -S "Protocol is TLSv1.3" |
| 7394 | |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7395 | # Tests of version negotiation on server side against OpenSSL client |
| 7396 | |
| 7397 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_2 |
| 7398 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7399 | 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] | 7400 | "$P_SRV" \ |
| 7401 | "$O_NEXT_CLI -tls1_2" \ |
| 7402 | 0 \ |
| 7403 | -S "mbedtls_ssl_handshake returned" \ |
| 7404 | -s "Protocol is TLSv1.2" |
| 7405 | |
| 7406 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7407 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7408 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7409 | 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] | 7410 | "$P_SRV max_version=tls12" \ |
| 7411 | "$O_NEXT_CLI -tls1_2" \ |
| 7412 | 0 \ |
| 7413 | -S "mbedtls_ssl_handshake returned" \ |
| 7414 | -s "Protocol is TLSv1.2" |
| 7415 | |
| 7416 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7417 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7418 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7419 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7420 | 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] | 7421 | "$P_SRV" \ |
| 7422 | "$O_NEXT_CLI -tls1_3" \ |
| 7423 | 0 \ |
| 7424 | -S "mbedtls_ssl_handshake returned" \ |
| 7425 | -s "Protocol is TLSv1.3" |
| 7426 | |
| 7427 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7428 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7429 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7430 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7431 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7432 | 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] | 7433 | "$P_SRV min_version=tls13" \ |
| 7434 | "$O_NEXT_CLI -tls1_3" \ |
| 7435 | 0 \ |
| 7436 | -S "mbedtls_ssl_handshake returned" \ |
| 7437 | -s "Protocol is TLSv1.3" |
| 7438 | |
| 7439 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7440 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7441 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7442 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7443 | 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] | 7444 | "$P_SRV" \ |
| 7445 | "$O_NEXT_CLI" \ |
| 7446 | 0 \ |
| 7447 | -S "mbedtls_ssl_handshake returned" \ |
| 7448 | -s "Protocol is TLSv1.3" |
| 7449 | |
| 7450 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7451 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7452 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7453 | 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] | 7454 | "$P_SRV" \ |
| 7455 | "$O_NEXT_CLI -no_middlebox" \ |
| 7456 | 0 \ |
| 7457 | -S "mbedtls_ssl_handshake returned" \ |
| 7458 | -s "Protocol is TLSv1.3" |
| 7459 | |
| 7460 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7461 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7462 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7463 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7464 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7465 | 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] | 7466 | "$P_SRV min_version=tls13" \ |
| 7467 | "$O_NEXT_CLI" \ |
| 7468 | 0 \ |
| 7469 | -S "mbedtls_ssl_handshake returned" \ |
| 7470 | -s "Protocol is TLSv1.3" |
| 7471 | |
| 7472 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7473 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7474 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7475 | 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] | 7476 | "$P_SRV" \ |
| 7477 | "$O_NEXT_CLI" \ |
| 7478 | 0 \ |
| 7479 | -S "mbedtls_ssl_handshake returned" \ |
| 7480 | -s "Protocol is TLSv1.2" |
| 7481 | |
| 7482 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7483 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7484 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7485 | 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] | 7486 | "$P_SRV max_version=tls12" \ |
| 7487 | "$O_NEXT_CLI" \ |
| 7488 | 0 \ |
| 7489 | -S "mbedtls_ssl_handshake returned" \ |
| 7490 | -s "Protocol is TLSv1.2" |
| 7491 | |
| 7492 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7493 | 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] | 7494 | "$P_SRV" \ |
| 7495 | "$O_CLI -tls1" \ |
| 7496 | 1 \ |
| 7497 | -s "Handshake protocol not within min/max boundaries" \ |
| 7498 | -S "Protocol is TLSv1.0" |
| 7499 | |
| 7500 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7501 | 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] | 7502 | "$P_SRV" \ |
| 7503 | "$O_CLI -tls1_1" \ |
| 7504 | 1 \ |
| 7505 | -s "Handshake protocol not within min/max boundaries" \ |
| 7506 | -S "Protocol is TLSv1.1" |
| 7507 | |
| 7508 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7509 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7510 | 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] | 7511 | "$P_SRV" \ |
| 7512 | "$O_NEXT_CLI -tls1_2" \ |
| 7513 | 1 \ |
| 7514 | -s "Handshake protocol not within min/max boundaries" \ |
| 7515 | -S "Protocol is TLSv1.2" |
| 7516 | |
| 7517 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7518 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7519 | 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] | 7520 | "$P_SRV" \ |
| 7521 | "$O_NEXT_CLI -tls1_3" \ |
| 7522 | 1 \ |
| 7523 | -S "Handshake protocol not within min/max boundaries" \ |
| 7524 | -s "The handshake negotiation failed" \ |
| 7525 | -S "Protocol is TLSv1.3" |
| 7526 | |
| 7527 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7528 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7529 | 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] | 7530 | "$P_SRV min_version=tls13" \ |
| 7531 | "$O_NEXT_CLI -tls1_2" \ |
| 7532 | 1 \ |
| 7533 | -s "Handshake protocol not within min/max boundaries" \ |
| 7534 | -S "Protocol is TLSv1.2" |
| 7535 | |
| 7536 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7537 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7538 | 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] | 7539 | "$P_SRV max_version=tls12" \ |
| 7540 | "$O_NEXT_CLI -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 | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7546 | # Tests of version negotiation on client side against GnuTLS and OpenSSL server |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7547 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7548 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7549 | run_test "Not supported version: srv max TLS 1.0" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7550 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 7551 | "$P_CLI" \ |
| 7552 | 1 \ |
| 7553 | -s "Error in protocol version" \ |
| 7554 | -c "Handshake protocol not within min/max boundaries" \ |
| 7555 | -S "Version: TLS1.0" \ |
| 7556 | -C "Protocol is TLSv1.0" |
| 7557 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7558 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7559 | run_test "Not supported version: srv max TLS 1.1" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7560 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 7561 | "$P_CLI" \ |
| 7562 | 1 \ |
| 7563 | -s "Error in protocol version" \ |
| 7564 | -c "Handshake protocol not within min/max boundaries" \ |
| 7565 | -S "Version: TLS1.1" \ |
| 7566 | -C "Protocol is TLSv1.1" |
| 7567 | |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7568 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7569 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7570 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7571 | skip_handshake_stage_check |
| 7572 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7573 | 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] | 7574 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \ |
| 7575 | "$P_CLI debug_level=4" \ |
| 7576 | 1 \ |
| 7577 | -s "Client's version: 3.3" \ |
| 7578 | -S "Version: TLS1.0" \ |
| 7579 | -C "Protocol is TLSv1.0" |
| 7580 | |
| 7581 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7582 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7583 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7584 | skip_handshake_stage_check |
| 7585 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7586 | 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] | 7587 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \ |
| 7588 | "$P_CLI debug_level=4" \ |
| 7589 | 1 \ |
| 7590 | -s "Client's version: 3.3" \ |
| 7591 | -S "Version: TLS1.1" \ |
| 7592 | -C "Protocol is TLSv1.1" |
| 7593 | |
| 7594 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7595 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7596 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7597 | skip_handshake_stage_check |
| 7598 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7599 | run_test "TLS 1.3: Not supported version:gnutls: srv max TLS 1.2" \ |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7600 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \ |
| 7601 | "$P_CLI force_version=tls13 debug_level=4" \ |
| 7602 | 1 \ |
| 7603 | -s "Client's version: 3.3" \ |
| 7604 | -c "is a fatal alert message (msg 40)" \ |
| 7605 | -S "Version: TLS1.2" \ |
| 7606 | -C "Protocol is TLSv1.2" |
| 7607 | |
| 7608 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7609 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7610 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7611 | skip_handshake_stage_check |
| 7612 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7613 | 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] | 7614 | "$O_NEXT_SRV -msg -tls1" \ |
| 7615 | "$P_CLI debug_level=4" \ |
| 7616 | 1 \ |
| 7617 | -s "fatal protocol_version" \ |
| 7618 | -c "is a fatal alert message (msg 70)" \ |
| 7619 | -S "Version: TLS1.0" \ |
| 7620 | -C "Protocol : TLSv1.0" |
| 7621 | |
| 7622 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7623 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7624 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7625 | skip_handshake_stage_check |
| 7626 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7627 | 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] | 7628 | "$O_NEXT_SRV -msg -tls1_1" \ |
| 7629 | "$P_CLI debug_level=4" \ |
| 7630 | 1 \ |
| 7631 | -s "fatal protocol_version" \ |
| 7632 | -c "is a fatal alert message (msg 70)" \ |
| 7633 | -S "Version: TLS1.1" \ |
| 7634 | -C "Protocol : TLSv1.1" |
| 7635 | |
| 7636 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7637 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7638 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7639 | skip_handshake_stage_check |
| 7640 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7641 | 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] | 7642 | "$O_NEXT_SRV -msg -tls1_2" \ |
| 7643 | "$P_CLI force_version=tls13 debug_level=4" \ |
| 7644 | 1 \ |
| 7645 | -s "fatal protocol_version" \ |
| 7646 | -c "is a fatal alert message (msg 70)" \ |
| 7647 | -S "Version: TLS1.2" \ |
| 7648 | -C "Protocol : TLSv1.2" |
| 7649 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7650 | # Tests for ALPN extension |
| 7651 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7652 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7653 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7654 | "$P_SRV debug_level=3" \ |
| 7655 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7656 | 0 \ |
| 7657 | -C "client hello, adding alpn extension" \ |
| 7658 | -S "found alpn extension" \ |
| 7659 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7660 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7661 | -C "found alpn extension " \ |
| 7662 | -C "Application Layer Protocol is" \ |
| 7663 | -S "Application Layer Protocol is" |
| 7664 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7665 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7666 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7667 | "$P_SRV debug_level=3" \ |
| 7668 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7669 | 0 \ |
| 7670 | -c "client hello, adding alpn extension" \ |
| 7671 | -s "found alpn extension" \ |
| 7672 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7673 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7674 | -C "found alpn extension " \ |
| 7675 | -c "Application Layer Protocol is (none)" \ |
| 7676 | -S "Application Layer Protocol is" |
| 7677 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7678 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7679 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7680 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7681 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7682 | 0 \ |
| 7683 | -C "client hello, adding alpn extension" \ |
| 7684 | -S "found alpn extension" \ |
| 7685 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7686 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7687 | -C "found alpn extension " \ |
| 7688 | -C "Application Layer Protocol is" \ |
| 7689 | -s "Application Layer Protocol is (none)" |
| 7690 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7691 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7692 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7693 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7694 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7695 | 0 \ |
| 7696 | -c "client hello, adding alpn extension" \ |
| 7697 | -s "found alpn extension" \ |
| 7698 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7699 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7700 | -c "found alpn extension" \ |
| 7701 | -c "Application Layer Protocol is abc" \ |
| 7702 | -s "Application Layer Protocol is abc" |
| 7703 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7704 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7705 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7706 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7707 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7708 | 0 \ |
| 7709 | -c "client hello, adding alpn extension" \ |
| 7710 | -s "found alpn extension" \ |
| 7711 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7712 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7713 | -c "found alpn extension" \ |
| 7714 | -c "Application Layer Protocol is abc" \ |
| 7715 | -s "Application Layer Protocol is abc" |
| 7716 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7717 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7718 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7719 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7720 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7721 | 0 \ |
| 7722 | -c "client hello, adding alpn extension" \ |
| 7723 | -s "found alpn extension" \ |
| 7724 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7725 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7726 | -c "found alpn extension" \ |
| 7727 | -c "Application Layer Protocol is 1234" \ |
| 7728 | -s "Application Layer Protocol is 1234" |
| 7729 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7730 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7731 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7732 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 7733 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7734 | 1 \ |
| 7735 | -c "client hello, adding alpn extension" \ |
| 7736 | -s "found alpn extension" \ |
| 7737 | -c "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7738 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7739 | -C "found alpn extension" \ |
| 7740 | -C "Application Layer Protocol is 1234" \ |
| 7741 | -S "Application Layer Protocol is 1234" |
| 7742 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 7743 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7744 | # Tests for keyUsage in leaf certificates, part 1: |
| 7745 | # server-side certificate/suite selection |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7746 | # |
| 7747 | # This is only about 1.2 (for 1.3, all key exchanges use signatures). |
| 7748 | # In 4.0 this will probably go away as all TLS 1.2 key exchanges will use |
| 7749 | # 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] | 7750 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7751 | run_test "keyUsage srv 1.2: RSA, digitalSignature -> (EC)DHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7752 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7753 | crt_file=$DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7754 | "$P_CLI" \ |
| 7755 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 7756 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7757 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7758 | run_test "keyUsage srv 1.2: RSA, keyEncipherment -> RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7759 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7760 | crt_file=$DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7761 | "$P_CLI" \ |
| 7762 | 0 \ |
| 7763 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 7764 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7765 | run_test "keyUsage srv 1.2: RSA, keyAgreement -> fail" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7766 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7767 | crt_file=$DATA_FILES_PATH/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 7768 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7769 | 1 \ |
| 7770 | -C "Ciphersuite is " |
| 7771 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 7772 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7773 | run_test "keyUsage srv 1.2: ECC, digitalSignature -> ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7774 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7775 | crt_file=$DATA_FILES_PATH/server5.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7776 | "$P_CLI" \ |
| 7777 | 0 \ |
| 7778 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 7779 | |
| 7780 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7781 | run_test "keyUsage srv 1.2: ECC, keyAgreement -> ECDH-" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7782 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7783 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7784 | "$P_CLI" \ |
| 7785 | 0 \ |
| 7786 | -c "Ciphersuite is TLS-ECDH-" |
| 7787 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7788 | run_test "keyUsage srv 1.2: ECC, keyEncipherment -> fail" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7789 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7790 | crt_file=$DATA_FILES_PATH/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 7791 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7792 | 1 \ |
| 7793 | -C "Ciphersuite is " |
| 7794 | |
| 7795 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7796 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7797 | # |
| 7798 | # TLS 1.3 uses only signature, but for 1.2 it depends on the key exchange. |
| 7799 | # In 4.0 this will probably change as all TLS 1.2 key exchanges will use |
| 7800 | # 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] | 7801 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7802 | run_test "keyUsage cli 1.2: DigitalSignature+KeyEncipherment, RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7803 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7804 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7805 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7806 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7807 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7808 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7809 | -C "Processing of the Certificate handshake message failed" \ |
| 7810 | -c "Ciphersuite is TLS-" |
| 7811 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7812 | run_test "keyUsage cli 1.2: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7813 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7814 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7815 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7816 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7817 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7818 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7819 | -C "Processing of the Certificate handshake message failed" \ |
| 7820 | -c "Ciphersuite is TLS-" |
| 7821 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7822 | run_test "keyUsage cli 1.2: KeyEncipherment, RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7823 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7824 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7825 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7826 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7827 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7828 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7829 | -C "Processing of the Certificate handshake message failed" \ |
| 7830 | -c "Ciphersuite is TLS-" |
| 7831 | |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7832 | run_test "keyUsage cli 1.2: KeyEncipherment, DHE-RSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7833 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7834 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7835 | "$P_CLI debug_level=3 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7836 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7837 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7838 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7839 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7840 | -C "Ciphersuite is TLS-" \ |
| 7841 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7842 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7843 | # 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] | 7844 | |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7845 | run_test "keyUsage cli 1.2: KeyEncipherment, DHE-RSA: fail (soft)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7846 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7847 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7848 | "$P_CLI debug_level=3 auth_mode=optional \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7849 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7850 | 0 \ |
| 7851 | -c "bad certificate (usage extensions)" \ |
| 7852 | -C "Processing of the Certificate handshake message failed" \ |
| 7853 | -c "Ciphersuite is TLS-" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7854 | -C "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7855 | -c "! Usage does not match the keyUsage extension" |
| 7856 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7857 | run_test "keyUsage cli 1.2: DigitalSignature, DHE-RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7858 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7859 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7860 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7861 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7862 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7863 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7864 | -C "Processing of the Certificate handshake message failed" \ |
| 7865 | -c "Ciphersuite is TLS-" |
| 7866 | |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7867 | run_test "keyUsage cli 1.2: DigitalSignature, RSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7868 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7869 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7870 | "$P_CLI debug_level=3 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7871 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7872 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7873 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7874 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7875 | -C "Ciphersuite is TLS-" \ |
| 7876 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7877 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7878 | # 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] | 7879 | |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7880 | run_test "keyUsage cli 1.2: DigitalSignature, RSA: fail (soft)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7881 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7882 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7883 | "$P_CLI debug_level=3 auth_mode=optional \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7884 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7885 | 0 \ |
| 7886 | -c "bad certificate (usage extensions)" \ |
| 7887 | -C "Processing of the Certificate handshake message failed" \ |
| 7888 | -c "Ciphersuite is TLS-" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7889 | -C "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7890 | -c "! Usage does not match the keyUsage extension" |
| 7891 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7892 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7893 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7894 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7895 | run_test "keyUsage cli 1.3: DigitalSignature, RSA: OK" \ |
| 7896 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7897 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds.crt" \ |
| 7898 | "$P_CLI debug_level=3" \ |
| 7899 | 0 \ |
| 7900 | -C "bad certificate (usage extensions)" \ |
| 7901 | -C "Processing of the Certificate handshake message failed" \ |
| 7902 | -c "Ciphersuite is" |
| 7903 | |
| 7904 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7905 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7906 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7907 | run_test "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7908 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7909 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds_ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7910 | "$P_CLI debug_level=3" \ |
| 7911 | 0 \ |
| 7912 | -C "bad certificate (usage extensions)" \ |
| 7913 | -C "Processing of the Certificate handshake message failed" \ |
| 7914 | -c "Ciphersuite is" |
| 7915 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7916 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7917 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7918 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7919 | run_test "keyUsage cli 1.3: KeyEncipherment, RSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7920 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7921 | -cert $DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7922 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7923 | 1 \ |
| 7924 | -c "bad certificate (usage extensions)" \ |
| 7925 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7926 | -C "Ciphersuite is" \ |
| 7927 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7928 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7929 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7930 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7931 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7932 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7933 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7934 | run_test "keyUsage cli 1.3: KeyAgreement, RSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7935 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7936 | -cert $DATA_FILES_PATH/server2-sha256.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7937 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7938 | 1 \ |
| 7939 | -c "bad certificate (usage extensions)" \ |
| 7940 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7941 | -C "Ciphersuite is" \ |
| 7942 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7943 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7944 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7945 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7946 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7947 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7948 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7949 | run_test "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7950 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 7951 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7952 | "$P_CLI debug_level=3" \ |
| 7953 | 0 \ |
| 7954 | -C "bad certificate (usage extensions)" \ |
| 7955 | -C "Processing of the Certificate handshake message failed" \ |
| 7956 | -c "Ciphersuite is" |
| 7957 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7958 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7959 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7960 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7961 | run_test "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7962 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 7963 | -cert $DATA_FILES_PATH/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7964 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7965 | 1 \ |
| 7966 | -c "bad certificate (usage extensions)" \ |
| 7967 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7968 | -C "Ciphersuite is" \ |
| 7969 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7970 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7971 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7972 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7973 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7974 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7975 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7976 | run_test "keyUsage cli 1.3: KeyAgreement, ECDSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7977 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 7978 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7979 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7980 | 1 \ |
| 7981 | -c "bad certificate (usage extensions)" \ |
| 7982 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7983 | -C "Ciphersuite is" \ |
| 7984 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7985 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7986 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7987 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7988 | # Tests for keyUsage in leaf certificates, part 3: |
| 7989 | # server-side checking of client cert |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7990 | # |
| 7991 | # Here, both 1.2 and 1.3 only use signatures. |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7992 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7993 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7994 | run_test "keyUsage cli-auth 1.2: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7995 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7996 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7997 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7998 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 7999 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8000 | -S "bad certificate (usage extensions)" \ |
| 8001 | -S "Processing of the Certificate handshake message failed" |
| 8002 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8003 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8004 | 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] | 8005 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8006 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8007 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
| 8008 | 0 \ |
| 8009 | -s "Verifying peer X.509 certificate... ok" \ |
| 8010 | -S "bad certificate (usage extensions)" \ |
| 8011 | -S "Processing of the Certificate handshake message failed" |
| 8012 | |
| 8013 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8014 | run_test "keyUsage cli-auth 1.2: RSA, KeyEncipherment: fail (soft)" \ |
| 8015 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8016 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8017 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8018 | 0 \ |
| 8019 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8020 | -S "send alert level=2 message=43" \ |
| 8021 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8022 | -S "Processing of the Certificate handshake message failed" |
| 8023 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8024 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8025 | run_test "keyUsage cli-auth 1.2: RSA, KeyEncipherment: fail (hard)" \ |
| 8026 | "$P_SRV debug_level=3 force_version=tls12 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8027 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8028 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8029 | 1 \ |
| 8030 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8031 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8032 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8033 | -s "Processing of the Certificate handshake message failed" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8034 | # 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] | 8035 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8037 | run_test "keyUsage cli-auth 1.2: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8038 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8039 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8040 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8041 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8042 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8043 | -S "bad certificate (usage extensions)" \ |
| 8044 | -S "Processing of the Certificate handshake message failed" |
| 8045 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8046 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8047 | run_test "keyUsage cli-auth 1.2: ECDSA, KeyAgreement: fail (soft)" \ |
| 8048 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8049 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8050 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8051 | 0 \ |
| 8052 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8053 | -S "send alert level=2 message=43" \ |
| 8054 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8055 | -S "Processing of the Certificate handshake message failed" |
| 8056 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8057 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8058 | run_test "keyUsage cli-auth 1.2: ECDSA, KeyAgreement: fail (hard)" \ |
| 8059 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 8060 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8061 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
| 8062 | 1 \ |
| 8063 | -s "bad certificate (usage extensions)" \ |
| 8064 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8065 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8066 | -s "Processing of the Certificate handshake message failed" |
| 8067 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8068 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8069 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8070 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8071 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8072 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8073 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8074 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
| 8075 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8076 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8077 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8078 | -S "bad certificate (usage extensions)" \ |
| 8079 | -S "Processing of the Certificate handshake message failed" |
| 8080 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8081 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8082 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8083 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8084 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature+KeyEncipherment: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8085 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8086 | "$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] | 8087 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds_ke.crt" \ |
| 8088 | 0 \ |
| 8089 | -s "Verifying peer X.509 certificate... ok" \ |
| 8090 | -S "bad certificate (usage extensions)" \ |
| 8091 | -S "Processing of the Certificate handshake message failed" |
| 8092 | |
| 8093 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 8094 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8095 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 8096 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ |
| 8097 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
| 8098 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8099 | -cert $DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8100 | 0 \ |
| 8101 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8102 | -S "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8103 | -s "! Usage does not match the keyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8104 | -S "Processing of the Certificate handshake message failed" |
| 8105 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8106 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8107 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8108 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8109 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (hard)" \ |
| 8110 | "$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] | 8111 | "$P_CLI key_file=$DATA_FILES_PATH/server2.key \ |
| 8112 | crt_file=$DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
| 8113 | 1 \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8114 | -s "bad certificate (usage extensions)" \ |
| 8115 | -s "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8116 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8117 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8118 | -s "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8119 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8120 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8121 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8122 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8123 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8124 | run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8125 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8126 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8127 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8128 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8129 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8130 | -S "bad certificate (usage extensions)" \ |
| 8131 | -S "Processing of the Certificate handshake message failed" |
| 8132 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8133 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8134 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8135 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8136 | 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] | 8137 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8138 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8139 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8140 | 0 \ |
| 8141 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8142 | -s "! Usage does not match the keyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8143 | -S "Processing of the Certificate handshake message failed" |
| 8144 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8145 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 8146 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8147 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 8148 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (hard)" \ |
| 8149 | "$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] | 8150 | "$P_CLI key_file=$DATA_FILES_PATH/server5.key \ |
| 8151 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
| 8152 | 1 \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8153 | -s "bad certificate (usage extensions)" \ |
| 8154 | -s "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8155 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8156 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8157 | -s "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8158 | # 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] | 8159 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8160 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 8161 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 8162 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8163 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8164 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8165 | crt_file=$DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8166 | "$P_CLI" \ |
| 8167 | 0 |
| 8168 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 8169 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8170 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8171 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8172 | crt_file=$DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8173 | "$P_CLI" \ |
| 8174 | 0 |
| 8175 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 8176 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8177 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8178 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8179 | crt_file=$DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8180 | "$P_CLI" \ |
| 8181 | 0 |
| 8182 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 8183 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8184 | run_test "extKeyUsage srv: codeSign -> fail" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8185 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8186 | crt_file=$DATA_FILES_PATH/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 8187 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8188 | 1 |
| 8189 | |
| 8190 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 8191 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8192 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8193 | run_test "extKeyUsage cli 1.2: serverAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8194 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8195 | -cert $DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8196 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8197 | 0 \ |
| 8198 | -C "bad certificate (usage extensions)" \ |
| 8199 | -C "Processing of the Certificate handshake message failed" \ |
| 8200 | -c "Ciphersuite is TLS-" |
| 8201 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8202 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8203 | run_test "extKeyUsage cli 1.2: serverAuth,clientAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8204 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8205 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8206 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8207 | 0 \ |
| 8208 | -C "bad certificate (usage extensions)" \ |
| 8209 | -C "Processing of the Certificate handshake message failed" \ |
| 8210 | -c "Ciphersuite is TLS-" |
| 8211 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8213 | run_test "extKeyUsage cli 1.2: codeSign,anyEKU -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8214 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8215 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8216 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8217 | 0 \ |
| 8218 | -C "bad certificate (usage extensions)" \ |
| 8219 | -C "Processing of the Certificate handshake message failed" \ |
| 8220 | -c "Ciphersuite is TLS-" |
| 8221 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8222 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | f48bfb0 | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8223 | run_test "extKeyUsage cli 1.2: codeSign -> fail (soft)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8224 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8225 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | f48bfb0 | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8226 | "$P_CLI debug_level=3 auth_mode=optional" \ |
| 8227 | 0 \ |
| 8228 | -c "bad certificate (usage extensions)" \ |
| 8229 | -C "Processing of the Certificate handshake message failed" \ |
| 8230 | -c "Ciphersuite is TLS-" \ |
| 8231 | -C "send alert level=2 message=43" \ |
| 8232 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8233 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8234 | |
| 8235 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8236 | run_test "extKeyUsage cli 1.2: codeSign -> fail (hard)" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 8237 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8238 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8239 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8240 | 1 \ |
| 8241 | -c "bad certificate (usage extensions)" \ |
| 8242 | -c "Processing of the Certificate handshake message failed" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8243 | -C "Ciphersuite is TLS-" \ |
| 8244 | -c "send alert level=2 message=43" \ |
| 8245 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8246 | # 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] | 8247 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8248 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8249 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8250 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8251 | run_test "extKeyUsage cli 1.3: serverAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8252 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8253 | -cert $DATA_FILES_PATH/server5.eku-srv.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8254 | "$P_CLI debug_level=1" \ |
| 8255 | 0 \ |
| 8256 | -C "bad certificate (usage extensions)" \ |
| 8257 | -C "Processing of the Certificate handshake message failed" \ |
| 8258 | -c "Ciphersuite is" |
| 8259 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8260 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8261 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8262 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8263 | run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8264 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8265 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8266 | "$P_CLI debug_level=1" \ |
| 8267 | 0 \ |
| 8268 | -C "bad certificate (usage extensions)" \ |
| 8269 | -C "Processing of the Certificate handshake message failed" \ |
| 8270 | -c "Ciphersuite is" |
| 8271 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8272 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8273 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8274 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8275 | run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8276 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8277 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8278 | "$P_CLI debug_level=1" \ |
| 8279 | 0 \ |
| 8280 | -C "bad certificate (usage extensions)" \ |
| 8281 | -C "Processing of the Certificate handshake message failed" \ |
| 8282 | -c "Ciphersuite is" |
| 8283 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8284 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8285 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8286 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8287 | run_test "extKeyUsage cli 1.3: codeSign -> fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8288 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8289 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8290 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8291 | 1 \ |
| 8292 | -c "bad certificate (usage extensions)" \ |
| 8293 | -c "Processing of the Certificate handshake message failed" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8294 | -C "Ciphersuite is" \ |
| 8295 | -c "send alert level=2 message=43" \ |
| 8296 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8297 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8298 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8299 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 8300 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8301 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8302 | run_test "extKeyUsage cli-auth 1.2: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8303 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8304 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8305 | -cert $DATA_FILES_PATH/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8306 | 0 \ |
| 8307 | -S "bad certificate (usage extensions)" \ |
| 8308 | -S "Processing of the Certificate handshake message failed" |
| 8309 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8310 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8311 | run_test "extKeyUsage cli-auth 1.2: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8312 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8313 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8314 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8315 | 0 \ |
| 8316 | -S "bad certificate (usage extensions)" \ |
| 8317 | -S "Processing of the Certificate handshake message failed" |
| 8318 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8319 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8320 | run_test "extKeyUsage cli-auth 1.2: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8321 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8322 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8323 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8324 | 0 \ |
| 8325 | -S "bad certificate (usage extensions)" \ |
| 8326 | -S "Processing of the Certificate handshake message failed" |
| 8327 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8328 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8329 | run_test "extKeyUsage cli-auth 1.2: codeSign -> fail (soft)" \ |
| 8330 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8331 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8332 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8333 | 0 \ |
| 8334 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8335 | -S "send alert level=2 message=43" \ |
| 8336 | -s "! Usage does not match the extendedKeyUsage extension" \ |
| 8337 | -S "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8338 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8339 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8340 | run_test "extKeyUsage cli-auth 1.2: codeSign -> fail (hard)" \ |
| 8341 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8342 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8343 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8344 | 1 \ |
| 8345 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8346 | -s "send alert level=2 message=43" \ |
| 8347 | -s "! Usage does not match the extendedKeyUsage extension" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8348 | -s "Processing of the Certificate handshake message failed" |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8349 | # 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] | 8350 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8351 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8352 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8353 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8354 | run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8355 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8356 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8357 | -cert $DATA_FILES_PATH/server5.eku-cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8358 | 0 \ |
| 8359 | -S "bad certificate (usage extensions)" \ |
| 8360 | -S "Processing of the Certificate handshake message failed" |
| 8361 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8362 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8363 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8364 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8365 | run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8366 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8367 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8368 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8369 | 0 \ |
| 8370 | -S "bad certificate (usage extensions)" \ |
| 8371 | -S "Processing of the Certificate handshake message failed" |
| 8372 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8373 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8374 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8375 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8376 | run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8377 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8378 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8379 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8380 | 0 \ |
| 8381 | -S "bad certificate (usage extensions)" \ |
| 8382 | -S "Processing of the Certificate handshake message failed" |
| 8383 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8384 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8385 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8386 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8387 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8388 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8389 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8390 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8391 | 0 \ |
| 8392 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8393 | -S "send alert level=2 message=43" \ |
| 8394 | -s "! Usage does not match the extendedKeyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8395 | -S "Processing of the Certificate handshake message failed" |
| 8396 | |
Elena Uziunaite | f48bfb0 | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8397 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 8398 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8399 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 8400 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (hard)" \ |
| 8401 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=required" \ |
| 8402 | "$P_CLI key_file=$DATA_FILES_PATH/server5.key \ |
| 8403 | crt_file=$DATA_FILES_PATH/server5.eku-cs.crt" \ |
| 8404 | 1 \ |
| 8405 | -s "bad certificate (usage extensions)" \ |
| 8406 | -s "send alert level=2 message=43" \ |
| 8407 | -s "! Usage does not match the extendedKeyUsage extension" \ |
| 8408 | -s "Processing of the Certificate handshake message failed" |
| 8409 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8410 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8411 | # Tests for DHM parameters loading |
| 8412 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8413 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8414 | "$P_SRV" \ |
| 8415 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8416 | debug_level=3" \ |
| 8417 | 0 \ |
| 8418 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 8419 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8420 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8421 | run_test "DHM parameters: other parameters" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8422 | "$P_SRV dhm_file=$DATA_FILES_PATH/dhparams.pem" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8423 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8424 | debug_level=3" \ |
| 8425 | 0 \ |
| 8426 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 8427 | -c "value of 'DHM: G ' (2 bits)" |
| 8428 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8429 | # Tests for DHM client-side size checking |
| 8430 | |
| 8431 | run_test "DHM size: server default, client default, OK" \ |
| 8432 | "$P_SRV" \ |
| 8433 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8434 | debug_level=1" \ |
| 8435 | 0 \ |
| 8436 | -C "DHM prime too short:" |
| 8437 | |
| 8438 | run_test "DHM size: server default, client 2048, OK" \ |
| 8439 | "$P_SRV" \ |
| 8440 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8441 | debug_level=1 dhmlen=2048" \ |
| 8442 | 0 \ |
| 8443 | -C "DHM prime too short:" |
| 8444 | |
| 8445 | run_test "DHM size: server 1024, client default, OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8446 | "$P_SRV dhm_file=$DATA_FILES_PATH/dhparams.pem" \ |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8447 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8448 | debug_level=1" \ |
| 8449 | 0 \ |
| 8450 | -C "DHM prime too short:" |
| 8451 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8452 | run_test "DHM size: server 999, client 999, OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8453 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.999.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8454 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8455 | debug_level=1 dhmlen=999" \ |
| 8456 | 0 \ |
| 8457 | -C "DHM prime too short:" |
| 8458 | |
| 8459 | run_test "DHM size: server 1000, client 1000, OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8460 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8461 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8462 | debug_level=1 dhmlen=1000" \ |
| 8463 | 0 \ |
| 8464 | -C "DHM prime too short:" |
| 8465 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8466 | run_test "DHM size: server 1000, client default, rejected" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8467 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8468 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8469 | debug_level=1" \ |
| 8470 | 1 \ |
| 8471 | -c "DHM prime too short:" |
| 8472 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8473 | run_test "DHM size: server 1000, client 1001, rejected" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8474 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8475 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8476 | debug_level=1 dhmlen=1001" \ |
| 8477 | 1 \ |
| 8478 | -c "DHM prime too short:" |
| 8479 | |
| 8480 | run_test "DHM size: server 999, client 1000, rejected" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8481 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.999.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8482 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8483 | debug_level=1 dhmlen=1000" \ |
| 8484 | 1 \ |
| 8485 | -c "DHM prime too short:" |
| 8486 | |
| 8487 | run_test "DHM size: server 998, client 999, rejected" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8488 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.998.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8489 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8490 | debug_level=1 dhmlen=999" \ |
| 8491 | 1 \ |
| 8492 | -c "DHM prime too short:" |
| 8493 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8494 | run_test "DHM size: server default, client 2049, rejected" \ |
| 8495 | "$P_SRV" \ |
| 8496 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8497 | debug_level=1 dhmlen=2049" \ |
| 8498 | 1 \ |
| 8499 | -c "DHM prime too short:" |
| 8500 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8501 | # Tests for PSK callback |
| 8502 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8503 | run_test "PSK callback: psk, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8504 | "$P_SRV psk=73776f726466697368 psk_identity=foo" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8505 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8506 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8507 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8508 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 8509 | -S "SSL - Unknown identity received" \ |
| 8510 | -S "SSL - Verification of the message MAC failed" |
| 8511 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8512 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8513 | run_test "PSK callback: opaque psk on client, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8514 | "$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] | 8515 | "$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] | 8516 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8517 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8518 | -C "session hash for extended master secret"\ |
| 8519 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8520 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8521 | -S "SSL - Unknown identity received" \ |
| 8522 | -S "SSL - Verification of the message MAC failed" |
| 8523 | |
| 8524 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8525 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8526 | "$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] | 8527 | "$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] | 8528 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8529 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8530 | -C "session hash for extended master secret"\ |
| 8531 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8532 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8533 | -S "SSL - Unknown identity received" \ |
| 8534 | -S "SSL - Verification of the message MAC failed" |
| 8535 | |
| 8536 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8537 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8538 | "$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] | 8539 | "$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] | 8540 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8541 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8542 | -c "session hash for extended master secret"\ |
| 8543 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8544 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8545 | -S "SSL - Unknown identity received" \ |
| 8546 | -S "SSL - Verification of the message MAC failed" |
| 8547 | |
| 8548 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8549 | 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] | 8550 | "$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] | 8551 | "$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] | 8552 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8553 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8554 | -c "session hash for extended master secret"\ |
| 8555 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8556 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8557 | -S "SSL - Unknown identity received" \ |
| 8558 | -S "SSL - Verification of the message MAC failed" |
| 8559 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8560 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8561 | run_test "PSK callback: opaque rsa-psk on client, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8562 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8563 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8564 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8565 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8566 | -C "session hash for extended master secret"\ |
| 8567 | -S "session hash for extended master secret"\ |
| 8568 | -S "SSL - The handshake negotiation failed" \ |
| 8569 | -S "SSL - Unknown identity received" \ |
| 8570 | -S "SSL - Verification of the message MAC failed" |
| 8571 | |
| 8572 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8573 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8574 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8575 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8576 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8577 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8578 | -C "session hash for extended master secret"\ |
| 8579 | -S "session hash for extended master secret"\ |
| 8580 | -S "SSL - The handshake negotiation failed" \ |
| 8581 | -S "SSL - Unknown identity received" \ |
| 8582 | -S "SSL - Verification of the message MAC failed" |
| 8583 | |
| 8584 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8585 | run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8586 | "$P_SRV extended_ms=1 debug_level=3 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8587 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8588 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8589 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8590 | -c "session hash for extended master secret"\ |
| 8591 | -s "session hash for extended master secret"\ |
| 8592 | -S "SSL - The handshake negotiation failed" \ |
| 8593 | -S "SSL - Unknown identity received" \ |
| 8594 | -S "SSL - Verification of the message MAC failed" |
| 8595 | |
| 8596 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8597 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8598 | "$P_SRV extended_ms=1 debug_level=3 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8599 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8600 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8601 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8602 | -c "session hash for extended master secret"\ |
| 8603 | -s "session hash for extended master secret"\ |
| 8604 | -S "SSL - The handshake negotiation failed" \ |
| 8605 | -S "SSL - Unknown identity received" \ |
| 8606 | -S "SSL - Verification of the message MAC failed" |
| 8607 | |
| 8608 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8609 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8610 | "$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] | 8611 | "$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] | 8612 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8613 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8614 | -C "session hash for extended master secret"\ |
| 8615 | -S "session hash for extended master secret"\ |
| 8616 | -S "SSL - The handshake negotiation failed" \ |
| 8617 | -S "SSL - Unknown identity received" \ |
| 8618 | -S "SSL - Verification of the message MAC failed" |
| 8619 | |
| 8620 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8621 | 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] | 8622 | "$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] | 8623 | "$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] | 8624 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8625 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8626 | -C "session hash for extended master secret"\ |
| 8627 | -S "session hash for extended master secret"\ |
| 8628 | -S "SSL - The handshake negotiation failed" \ |
| 8629 | -S "SSL - Unknown identity received" \ |
| 8630 | -S "SSL - Verification of the message MAC failed" |
| 8631 | |
| 8632 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8633 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8634 | "$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] | 8635 | "$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] | 8636 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8637 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8638 | -c "session hash for extended master secret"\ |
| 8639 | -s "session hash for extended master secret"\ |
| 8640 | -S "SSL - The handshake negotiation failed" \ |
| 8641 | -S "SSL - Unknown identity received" \ |
| 8642 | -S "SSL - Verification of the message MAC failed" |
| 8643 | |
| 8644 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8645 | 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] | 8646 | "$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] | 8647 | "$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] | 8648 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8649 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8650 | -c "session hash for extended master secret"\ |
| 8651 | -s "session hash for extended master secret"\ |
| 8652 | -S "SSL - The handshake negotiation failed" \ |
| 8653 | -S "SSL - Unknown identity received" \ |
| 8654 | -S "SSL - Verification of the message MAC failed" |
| 8655 | |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8656 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8657 | run_test "PSK callback: opaque dhe-psk on client, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8658 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8659 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA256 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8660 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8661 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8662 | -C "session hash for extended master secret"\ |
| 8663 | -S "session hash for extended master secret"\ |
| 8664 | -S "SSL - The handshake negotiation failed" \ |
| 8665 | -S "SSL - Unknown identity received" \ |
| 8666 | -S "SSL - Verification of the message MAC failed" |
| 8667 | |
| 8668 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8669 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8670 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8671 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8672 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8673 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8674 | -C "session hash for extended master secret"\ |
| 8675 | -S "session hash for extended master secret"\ |
| 8676 | -S "SSL - The handshake negotiation failed" \ |
| 8677 | -S "SSL - Unknown identity received" \ |
| 8678 | -S "SSL - Verification of the message MAC failed" |
| 8679 | |
| 8680 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8681 | run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8682 | "$P_SRV extended_ms=1 debug_level=3 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8683 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8684 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8685 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8686 | -c "session hash for extended master secret"\ |
| 8687 | -s "session hash for extended master secret"\ |
| 8688 | -S "SSL - The handshake negotiation failed" \ |
| 8689 | -S "SSL - Unknown identity received" \ |
| 8690 | -S "SSL - Verification of the message MAC failed" |
| 8691 | |
| 8692 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8693 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8694 | "$P_SRV extended_ms=1 debug_level=3 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8695 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8696 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8697 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8698 | -c "session hash for extended master secret"\ |
| 8699 | -s "session hash for extended master secret"\ |
| 8700 | -S "SSL - The handshake negotiation failed" \ |
| 8701 | -S "SSL - Unknown identity received" \ |
| 8702 | -S "SSL - Verification of the message MAC failed" |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8703 | |
| 8704 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8705 | 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] | 8706 | "$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] | 8707 | "$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] | 8708 | psk_identity=foo psk=73776f726466697368" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8709 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8710 | -C "session hash for extended master secret"\ |
| 8711 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8712 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8713 | -S "SSL - Unknown identity received" \ |
| 8714 | -S "SSL - Verification of the message MAC failed" |
| 8715 | |
| 8716 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8717 | 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] | 8718 | "$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] | 8719 | "$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] | 8720 | psk_identity=foo psk=73776f726466697368" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8721 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8722 | -C "session hash for extended master secret"\ |
| 8723 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8724 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8725 | -S "SSL - Unknown identity received" \ |
| 8726 | -S "SSL - Verification of the message MAC failed" |
| 8727 | |
| 8728 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8729 | 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] | 8730 | "$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] | 8731 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8732 | "$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] | 8733 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8734 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8735 | -c "session hash for extended master secret"\ |
| 8736 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8737 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8738 | -S "SSL - Unknown identity received" \ |
| 8739 | -S "SSL - Verification of the message MAC failed" |
| 8740 | |
| 8741 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8742 | 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] | 8743 | "$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] | 8744 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8745 | "$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] | 8746 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8747 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8748 | -c "session hash for extended master secret"\ |
| 8749 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8750 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8751 | -S "SSL - Unknown identity received" \ |
| 8752 | -S "SSL - Verification of the message MAC failed" |
| 8753 | |
| 8754 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8755 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8756 | "$P_SRV extended_ms=0 debug_level=5 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8757 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8758 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8759 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8760 | -C "session hash for extended master secret"\ |
| 8761 | -S "session hash for extended master secret"\ |
| 8762 | -S "SSL - The handshake negotiation failed" \ |
| 8763 | -S "SSL - Unknown identity received" \ |
| 8764 | -S "SSL - Verification of the message MAC failed" |
| 8765 | |
| 8766 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8767 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, SHA-384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8768 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8769 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8770 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8771 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8772 | -C "session hash for extended master secret"\ |
| 8773 | -S "session hash for extended master secret"\ |
| 8774 | -S "SSL - The handshake negotiation failed" \ |
| 8775 | -S "SSL - Unknown identity received" \ |
| 8776 | -S "SSL - Verification of the message MAC failed" |
| 8777 | |
| 8778 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8779 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8780 | "$P_SRV debug_level=3 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8781 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8782 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8783 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8784 | 0 \ |
| 8785 | -c "session hash for extended master secret"\ |
| 8786 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8787 | -S "SSL - The handshake negotiation failed" \ |
| 8788 | -S "SSL - Unknown identity received" \ |
| 8789 | -S "SSL - Verification of the message MAC failed" |
| 8790 | |
| 8791 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8792 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8793 | "$P_SRV debug_level=3 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8794 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8795 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8796 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8797 | 0 \ |
| 8798 | -c "session hash for extended master secret"\ |
| 8799 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8800 | -S "SSL - The handshake negotiation failed" \ |
| 8801 | -S "SSL - Unknown identity received" \ |
| 8802 | -S "SSL - Verification of the message MAC failed" |
| 8803 | |
| 8804 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8805 | 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] | 8806 | "$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] | 8807 | "$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] | 8808 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8809 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8810 | -C "session hash for extended master secret"\ |
| 8811 | -S "session hash for extended master secret"\ |
| 8812 | -S "SSL - The handshake negotiation failed" \ |
| 8813 | -S "SSL - Unknown identity received" \ |
| 8814 | -S "SSL - Verification of the message MAC failed" |
| 8815 | |
| 8816 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8817 | 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] | 8818 | "$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] | 8819 | "$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] | 8820 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8821 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8822 | -C "session hash for extended master secret"\ |
| 8823 | -S "session hash for extended master secret"\ |
| 8824 | -S "SSL - The handshake negotiation failed" \ |
| 8825 | -S "SSL - Unknown identity received" \ |
| 8826 | -S "SSL - Verification of the message MAC failed" |
| 8827 | |
| 8828 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8829 | 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] | 8830 | "$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] | 8831 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8832 | "$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] | 8833 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8834 | 0 \ |
| 8835 | -c "session hash for extended master secret"\ |
| 8836 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8837 | -S "SSL - The handshake negotiation failed" \ |
| 8838 | -S "SSL - Unknown identity received" \ |
| 8839 | -S "SSL - Verification of the message MAC failed" |
| 8840 | |
| 8841 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8842 | 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] | 8843 | "$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] | 8844 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8845 | "$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] | 8846 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8847 | 0 \ |
| 8848 | -c "session hash for extended master secret"\ |
| 8849 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8850 | -S "SSL - The handshake negotiation failed" \ |
| 8851 | -S "SSL - Unknown identity received" \ |
| 8852 | -S "SSL - Verification of the message MAC failed" |
| 8853 | |
| 8854 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8855 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8856 | "$P_SRV extended_ms=0 debug_level=5 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8857 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8858 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8859 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8860 | -C "session hash for extended master secret"\ |
| 8861 | -S "session hash for extended master secret"\ |
| 8862 | -S "SSL - The handshake negotiation failed" \ |
| 8863 | -S "SSL - Unknown identity received" \ |
| 8864 | -S "SSL - Verification of the message MAC failed" |
| 8865 | |
| 8866 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8867 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, SHA-384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8868 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8869 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8870 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8871 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8872 | -C "session hash for extended master secret"\ |
| 8873 | -S "session hash for extended master secret"\ |
| 8874 | -S "SSL - The handshake negotiation failed" \ |
| 8875 | -S "SSL - Unknown identity received" \ |
| 8876 | -S "SSL - Verification of the message MAC failed" |
| 8877 | |
| 8878 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8879 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8880 | "$P_SRV debug_level=3 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8881 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8882 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8883 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8884 | 0 \ |
| 8885 | -c "session hash for extended master secret"\ |
| 8886 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8887 | -S "SSL - The handshake negotiation failed" \ |
| 8888 | -S "SSL - Unknown identity received" \ |
| 8889 | -S "SSL - Verification of the message MAC failed" |
| 8890 | |
| 8891 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8892 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8893 | "$P_SRV debug_level=3 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8894 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8895 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8896 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8897 | 0 \ |
| 8898 | -c "session hash for extended master secret"\ |
| 8899 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8900 | -S "SSL - The handshake negotiation failed" \ |
| 8901 | -S "SSL - Unknown identity received" \ |
| 8902 | -S "SSL - Verification of the message MAC failed" |
| 8903 | |
| 8904 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8905 | 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] | 8906 | "$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" \ |
| 8907 | "$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] | 8908 | psk_identity=def psk=beef" \ |
| 8909 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8910 | -C "session hash for extended master secret"\ |
| 8911 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8912 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8913 | -S "SSL - Unknown identity received" \ |
| 8914 | -S "SSL - Verification of the message MAC failed" |
| 8915 | |
| 8916 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8917 | 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] | 8918 | "$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" \ |
| 8919 | "$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] | 8920 | psk_identity=def psk=beef" \ |
| 8921 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8922 | -C "session hash for extended master secret"\ |
| 8923 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8924 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8925 | -S "SSL - Unknown identity received" \ |
| 8926 | -S "SSL - Verification of the message MAC failed" |
| 8927 | |
| 8928 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8929 | 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] | 8930 | "$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] | 8931 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8932 | "$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] | 8933 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8934 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8935 | -c "session hash for extended master secret"\ |
| 8936 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8937 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8938 | -S "SSL - Unknown identity received" \ |
| 8939 | -S "SSL - Verification of the message MAC failed" |
| 8940 | |
| 8941 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8942 | 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] | 8943 | "$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] | 8944 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8945 | "$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] | 8946 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8947 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8948 | -c "session hash for extended master secret"\ |
| 8949 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8950 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8951 | -S "SSL - Unknown identity received" \ |
| 8952 | -S "SSL - Verification of the message MAC failed" |
| 8953 | |
| 8954 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8955 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ |
| 8956 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA" \ |
| 8957 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 8958 | psk_identity=def psk=beef" \ |
| 8959 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8960 | -C "session hash for extended master secret"\ |
| 8961 | -S "session hash for extended master secret"\ |
| 8962 | -S "SSL - The handshake negotiation failed" \ |
| 8963 | -S "SSL - Unknown identity received" \ |
| 8964 | -S "SSL - Verification of the message MAC failed" |
| 8965 | |
| 8966 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8967 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ |
| 8968 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384" \ |
| 8969 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 8970 | psk_identity=def psk=beef" \ |
| 8971 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8972 | -C "session hash for extended master secret"\ |
| 8973 | -S "session hash for extended master secret"\ |
| 8974 | -S "SSL - The handshake negotiation failed" \ |
| 8975 | -S "SSL - Unknown identity received" \ |
| 8976 | -S "SSL - Verification of the message MAC failed" |
| 8977 | |
| 8978 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8979 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ |
| 8980 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 8981 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8982 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 8983 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8984 | 0 \ |
| 8985 | -c "session hash for extended master secret"\ |
| 8986 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8987 | -S "SSL - The handshake negotiation failed" \ |
| 8988 | -S "SSL - Unknown identity received" \ |
| 8989 | -S "SSL - Verification of the message MAC failed" |
| 8990 | |
| 8991 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8992 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \ |
| 8993 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 8994 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8995 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 8996 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8997 | 0 \ |
| 8998 | -c "session hash for extended master secret"\ |
| 8999 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9000 | -S "SSL - The handshake negotiation failed" \ |
| 9001 | -S "SSL - Unknown identity received" \ |
| 9002 | -S "SSL - Verification of the message MAC failed" |
| 9003 | |
| 9004 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9005 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 9006 | "$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" \ |
| 9007 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9008 | psk_identity=def psk=beef" \ |
| 9009 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9010 | -C "session hash for extended master secret"\ |
| 9011 | -S "session hash for extended master secret"\ |
| 9012 | -S "SSL - The handshake negotiation failed" \ |
| 9013 | -S "SSL - Unknown identity received" \ |
| 9014 | -S "SSL - Verification of the message MAC failed" |
| 9015 | |
| 9016 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9017 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 9018 | "$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" \ |
| 9019 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9020 | psk_identity=def psk=beef" \ |
| 9021 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9022 | -C "session hash for extended master secret"\ |
| 9023 | -S "session hash for extended master secret"\ |
| 9024 | -S "SSL - The handshake negotiation failed" \ |
| 9025 | -S "SSL - Unknown identity received" \ |
| 9026 | -S "SSL - Verification of the message MAC failed" |
| 9027 | |
| 9028 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9029 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 9030 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9031 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 9032 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9033 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9034 | 0 \ |
| 9035 | -c "session hash for extended master secret"\ |
| 9036 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9037 | -S "SSL - The handshake negotiation failed" \ |
| 9038 | -S "SSL - Unknown identity received" \ |
| 9039 | -S "SSL - Verification of the message MAC failed" |
| 9040 | |
| 9041 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9042 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 9043 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9044 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 9045 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9046 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9047 | 0 \ |
| 9048 | -c "session hash for extended master secret"\ |
| 9049 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9050 | -S "SSL - The handshake negotiation failed" \ |
| 9051 | -S "SSL - Unknown identity received" \ |
| 9052 | -S "SSL - Verification of the message MAC failed" |
| 9053 | |
| 9054 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9055 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ |
| 9056 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 9057 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9058 | psk_identity=def psk=beef" \ |
| 9059 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9060 | -C "session hash for extended master secret"\ |
| 9061 | -S "session hash for extended master secret"\ |
| 9062 | -S "SSL - The handshake negotiation failed" \ |
| 9063 | -S "SSL - Unknown identity received" \ |
| 9064 | -S "SSL - Verification of the message MAC failed" |
| 9065 | |
| 9066 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9067 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ |
| 9068 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384" \ |
| 9069 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9070 | psk_identity=def psk=beef" \ |
| 9071 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9072 | -C "session hash for extended master secret"\ |
| 9073 | -S "session hash for extended master secret"\ |
| 9074 | -S "SSL - The handshake negotiation failed" \ |
| 9075 | -S "SSL - Unknown identity received" \ |
| 9076 | -S "SSL - Verification of the message MAC failed" |
| 9077 | |
| 9078 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9079 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \ |
| 9080 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9081 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 9082 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9083 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9084 | 0 \ |
| 9085 | -c "session hash for extended master secret"\ |
| 9086 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9087 | -S "SSL - The handshake negotiation failed" \ |
| 9088 | -S "SSL - Unknown identity received" \ |
| 9089 | -S "SSL - Verification of the message MAC failed" |
| 9090 | |
| 9091 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9092 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \ |
| 9093 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9094 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 9095 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9096 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9097 | 0 \ |
| 9098 | -c "session hash for extended master secret"\ |
| 9099 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9100 | -S "SSL - The handshake negotiation failed" \ |
| 9101 | -S "SSL - Unknown identity received" \ |
| 9102 | -S "SSL - Verification of the message MAC failed" |
| 9103 | |
| 9104 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9105 | 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] | 9106 | "$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] | 9107 | "$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] | 9108 | psk_identity=def psk=beef" \ |
| 9109 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9110 | -C "session hash for extended master secret"\ |
| 9111 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9112 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9113 | -S "SSL - Unknown identity received" \ |
| 9114 | -S "SSL - Verification of the message MAC failed" |
| 9115 | |
| 9116 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9117 | 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] | 9118 | "$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] | 9119 | "$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] | 9120 | psk_identity=def psk=beef" \ |
| 9121 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9122 | -C "session hash for extended master secret"\ |
| 9123 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9124 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9125 | -S "SSL - Unknown identity received" \ |
| 9126 | -S "SSL - Verification of the message MAC failed" |
| 9127 | |
| 9128 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9129 | 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] | 9130 | "$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] | 9131 | "$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] | 9132 | psk_identity=def psk=beef" \ |
| 9133 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9134 | -C "session hash for extended master secret"\ |
| 9135 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9136 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9137 | -S "SSL - Unknown identity received" \ |
| 9138 | -S "SSL - Verification of the message MAC failed" |
| 9139 | |
| 9140 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9141 | 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] | 9142 | "$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] | 9143 | "$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] | 9144 | psk_identity=def psk=beef" \ |
| 9145 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9146 | -C "session hash for extended master secret"\ |
| 9147 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9148 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9149 | -S "SSL - Unknown identity received" \ |
| 9150 | -S "SSL - Verification of the message MAC failed" |
| 9151 | |
| 9152 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9153 | 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] | 9154 | "$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] | 9155 | "$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] | 9156 | psk_identity=def psk=beef" \ |
| 9157 | 1 \ |
| 9158 | -s "SSL - Verification of the message MAC failed" |
| 9159 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9160 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 9161 | "$P_SRV" \ |
| 9162 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9163 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 9164 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 9165 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9166 | -S "SSL - Unknown identity received" \ |
| 9167 | -S "SSL - Verification of the message MAC failed" |
| 9168 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9169 | run_test "PSK callback: callback overrides other settings" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9170 | "$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] | 9171 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9172 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9173 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9174 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9175 | -s "SSL - Unknown identity received" \ |
| 9176 | -S "SSL - Verification of the message MAC failed" |
| 9177 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9178 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9179 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9180 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9181 | psk_identity=abc psk=dead" \ |
| 9182 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9183 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9184 | -S "SSL - Unknown identity received" \ |
| 9185 | -S "SSL - Verification of the message MAC failed" |
| 9186 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9187 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9188 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9189 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9190 | psk_identity=def psk=beef" \ |
| 9191 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9192 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9193 | -S "SSL - Unknown identity received" \ |
| 9194 | -S "SSL - Verification of the message MAC failed" |
| 9195 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9196 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9197 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9198 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9199 | psk_identity=ghi psk=beef" \ |
| 9200 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9201 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9202 | -s "SSL - Unknown identity received" \ |
| 9203 | -S "SSL - Verification of the message MAC failed" |
| 9204 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9205 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9206 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9207 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9208 | psk_identity=abc psk=beef" \ |
| 9209 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9210 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9211 | -S "SSL - Unknown identity received" \ |
| 9212 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 9213 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9214 | # Tests for EC J-PAKE |
| 9215 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9216 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9217 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9218 | run_test "ECJPAKE: client not configured" \ |
| 9219 | "$P_SRV debug_level=3" \ |
| 9220 | "$P_CLI debug_level=3" \ |
| 9221 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 9222 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9223 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9224 | -S "found ecjpake kkpp extension" \ |
| 9225 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9226 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9227 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9228 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9229 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9230 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9231 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9232 | run_test "ECJPAKE: server not configured" \ |
| 9233 | "$P_SRV debug_level=3" \ |
| 9234 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 9235 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9236 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 9237 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9238 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9239 | -s "found ecjpake kkpp extension" \ |
| 9240 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9241 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9242 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9243 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9244 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9245 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9246 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9247 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9248 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9249 | run_test "ECJPAKE: working, TLS" \ |
| 9250 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9251 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 9252 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 9253 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 9254 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9255 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9256 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9257 | -s "found ecjpake kkpp extension" \ |
| 9258 | -S "skip ecjpake kkpp extension" \ |
| 9259 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9260 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9261 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9262 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9263 | -S "SSL - Verification of the message MAC failed" |
| 9264 | |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9265 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | a6b69da | 2022-11-30 16:44:49 +0100 | [diff] [blame] | 9266 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9267 | run_test "ECJPAKE: opaque password client+server, working, TLS" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9268 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9269 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 9270 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9271 | 0 \ |
| 9272 | -c "add ciphersuite: c0ff" \ |
| 9273 | -c "adding ecjpake_kkpp extension" \ |
Valerio Setti | 661b9bc | 2022-11-29 17:19:25 +0100 | [diff] [blame] | 9274 | -c "using opaque password" \ |
| 9275 | -s "using opaque password" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9276 | -C "re-using cached ecjpake parameters" \ |
| 9277 | -s "found ecjpake kkpp extension" \ |
| 9278 | -S "skip ecjpake kkpp extension" \ |
| 9279 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9280 | -s "server hello, ecjpake kkpp extension" \ |
| 9281 | -c "found ecjpake_kkpp extension" \ |
| 9282 | -S "SSL - The handshake negotiation failed" \ |
| 9283 | -S "SSL - Verification of the message MAC failed" |
| 9284 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9285 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9286 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9287 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9288 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9289 | run_test "ECJPAKE: opaque password client only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9290 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9291 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 9292 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9293 | 0 \ |
| 9294 | -c "add ciphersuite: c0ff" \ |
| 9295 | -c "adding ecjpake_kkpp extension" \ |
| 9296 | -c "using opaque password" \ |
| 9297 | -S "using opaque password" \ |
| 9298 | -C "re-using cached ecjpake parameters" \ |
| 9299 | -s "found ecjpake kkpp extension" \ |
| 9300 | -S "skip ecjpake kkpp extension" \ |
| 9301 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9302 | -s "server hello, ecjpake kkpp extension" \ |
| 9303 | -c "found ecjpake_kkpp extension" \ |
| 9304 | -S "SSL - The handshake negotiation failed" \ |
| 9305 | -S "SSL - Verification of the message MAC failed" |
| 9306 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9307 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9308 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9309 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9310 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9311 | run_test "ECJPAKE: opaque password server only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9312 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9313 | "$P_CLI debug_level=3 ecjpake_pw=bla\ |
| 9314 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9315 | 0 \ |
| 9316 | -c "add ciphersuite: c0ff" \ |
| 9317 | -c "adding ecjpake_kkpp extension" \ |
| 9318 | -C "using opaque password" \ |
| 9319 | -s "using opaque password" \ |
| 9320 | -C "re-using cached ecjpake parameters" \ |
| 9321 | -s "found ecjpake kkpp extension" \ |
| 9322 | -S "skip ecjpake kkpp extension" \ |
| 9323 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9324 | -s "server hello, ecjpake kkpp extension" \ |
| 9325 | -c "found ecjpake_kkpp extension" \ |
| 9326 | -S "SSL - The handshake negotiation failed" \ |
| 9327 | -S "SSL - Verification of the message MAC failed" |
| 9328 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9329 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9330 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9331 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 9332 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9333 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 9334 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9335 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9336 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9337 | -s "SSL - Verification of the message MAC failed" |
| 9338 | |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9339 | server_needs_more_time 1 |
| 9340 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9341 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9342 | run_test "ECJPAKE_OPAQUE_PW: opaque password mismatch, TLS" \ |
| 9343 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9344 | "$P_CLI debug_level=3 ecjpake_pw=bad ecjpake_pw_opaque=1 \ |
| 9345 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9346 | 1 \ |
| 9347 | -c "using opaque password" \ |
| 9348 | -s "using opaque password" \ |
| 9349 | -C "re-using cached ecjpake parameters" \ |
| 9350 | -s "SSL - Verification of the message MAC failed" |
| 9351 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9352 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9353 | run_test "ECJPAKE: working, DTLS" \ |
| 9354 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 9355 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 9356 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9357 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9358 | -c "re-using cached ecjpake parameters" \ |
| 9359 | -S "SSL - Verification of the message MAC failed" |
| 9360 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9361 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9362 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 9363 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 9364 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 9365 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9366 | 0 \ |
| 9367 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9368 | -S "SSL - Verification of the message MAC failed" |
| 9369 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9370 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9371 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9372 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 9373 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 9374 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 9375 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9376 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9377 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9378 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9379 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 9380 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9381 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 9382 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 9383 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 9384 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 9385 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9386 | 0 |
| 9387 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 9388 | # Test for ClientHello without extensions |
| 9389 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9390 | # Without extensions, ECC is impossible (no curve negotiation). |
| 9391 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 9392 | requires_gnutls |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9393 | run_test "ClientHello without extensions: RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 9394 | "$P_SRV force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9395 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 9396 | 0 \ |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9397 | -s "Ciphersuite is .*-RSA-WITH-.*" \ |
| 9398 | -S "Ciphersuite is .*-EC.*" \ |
| 9399 | -s "dumping 'client hello extensions' (0 bytes)" |
| 9400 | |
Gilles Peskine | fc73aa0 | 2024-05-13 21:18:41 +0200 | [diff] [blame] | 9401 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_PSK_ENABLED |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9402 | requires_gnutls |
| 9403 | run_test "ClientHello without extensions: PSK" \ |
| 9404 | "$P_SRV force_version=tls12 debug_level=3 psk=73776f726466697368" \ |
| 9405 | "$G_CLI --priority=NORMAL:+PSK:-RSA:-DHE-RSA:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION --pskusername=Client_identity --pskkey=73776f726466697368 localhost" \ |
| 9406 | 0 \ |
| 9407 | -s "Ciphersuite is .*-PSK-.*" \ |
| 9408 | -S "Ciphersuite is .*-EC.*" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 9409 | -s "dumping 'client hello extensions' (0 bytes)" |
| 9410 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9411 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9412 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9413 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9414 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9415 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9416 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9417 | "$P_CLI request_size=100" \ |
| 9418 | 0 \ |
| 9419 | -s "Read from client: 100 bytes read$" |
| 9420 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9421 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9422 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 9423 | "$P_SRV buffer_size=100" \ |
| 9424 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9425 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9426 | -s "Read from client: 101 bytes read (100 + 1)" |
| 9427 | |
| 9428 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9429 | requires_max_content_len 200 |
| 9430 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 9431 | "$P_SRV buffer_size=100" \ |
| 9432 | "$P_CLI request_size=200" \ |
| 9433 | 0 \ |
| 9434 | -s "Read from client: 200 bytes read (100 + 100)" |
| 9435 | |
| 9436 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9437 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
Waleed Elmelegy | bae705c | 2024-01-01 14:21:21 +0000 | [diff] [blame] | 9438 | "$P_SRV buffer_size=100 force_version=tls12" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9439 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 9440 | 0 \ |
| 9441 | -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] | 9442 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9443 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9444 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9445 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9446 | "$P_SRV force_version=tls12" \ |
| 9447 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9448 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9449 | 0 \ |
| 9450 | -s "Read from client: 1 bytes read" |
| 9451 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9452 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9453 | "$P_SRV force_version=tls12" \ |
| 9454 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 9455 | 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] | 9456 | 0 \ |
| 9457 | -s "Read from client: 1 bytes read" |
| 9458 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9459 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9460 | "$P_SRV force_version=tls12" \ |
| 9461 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 9462 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9463 | 0 \ |
| 9464 | -s "Read from client: 1 bytes read" |
| 9465 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9466 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9467 | "$P_SRV force_version=tls12" \ |
| 9468 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9469 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 9470 | 0 \ |
| 9471 | -s "Read from client: 1 bytes read" |
| 9472 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9473 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9474 | "$P_SRV force_version=tls12" \ |
| 9475 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9476 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 9477 | 0 \ |
| 9478 | -s "Read from client: 1 bytes read" |
| 9479 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9480 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9481 | run_test "Small client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9482 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9483 | "$P_CLI request_size=1 \ |
| 9484 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9485 | 0 \ |
| 9486 | -s "Read from client: 1 bytes read" |
| 9487 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9488 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9489 | run_test "Small client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9490 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9491 | "$P_CLI request_size=1 \ |
| 9492 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9493 | 0 \ |
| 9494 | -s "Read from client: 1 bytes read" |
| 9495 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9496 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9497 | |
| 9498 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9499 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9500 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9501 | "$P_CLI dtls=1 request_size=1 \ |
| 9502 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9503 | 0 \ |
| 9504 | -s "Read from client: 1 bytes read" |
| 9505 | |
| 9506 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9507 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9508 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9509 | "$P_CLI dtls=1 request_size=1 \ |
| 9510 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9511 | 0 \ |
| 9512 | -s "Read from client: 1 bytes read" |
| 9513 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9514 | # Tests for small server packets |
| 9515 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9516 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9517 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9518 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9519 | 0 \ |
| 9520 | -c "Read from server: 1 bytes read" |
| 9521 | |
| 9522 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9523 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9524 | "$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] | 9525 | 0 \ |
| 9526 | -c "Read from server: 1 bytes read" |
| 9527 | |
| 9528 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9529 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9530 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9531 | 0 \ |
| 9532 | -c "Read from server: 1 bytes read" |
| 9533 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9534 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9535 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9536 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9537 | 0 \ |
| 9538 | -c "Read from server: 1 bytes read" |
| 9539 | |
| 9540 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9541 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9542 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9543 | 0 \ |
| 9544 | -c "Read from server: 1 bytes read" |
| 9545 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9546 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9547 | run_test "Small server packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9548 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9549 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9550 | 0 \ |
| 9551 | -c "Read from server: 1 bytes read" |
| 9552 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9553 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9554 | run_test "Small server packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9555 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9556 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9557 | 0 \ |
| 9558 | -c "Read from server: 1 bytes read" |
| 9559 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9560 | # Tests for small server packets in DTLS |
| 9561 | |
| 9562 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9563 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9564 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9565 | "$P_CLI dtls=1 \ |
| 9566 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9567 | 0 \ |
| 9568 | -c "Read from server: 1 bytes read" |
| 9569 | |
| 9570 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9571 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9572 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9573 | "$P_CLI dtls=1 \ |
| 9574 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9575 | 0 \ |
| 9576 | -c "Read from server: 1 bytes read" |
| 9577 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9578 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9579 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9580 | # How many fragments do we expect to write $1 bytes? |
| 9581 | fragments_for_write() { |
| 9582 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 9583 | } |
| 9584 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9585 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9586 | "$P_SRV force_version=tls12" \ |
| 9587 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9588 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9589 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9590 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9591 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9592 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9593 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9594 | "$P_SRV force_version=tls12" \ |
| 9595 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 9596 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9597 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9598 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 9599 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9600 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9601 | "$P_SRV force_version=tls12" \ |
| 9602 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 9603 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9604 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9605 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9606 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9607 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9608 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9609 | "$P_SRV force_version=tls12" \ |
| 9610 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9611 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 9612 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9613 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9614 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9615 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9616 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9617 | "$P_SRV force_version=tls12" \ |
| 9618 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9619 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 9620 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9621 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9622 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9623 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9624 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9625 | run_test "Large client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9626 | "$P_SRV" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9627 | "$P_CLI request_size=16383 \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9628 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9629 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9630 | -c "16383 bytes written in $(fragments_for_write 16383) fragments" \ |
| 9631 | -s "Read from client: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9632 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9633 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9634 | run_test "Large client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9635 | "$P_SRV" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9636 | "$P_CLI request_size=16383 \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9637 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9638 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9639 | -c "16383 bytes written in $(fragments_for_write 16383) fragments" \ |
| 9640 | -s "Read from client: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9641 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9642 | # 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] | 9643 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9644 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9645 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9646 | 0 \ |
| 9647 | -c "Read from server: 16384 bytes read" |
| 9648 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9649 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9650 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9651 | "$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] | 9652 | 0 \ |
| 9653 | -s "16384 bytes written in 1 fragments" \ |
| 9654 | -c "Read from server: 16384 bytes read" |
| 9655 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9656 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9657 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9658 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9659 | 0 \ |
| 9660 | -c "Read from server: 16384 bytes read" |
| 9661 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9662 | 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] | 9663 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 9664 | "$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] | 9665 | 0 \ |
| 9666 | -s "16384 bytes written in 1 fragments" \ |
| 9667 | -c "Read from server: 16384 bytes read" |
| 9668 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9669 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9670 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9671 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9672 | 0 \ |
| 9673 | -c "Read from server: 16384 bytes read" |
| 9674 | |
| 9675 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9676 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9677 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9678 | 0 \ |
| 9679 | -c "Read from server: 16384 bytes read" |
| 9680 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9681 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9682 | run_test "Large server packet TLS 1.3 AEAD" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9683 | "$P_SRV response_size=16383" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9684 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9685 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9686 | -c "Read from server: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9687 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9688 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9689 | run_test "Large server packet TLS 1.3 AEAD shorter tag" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9690 | "$P_SRV response_size=16383" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9691 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9692 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9693 | -c "Read from server: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9694 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9695 | # Tests for restartable ECC |
| 9696 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9697 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 9698 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9699 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9700 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9701 | run_test "EC restart: TLS, default" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9702 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9703 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9704 | 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] | 9705 | debug_level=1" \ |
| 9706 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9707 | -C "x509_verify_cert.*4b00" \ |
| 9708 | -C "mbedtls_pk_verify.*4b00" \ |
| 9709 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9710 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9711 | |
| 9712 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9713 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9714 | run_test "EC restart: TLS, max_ops=0" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9715 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9716 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9717 | 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] | 9718 | debug_level=1 ec_max_ops=0" \ |
| 9719 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9720 | -C "x509_verify_cert.*4b00" \ |
| 9721 | -C "mbedtls_pk_verify.*4b00" \ |
| 9722 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9723 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9724 | |
| 9725 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9726 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9727 | run_test "EC restart: TLS, max_ops=65535" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9728 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9729 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9730 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9731 | debug_level=1 ec_max_ops=65535" \ |
| 9732 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9733 | -C "x509_verify_cert.*4b00" \ |
| 9734 | -C "mbedtls_pk_verify.*4b00" \ |
| 9735 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9736 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9737 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9738 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9739 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9740 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9741 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9742 | run_test "EC restart: TLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9743 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9744 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9745 | 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] | 9746 | debug_level=1 ec_max_ops=1000" \ |
| 9747 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9748 | -c "x509_verify_cert.*4b00" \ |
| 9749 | -c "mbedtls_pk_verify.*4b00" \ |
| 9750 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9751 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9752 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9753 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9754 | # everything except ECDH (where TLS calls PSA directly). |
| 9755 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9756 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9757 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9758 | run_test "EC restart: TLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9759 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9760 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9761 | 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] | 9762 | debug_level=1 ec_max_ops=1000" \ |
| 9763 | 0 \ |
| 9764 | -c "x509_verify_cert.*4b00" \ |
| 9765 | -c "mbedtls_pk_verify.*4b00" \ |
| 9766 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9767 | -c "mbedtls_pk_sign.*4b00" |
| 9768 | |
| 9769 | # This works the same with & without USE_PSA as we never get to ECDH: |
| 9770 | # 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] | 9771 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9772 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9773 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9774 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9775 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9776 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9777 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9778 | 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] | 9779 | debug_level=1 ec_max_ops=1000" \ |
| 9780 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9781 | -c "x509_verify_cert.*4b00" \ |
| 9782 | -C "mbedtls_pk_verify.*4b00" \ |
| 9783 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9784 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9785 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9786 | -c "! mbedtls_ssl_handshake returned" \ |
| 9787 | -c "X509 - Certificate verification failed" |
| 9788 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9789 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9790 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9791 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9792 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9793 | 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] | 9794 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9795 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9796 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9797 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
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 \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9799 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 9800 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9801 | -c "x509_verify_cert.*4b00" \ |
| 9802 | -c "mbedtls_pk_verify.*4b00" \ |
| 9803 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9804 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9805 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9806 | -C "! mbedtls_ssl_handshake returned" \ |
| 9807 | -C "X509 - Certificate verification failed" |
| 9808 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9809 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9810 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9811 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9812 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9813 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9814 | 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] | 9815 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9816 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9817 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9818 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9819 | 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] | 9820 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 9821 | 0 \ |
| 9822 | -c "x509_verify_cert.*4b00" \ |
| 9823 | -c "mbedtls_pk_verify.*4b00" \ |
| 9824 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9825 | -c "mbedtls_pk_sign.*4b00" \ |
| 9826 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9827 | -C "! mbedtls_ssl_handshake returned" \ |
| 9828 | -C "X509 - Certificate verification failed" |
| 9829 | |
| 9830 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9831 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9832 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9833 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9834 | 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] | 9835 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9836 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9837 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9838 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9839 | 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] | 9840 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 9841 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9842 | -C "x509_verify_cert.*4b00" \ |
| 9843 | -c "mbedtls_pk_verify.*4b00" \ |
| 9844 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9845 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9846 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 9847 | -C "! mbedtls_ssl_handshake returned" \ |
| 9848 | -C "X509 - Certificate verification failed" |
| 9849 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9850 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9851 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9852 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9853 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9854 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9855 | 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] | 9856 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9857 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9858 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9859 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9860 | 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] | 9861 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 9862 | 0 \ |
| 9863 | -C "x509_verify_cert.*4b00" \ |
| 9864 | -c "mbedtls_pk_verify.*4b00" \ |
| 9865 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9866 | -c "mbedtls_pk_sign.*4b00" \ |
| 9867 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 9868 | -C "! mbedtls_ssl_handshake returned" \ |
| 9869 | -C "X509 - Certificate verification failed" |
| 9870 | |
| 9871 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9872 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9873 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9874 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9875 | run_test "EC restart: DTLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9876 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9877 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9878 | 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] | 9879 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 9880 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9881 | -c "x509_verify_cert.*4b00" \ |
| 9882 | -c "mbedtls_pk_verify.*4b00" \ |
| 9883 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9884 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9885 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9886 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9887 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9888 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9889 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9890 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9891 | run_test "EC restart: DTLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9892 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9893 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9894 | 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] | 9895 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 9896 | 0 \ |
| 9897 | -c "x509_verify_cert.*4b00" \ |
| 9898 | -c "mbedtls_pk_verify.*4b00" \ |
| 9899 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9900 | -c "mbedtls_pk_sign.*4b00" |
| 9901 | |
| 9902 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9903 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9904 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9905 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9906 | 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] | 9907 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9908 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9909 | debug_level=1 ec_max_ops=1000" \ |
| 9910 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9911 | -c "x509_verify_cert.*4b00" \ |
| 9912 | -c "mbedtls_pk_verify.*4b00" \ |
| 9913 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9914 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9915 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9916 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9917 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9918 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9919 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9920 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9921 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9922 | 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] | 9923 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9924 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9925 | debug_level=1 ec_max_ops=1000" \ |
| 9926 | 0 \ |
| 9927 | -c "x509_verify_cert.*4b00" \ |
| 9928 | -c "mbedtls_pk_verify.*4b00" \ |
| 9929 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9930 | -C "mbedtls_pk_sign.*4b00" |
| 9931 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9932 | # Restartable is only for ECDHE-ECDSA, with another ciphersuite we expect no |
| 9933 | # restartable behaviour at all (not even client auth). |
| 9934 | # This is the same as "EC restart: TLS, max_ops=1000" except with ECDHE-RSA, |
| 9935 | # and all 4 assertions negated. |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9936 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9937 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9938 | run_test "EC restart: TLS, max_ops=1000, ECDHE-RSA" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9939 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9940 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9941 | 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] | 9942 | debug_level=1 ec_max_ops=1000" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9943 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9944 | -C "x509_verify_cert.*4b00" \ |
| 9945 | -C "mbedtls_pk_verify.*4b00" \ |
| 9946 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9947 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9948 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9949 | # Tests of asynchronous private key support in SSL |
| 9950 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9951 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9952 | run_test "SSL async private: sign, delay=0" \ |
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=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9955 | "$P_CLI" \ |
| 9956 | 0 \ |
| 9957 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9958 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9959 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9960 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9961 | run_test "SSL async private: sign, delay=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9962 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9963 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9964 | "$P_CLI" \ |
| 9965 | 0 \ |
| 9966 | -s "Async sign callback: using key slot " \ |
| 9967 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9968 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 9969 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 9970 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 9971 | run_test "SSL async private: sign, delay=2" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9972 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 9973 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 9974 | "$P_CLI" \ |
| 9975 | 0 \ |
| 9976 | -s "Async sign callback: using key slot " \ |
| 9977 | -U "Async sign callback: using key slot " \ |
| 9978 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 9979 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 9980 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 9981 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9982 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 9983 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 9984 | run_test "SSL async private: sign, SNI" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9985 | "$P_SRV force_version=tls12 debug_level=3 \ |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 9986 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9987 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 9988 | 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] | 9989 | "$P_CLI server_name=polarssl.example" \ |
| 9990 | 0 \ |
| 9991 | -s "Async sign callback: using key slot " \ |
| 9992 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 9993 | -s "parse ServerName extension" \ |
| 9994 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 9995 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 9996 | |
| 9997 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9998 | run_test "SSL async private: decrypt, delay=0" \ |
| 9999 | "$P_SRV \ |
| 10000 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 10001 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10002 | 0 \ |
| 10003 | -s "Async decrypt callback: using key slot " \ |
| 10004 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10005 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10006 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10007 | run_test "SSL async private: decrypt, delay=1" \ |
| 10008 | "$P_SRV \ |
| 10009 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 10010 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10011 | 0 \ |
| 10012 | -s "Async decrypt callback: using key slot " \ |
| 10013 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 10014 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10015 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10016 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10017 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10018 | "$P_SRV psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10019 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10020 | "$P_CLI psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10021 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 10022 | 0 \ |
| 10023 | -s "Async decrypt callback: using key slot " \ |
| 10024 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10025 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10026 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10027 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10028 | "$P_SRV psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10029 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10030 | "$P_CLI psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10031 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 10032 | 0 \ |
| 10033 | -s "Async decrypt callback: using key slot " \ |
| 10034 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 10035 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10036 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10037 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10038 | run_test "SSL async private: sign callback not present" \ |
| 10039 | "$P_SRV \ |
| 10040 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10041 | "$P_CLI force_version=tls12; [ \$? -eq 1 ] && |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10042 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10043 | 0 \ |
| 10044 | -S "Async sign callback" \ |
| 10045 | -s "! mbedtls_ssl_handshake returned" \ |
| 10046 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 10047 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 10048 | -s "Successful connection" |
| 10049 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10050 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10051 | run_test "SSL async private: decrypt callback not present" \ |
| 10052 | "$P_SRV debug_level=1 \ |
| 10053 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 10054 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 10055 | [ \$? -eq 1 ] && $P_CLI force_version=tls12" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10056 | 0 \ |
| 10057 | -S "Async decrypt callback" \ |
| 10058 | -s "! mbedtls_ssl_handshake returned" \ |
| 10059 | -s "got no RSA private key" \ |
| 10060 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 10061 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10062 | |
| 10063 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10064 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10065 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10066 | "$P_SRV \ |
| 10067 | async_operations=s async_private_delay1=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10068 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10069 | 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] | 10070 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10071 | 0 \ |
| 10072 | -s "Async sign callback: using key slot 0," \ |
| 10073 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10074 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10075 | |
| 10076 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10077 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10078 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10079 | "$P_SRV \ |
| 10080 | async_operations=s async_private_delay2=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10081 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10082 | 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] | 10083 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10084 | 0 \ |
| 10085 | -s "Async sign callback: using key slot 0," \ |
| 10086 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10087 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10088 | |
| 10089 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10090 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 10091 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10092 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 10093 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10094 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10095 | key_file2=$DATA_FILES_PATH/server2.key crt_file2=$DATA_FILES_PATH/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10096 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10097 | 0 \ |
| 10098 | -s "Async sign callback: using key slot 1," \ |
| 10099 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10100 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10101 | |
| 10102 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10103 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10104 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10105 | "$P_SRV \ |
| 10106 | async_operations=s async_private_delay1=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10107 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10108 | key_file2=$DATA_FILES_PATH/server2.key crt_file2=$DATA_FILES_PATH/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10109 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10110 | 0 \ |
| 10111 | -s "Async sign callback: no key matches this certificate." |
| 10112 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10113 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10114 | run_test "SSL async private: sign, error in start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10115 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10116 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10117 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10118 | "$P_CLI" \ |
| 10119 | 1 \ |
| 10120 | -s "Async sign callback: injected error" \ |
| 10121 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 10122 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10123 | -s "! mbedtls_ssl_handshake returned" |
| 10124 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10125 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10126 | run_test "SSL async private: sign, cancel after start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10127 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10128 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10129 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10130 | "$P_CLI" \ |
| 10131 | 1 \ |
| 10132 | -s "Async sign callback: using key slot " \ |
| 10133 | -S "Async resume" \ |
| 10134 | -s "Async cancel" |
| 10135 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10136 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10137 | run_test "SSL async private: sign, error in resume" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10138 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10139 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10140 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10141 | "$P_CLI" \ |
| 10142 | 1 \ |
| 10143 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10144 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 10145 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10146 | -s "! mbedtls_ssl_handshake returned" |
| 10147 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10148 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10149 | run_test "SSL async private: decrypt, error in start" \ |
| 10150 | "$P_SRV \ |
| 10151 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10152 | async_private_error=1" \ |
| 10153 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10154 | 1 \ |
| 10155 | -s "Async decrypt callback: injected error" \ |
| 10156 | -S "Async resume" \ |
| 10157 | -S "Async cancel" \ |
| 10158 | -s "! mbedtls_ssl_handshake returned" |
| 10159 | |
| 10160 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 10161 | run_test "SSL async private: decrypt, cancel after start" \ |
| 10162 | "$P_SRV \ |
| 10163 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10164 | async_private_error=2" \ |
| 10165 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10166 | 1 \ |
| 10167 | -s "Async decrypt callback: using key slot " \ |
| 10168 | -S "Async resume" \ |
| 10169 | -s "Async cancel" |
| 10170 | |
| 10171 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 10172 | run_test "SSL async private: decrypt, error in resume" \ |
| 10173 | "$P_SRV \ |
| 10174 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10175 | async_private_error=3" \ |
| 10176 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10177 | 1 \ |
| 10178 | -s "Async decrypt callback: using key slot " \ |
| 10179 | -s "Async resume callback: decrypt done but injected error" \ |
| 10180 | -S "Async cancel" \ |
| 10181 | -s "! mbedtls_ssl_handshake returned" |
| 10182 | |
| 10183 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10184 | run_test "SSL async private: cancel after start then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10185 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10186 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10187 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10188 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 10189 | 0 \ |
| 10190 | -s "Async cancel" \ |
| 10191 | -s "! mbedtls_ssl_handshake returned" \ |
| 10192 | -s "Async resume" \ |
| 10193 | -s "Successful connection" |
| 10194 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10195 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10196 | run_test "SSL async private: error in resume then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10197 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10198 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10199 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10200 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 10201 | 0 \ |
| 10202 | -s "! mbedtls_ssl_handshake returned" \ |
| 10203 | -s "Async resume" \ |
| 10204 | -s "Successful connection" |
| 10205 | |
| 10206 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10207 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 10208 | # Note: the function "detect_required_features()" is not able to detect more than |
| 10209 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 10210 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 10211 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10212 | 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] | 10213 | "$P_SRV \ |
| 10214 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10215 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10216 | 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] | 10217 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 10218 | [ \$? -eq 1 ] && |
| 10219 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10220 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 10221 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10222 | -S "Async resume" \ |
| 10223 | -s "Async cancel" \ |
| 10224 | -s "! mbedtls_ssl_handshake returned" \ |
| 10225 | -s "Async sign callback: no key matches this certificate." \ |
| 10226 | -s "Successful connection" |
| 10227 | |
| 10228 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10229 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 10230 | # Note: the function "detect_required_features()" is not able to detect more than |
| 10231 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 10232 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 10233 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10234 | 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] | 10235 | "$P_SRV \ |
| 10236 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10237 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10238 | 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] | 10239 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 10240 | [ \$? -eq 1 ] && |
| 10241 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10242 | 0 \ |
| 10243 | -s "Async resume" \ |
| 10244 | -s "! mbedtls_ssl_handshake returned" \ |
| 10245 | -s "Async sign callback: no key matches this certificate." \ |
| 10246 | -s "Successful connection" |
| 10247 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10248 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10249 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10250 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10251 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10252 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10253 | exchanges=2 renegotiation=1" \ |
| 10254 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10255 | 0 \ |
| 10256 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10257 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10258 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10259 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10260 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10261 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10262 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10263 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10264 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10265 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 10266 | 0 \ |
| 10267 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10268 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 10269 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10270 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10271 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10272 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10273 | "$P_SRV \ |
| 10274 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10275 | exchanges=2 renegotiation=1" \ |
| 10276 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 10277 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10278 | 0 \ |
| 10279 | -s "Async decrypt callback: using key slot " \ |
| 10280 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10281 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10282 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10283 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10284 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10285 | "$P_SRV \ |
| 10286 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10287 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10288 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 10289 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10290 | 0 \ |
| 10291 | -s "Async decrypt callback: using key slot " \ |
| 10292 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10293 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10294 | # Tests for ECC extensions (rfc 4492) |
| 10295 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10296 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10297 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10298 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 10299 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10300 | "$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] | 10301 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 10302 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10303 | -C "client hello, adding supported_point_formats extension" \ |
| 10304 | -S "found supported elliptic curves extension" \ |
| 10305 | -S "found supported point formats extension" |
| 10306 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10307 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10308 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10309 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10310 | "$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] | 10311 | "$P_CLI debug_level=3" \ |
| 10312 | 0 \ |
| 10313 | -C "found supported_point_formats extension" \ |
| 10314 | -S "server hello, supported_point_formats extension" |
| 10315 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10316 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10317 | run_test "Force an ECC ciphersuite in the client side" \ |
| 10318 | "$P_SRV debug_level=3" \ |
| 10319 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10320 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 10321 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10322 | -c "client hello, adding supported_point_formats extension" \ |
| 10323 | -s "found supported elliptic curves extension" \ |
| 10324 | -s "found supported point formats extension" |
| 10325 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10326 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10327 | run_test "Force an ECC ciphersuite in the server side" \ |
| 10328 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10329 | "$P_CLI debug_level=3" \ |
| 10330 | 0 \ |
| 10331 | -c "found supported_point_formats extension" \ |
| 10332 | -s "server hello, supported_point_formats extension" |
| 10333 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10334 | # Tests for DTLS HelloVerifyRequest |
| 10335 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10336 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10337 | run_test "DTLS cookie: enabled" \ |
| 10338 | "$P_SRV dtls=1 debug_level=2" \ |
| 10339 | "$P_CLI dtls=1 debug_level=2" \ |
| 10340 | 0 \ |
| 10341 | -s "cookie verification failed" \ |
| 10342 | -s "cookie verification passed" \ |
| 10343 | -S "cookie verification skipped" \ |
| 10344 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10345 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10346 | -S "SSL - The requested feature is not available" |
| 10347 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10348 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10349 | run_test "DTLS cookie: disabled" \ |
| 10350 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 10351 | "$P_CLI dtls=1 debug_level=2" \ |
| 10352 | 0 \ |
| 10353 | -S "cookie verification failed" \ |
| 10354 | -S "cookie verification passed" \ |
| 10355 | -s "cookie verification skipped" \ |
| 10356 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10357 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10358 | -S "SSL - The requested feature is not available" |
| 10359 | |
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 | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10361 | run_test "DTLS cookie: default (failing)" \ |
| 10362 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 10363 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 10364 | 1 \ |
| 10365 | -s "cookie verification failed" \ |
| 10366 | -S "cookie verification passed" \ |
| 10367 | -S "cookie verification skipped" \ |
| 10368 | -C "received hello verify request" \ |
| 10369 | -S "hello verification requested" \ |
| 10370 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10371 | |
| 10372 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10373 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10374 | run_test "DTLS cookie: enabled, IPv6" \ |
| 10375 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 10376 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 10377 | 0 \ |
| 10378 | -s "cookie verification failed" \ |
| 10379 | -s "cookie verification passed" \ |
| 10380 | -S "cookie verification skipped" \ |
| 10381 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10382 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10383 | -S "SSL - The requested feature is not available" |
| 10384 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10385 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 10386 | run_test "DTLS cookie: enabled, nbio" \ |
| 10387 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 10388 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10389 | 0 \ |
| 10390 | -s "cookie verification failed" \ |
| 10391 | -s "cookie verification passed" \ |
| 10392 | -S "cookie verification skipped" \ |
| 10393 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10394 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 10395 | -S "SSL - The requested feature is not available" |
| 10396 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10397 | # Tests for client reconnecting from the same port with DTLS |
| 10398 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10399 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10400 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10401 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10402 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 10403 | "$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] | 10404 | 0 \ |
| 10405 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10406 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10407 | -S "Client initiated reconnection from same port" |
| 10408 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10409 | not_with_valgrind # spurious resend |
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 | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10411 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10412 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 10413 | "$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] | 10414 | 0 \ |
| 10415 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10416 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10417 | -s "Client initiated reconnection from same port" |
| 10418 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10419 | 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] | 10420 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10421 | 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] | 10422 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 10423 | "$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] | 10424 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10425 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10426 | -s "Client initiated reconnection from same port" |
| 10427 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10428 | 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] | 10429 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10430 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 10431 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 10432 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 10433 | 0 \ |
| 10434 | -S "The operation timed out" \ |
| 10435 | -s "Client initiated reconnection from same port" |
| 10436 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10437 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10438 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 10439 | "$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] | 10440 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 10441 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10442 | -s "The operation timed out" \ |
| 10443 | -S "Client initiated reconnection from same port" |
| 10444 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10445 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 10446 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 10447 | -p "$P_PXY inject_clihlo=1" \ |
| 10448 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 10449 | "$P_CLI dtls=1 exchanges=2" \ |
| 10450 | 0 \ |
| 10451 | -s "possible client reconnect from the same port" \ |
| 10452 | -S "Client initiated reconnection from same port" |
| 10453 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10454 | # Tests for various cases of client authentication with DTLS |
| 10455 | # (focused on handshake flows and message parsing) |
| 10456 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10457 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10458 | run_test "DTLS client auth: required" \ |
| 10459 | "$P_SRV dtls=1 auth_mode=required" \ |
| 10460 | "$P_CLI dtls=1" \ |
| 10461 | 0 \ |
| 10462 | -s "Verifying peer X.509 certificate... ok" |
| 10463 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10464 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10465 | run_test "DTLS client auth: optional, client has no cert" \ |
| 10466 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 10467 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 10468 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10469 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10470 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10471 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10472 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10473 | "$P_SRV dtls=1 auth_mode=none" \ |
| 10474 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 10475 | 0 \ |
| 10476 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10477 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10478 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 10479 | run_test "DTLS wrong PSK: badmac alert" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10480 | "$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] | 10481 | "$P_CLI dtls=1 psk=73776f726466697374" \ |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 10482 | 1 \ |
| 10483 | -s "SSL - Verification of the message MAC failed" \ |
| 10484 | -c "SSL - A fatal alert message was received from our peer" |
| 10485 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10486 | # Tests for receiving fragmented handshake messages with DTLS |
| 10487 | |
| 10488 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10489 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10490 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 10491 | "$G_SRV -u --mtu 2048 -a" \ |
| 10492 | "$P_CLI dtls=1 debug_level=2" \ |
| 10493 | 0 \ |
| 10494 | -C "found fragmented DTLS handshake message" \ |
| 10495 | -C "error" |
| 10496 | |
| 10497 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10498 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10499 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 10500 | "$G_SRV -u --mtu 512" \ |
| 10501 | "$P_CLI dtls=1 debug_level=2" \ |
| 10502 | 0 \ |
| 10503 | -c "found fragmented DTLS handshake message" \ |
| 10504 | -C "error" |
| 10505 | |
| 10506 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10507 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10508 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 10509 | "$G_SRV -u --mtu 128" \ |
| 10510 | "$P_CLI dtls=1 debug_level=2" \ |
| 10511 | 0 \ |
| 10512 | -c "found fragmented DTLS handshake message" \ |
| 10513 | -C "error" |
| 10514 | |
| 10515 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10516 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10517 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 10518 | "$G_SRV -u --mtu 128" \ |
| 10519 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10520 | 0 \ |
| 10521 | -c "found fragmented DTLS handshake message" \ |
| 10522 | -C "error" |
| 10523 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10524 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10525 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10527 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 10528 | "$G_SRV -u --mtu 256" \ |
| 10529 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 10530 | 0 \ |
| 10531 | -c "found fragmented DTLS handshake message" \ |
| 10532 | -c "client hello, adding renegotiation extension" \ |
| 10533 | -c "found renegotiation extension" \ |
| 10534 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 10535 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10536 | -C "error" \ |
| 10537 | -s "Extra-header:" |
| 10538 | |
| 10539 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10540 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10541 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10542 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 10543 | "$G_SRV -u --mtu 256" \ |
| 10544 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 10545 | 0 \ |
| 10546 | -c "found fragmented DTLS handshake message" \ |
| 10547 | -c "client hello, adding renegotiation extension" \ |
| 10548 | -c "found renegotiation extension" \ |
| 10549 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 10550 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10551 | -C "error" \ |
| 10552 | -s "Extra-header:" |
| 10553 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10554 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10555 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 10556 | "$O_SRV -dtls -mtu 2048" \ |
| 10557 | "$P_CLI dtls=1 debug_level=2" \ |
| 10558 | 0 \ |
| 10559 | -C "found fragmented DTLS handshake message" \ |
| 10560 | -C "error" |
| 10561 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10562 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10563 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 10564 | "$O_SRV -dtls -mtu 256" \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10565 | "$P_CLI dtls=1 debug_level=2" \ |
| 10566 | 0 \ |
| 10567 | -c "found fragmented DTLS handshake message" \ |
| 10568 | -C "error" |
| 10569 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10570 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10571 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 10572 | "$O_SRV -dtls -mtu 256" \ |
| 10573 | "$P_CLI dtls=1 debug_level=2" \ |
| 10574 | 0 \ |
| 10575 | -c "found fragmented DTLS handshake message" \ |
| 10576 | -C "error" |
| 10577 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10578 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10579 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 10580 | "$O_SRV -dtls -mtu 256" \ |
| 10581 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10582 | 0 \ |
| 10583 | -c "found fragmented DTLS handshake message" \ |
| 10584 | -C "error" |
| 10585 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10586 | # Tests for sending fragmented handshake messages with DTLS |
| 10587 | # |
| 10588 | # Use client auth when we need the client to send large messages, |
| 10589 | # and use large cert chains on both sides too (the long chains we have all use |
| 10590 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 10591 | # Sizes reached (UDP payload): |
| 10592 | # - 2037B for server certificate |
| 10593 | # - 1542B for client certificate |
| 10594 | # - 1013B for newsessionticket |
| 10595 | # - all others below 512B |
| 10596 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 10597 | |
| 10598 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10599 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10600 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10601 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10603 | run_test "DTLS fragmenting: none (for reference)" \ |
| 10604 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10605 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10606 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10607 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10608 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10609 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10610 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10611 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10612 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10613 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10614 | 0 \ |
| 10615 | -S "found fragmented DTLS handshake message" \ |
| 10616 | -C "found fragmented DTLS handshake message" \ |
| 10617 | -C "error" |
| 10618 | |
| 10619 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10620 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10621 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10622 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10623 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10624 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10625 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10626 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10627 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10628 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10629 | max_frag_len=1024" \ |
| 10630 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10631 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10632 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10633 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10634 | max_frag_len=2048" \ |
| 10635 | 0 \ |
| 10636 | -S "found fragmented DTLS handshake message" \ |
| 10637 | -c "found fragmented DTLS handshake message" \ |
| 10638 | -C "error" |
| 10639 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 10640 | # With the MFL extension, the server has no way of forcing |
| 10641 | # the client to not exceed a certain MTU; hence, the following |
| 10642 | # test can't be replicated with an MTU proxy such as the one |
| 10643 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10644 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10645 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10646 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10647 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10648 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10649 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10650 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10651 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10652 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10653 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10654 | max_frag_len=512" \ |
| 10655 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10656 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10657 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10658 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 10659 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10660 | 0 \ |
| 10661 | -S "found fragmented DTLS handshake message" \ |
| 10662 | -c "found fragmented DTLS handshake message" \ |
| 10663 | -C "error" |
| 10664 | |
| 10665 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10666 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10667 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10668 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10669 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10670 | 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] | 10671 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10672 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10673 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10674 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10675 | max_frag_len=2048" \ |
| 10676 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10677 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10678 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10679 | hs_timeout=2500-60000 \ |
| 10680 | max_frag_len=1024" \ |
| 10681 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10682 | -S "found fragmented DTLS handshake message" \ |
| 10683 | -c "found fragmented DTLS handshake message" \ |
| 10684 | -C "error" |
| 10685 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10686 | # While not required by the standard defining the MFL extension |
| 10687 | # (according to which it only applies to records, not to datagrams), |
| 10688 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 10689 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 10690 | # to the peer. |
| 10691 | # The next test checks that no datagrams significantly larger than the |
| 10692 | # negotiated MFL are sent. |
| 10693 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10694 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10695 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10696 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10697 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10698 | 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] | 10699 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10700 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10701 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10702 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10703 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10704 | max_frag_len=2048" \ |
| 10705 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10706 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10707 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10708 | hs_timeout=2500-60000 \ |
| 10709 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10710 | 0 \ |
| 10711 | -S "found fragmented DTLS handshake message" \ |
| 10712 | -c "found fragmented DTLS handshake message" \ |
| 10713 | -C "error" |
| 10714 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10715 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10716 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10717 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10718 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10719 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10720 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10721 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10722 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10723 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10724 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10725 | max_frag_len=2048" \ |
| 10726 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10727 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10728 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10729 | hs_timeout=2500-60000 \ |
| 10730 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10731 | 0 \ |
| 10732 | -s "found fragmented DTLS handshake message" \ |
| 10733 | -c "found fragmented DTLS handshake message" \ |
| 10734 | -C "error" |
| 10735 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10736 | # While not required by the standard defining the MFL extension |
| 10737 | # (according to which it only applies to records, not to datagrams), |
| 10738 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 10739 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 10740 | # to the peer. |
| 10741 | # The next test checks that no datagrams significantly larger than the |
| 10742 | # negotiated MFL are sent. |
| 10743 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10744 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10745 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10746 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10748 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 10749 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 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 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10753 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10754 | max_frag_len=2048" \ |
| 10755 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10756 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10757 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10758 | hs_timeout=2500-60000 \ |
| 10759 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10760 | 0 \ |
| 10761 | -s "found fragmented DTLS handshake message" \ |
| 10762 | -c "found fragmented DTLS handshake message" \ |
| 10763 | -C "error" |
| 10764 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10765 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10766 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10767 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10768 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10769 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 10770 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10771 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10772 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10773 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10774 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10775 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10776 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10777 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10778 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10779 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10780 | 0 \ |
| 10781 | -S "found fragmented DTLS handshake message" \ |
| 10782 | -C "found fragmented DTLS handshake message" \ |
| 10783 | -C "error" |
| 10784 | |
| 10785 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10786 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10787 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10788 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10789 | run_test "DTLS fragmenting: client (MTU)" \ |
| 10790 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10791 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10792 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10793 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10794 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10795 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10796 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10797 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10798 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10799 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10800 | 0 \ |
| 10801 | -s "found fragmented DTLS handshake message" \ |
| 10802 | -C "found fragmented DTLS handshake message" \ |
| 10803 | -C "error" |
| 10804 | |
| 10805 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10806 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10807 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10808 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10809 | run_test "DTLS fragmenting: server (MTU)" \ |
| 10810 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10811 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10812 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10813 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10814 | mtu=512" \ |
| 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 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10818 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10819 | mtu=2048" \ |
| 10820 | 0 \ |
| 10821 | -S "found fragmented DTLS handshake message" \ |
| 10822 | -c "found fragmented DTLS handshake message" \ |
| 10823 | -C "error" |
| 10824 | |
| 10825 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10826 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10827 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10828 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10829 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10830 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10831 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10832 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10833 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10834 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 10835 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10836 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10837 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10838 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10839 | hs_timeout=2500-60000 \ |
| 10840 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10841 | 0 \ |
| 10842 | -s "found fragmented DTLS handshake message" \ |
| 10843 | -c "found fragmented DTLS handshake message" \ |
| 10844 | -C "error" |
| 10845 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10846 | # 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] | 10847 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10848 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10849 | requires_hash_alg SHA_256 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10850 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10851 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 10852 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 10853 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10854 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10855 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10856 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 10857 | mtu=512" \ |
| 10858 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10859 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10860 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10861 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10862 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10863 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10864 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10865 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10866 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10867 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10868 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10869 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10870 | # 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] | 10871 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 10872 | # retransmissions, but in some cases (like both the server and client using |
| 10873 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 10874 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 10875 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10876 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10877 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10878 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 10879 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10880 | -p "$P_PXY mtu=508" \ |
| 10881 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10882 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10883 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10884 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10885 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10886 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10887 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10888 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10889 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10890 | 0 \ |
| 10891 | -s "found fragmented DTLS handshake message" \ |
| 10892 | -c "found fragmented DTLS handshake message" \ |
| 10893 | -C "error" |
| 10894 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10895 | # 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] | 10896 | only_with_valgrind |
| 10897 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10898 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10899 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 10900 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10901 | -p "$P_PXY mtu=508" \ |
| 10902 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10903 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10904 | key_file=$DATA_FILES_PATH/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10905 | hs_timeout=250-10000" \ |
| 10906 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10907 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10908 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10909 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10910 | hs_timeout=250-10000" \ |
| 10911 | 0 \ |
| 10912 | -s "found fragmented DTLS handshake message" \ |
| 10913 | -c "found fragmented DTLS handshake message" \ |
| 10914 | -C "error" |
| 10915 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10916 | # 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] | 10917 | # OTOH the client might resend if the server is to slow to reset after sending |
| 10918 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10919 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10920 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10921 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10922 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10923 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10924 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10925 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10926 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10927 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10928 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10929 | hs_timeout=10000-60000 \ |
| 10930 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10931 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10932 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10933 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10934 | hs_timeout=10000-60000 \ |
| 10935 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10936 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10937 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10938 | -s "found fragmented DTLS handshake message" \ |
| 10939 | -c "found fragmented DTLS handshake message" \ |
| 10940 | -C "error" |
| 10941 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10942 | # 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] | 10943 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 10944 | # OTOH the client might resend if the server is to slow to reset after sending |
| 10945 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10946 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10947 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10948 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10949 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10950 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10951 | -p "$P_PXY mtu=512" \ |
| 10952 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10953 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10954 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10955 | hs_timeout=10000-60000 \ |
| 10956 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10957 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10958 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10959 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10960 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10961 | hs_timeout=10000-60000 \ |
| 10962 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10963 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10964 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10965 | -s "found fragmented DTLS handshake message" \ |
| 10966 | -c "found fragmented DTLS handshake message" \ |
| 10967 | -C "error" |
| 10968 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10969 | not_with_valgrind # spurious autoreduction due to timeout |
| 10970 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10971 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10972 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10973 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10974 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10975 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10976 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10977 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10978 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10979 | hs_timeout=10000-60000 \ |
| 10980 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10981 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10982 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10983 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10984 | hs_timeout=10000-60000 \ |
| 10985 | mtu=1024 nbio=2" \ |
| 10986 | 0 \ |
| 10987 | -S "autoreduction" \ |
| 10988 | -s "found fragmented DTLS handshake message" \ |
| 10989 | -c "found fragmented DTLS handshake message" \ |
| 10990 | -C "error" |
| 10991 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10992 | # 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] | 10993 | not_with_valgrind # spurious autoreduction due to timeout |
| 10994 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10995 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10996 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10997 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 10998 | -p "$P_PXY mtu=512" \ |
| 10999 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11000 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11001 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11002 | hs_timeout=10000-60000 \ |
| 11003 | mtu=512 nbio=2" \ |
| 11004 | "$P_CLI 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 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11007 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 11008 | hs_timeout=10000-60000 \ |
| 11009 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11010 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11011 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11012 | -s "found fragmented DTLS handshake message" \ |
| 11013 | -c "found fragmented DTLS handshake message" \ |
| 11014 | -C "error" |
| 11015 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11016 | # 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] | 11017 | # This ensures things still work after session_reset(). |
| 11018 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11019 | # Since we don't support reading fragmented ClientHello yet, |
| 11020 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 11021 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11022 | # An autoreduction on the client-side might happen if the server is |
| 11023 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 11024 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11025 | # resumed listening, which would result in a spurious autoreduction. |
| 11026 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11027 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11028 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11029 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11030 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 11031 | -p "$P_PXY mtu=1450" \ |
| 11032 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11033 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11034 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11035 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11036 | mtu=1450" \ |
| 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 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11040 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11041 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 11042 | 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] | 11043 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11044 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11045 | -s "found fragmented DTLS handshake message" \ |
| 11046 | -c "found fragmented DTLS handshake message" \ |
| 11047 | -C "error" |
| 11048 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11049 | # An autoreduction on the client-side might happen if the server is |
| 11050 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11051 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11052 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11053 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11054 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11055 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11056 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11057 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 11058 | -p "$P_PXY mtu=512" \ |
| 11059 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11060 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11061 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11062 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11063 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11064 | mtu=512" \ |
| 11065 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11066 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11067 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11068 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Ronald Cron | 60f7666 | 2023-11-28 17:52:42 +0100 | [diff] [blame] | 11069 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11070 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11071 | mtu=512" \ |
| 11072 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11073 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11074 | -s "found fragmented DTLS handshake message" \ |
| 11075 | -c "found fragmented DTLS handshake message" \ |
| 11076 | -C "error" |
| 11077 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11078 | # An autoreduction on the client-side might happen if the server is |
| 11079 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11080 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11081 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11082 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11083 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11084 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11085 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11086 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 11087 | -p "$P_PXY mtu=512" \ |
| 11088 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11089 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11090 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11091 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11092 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11093 | mtu=512" \ |
| 11094 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11095 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11096 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11097 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11098 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11099 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11100 | mtu=512" \ |
| 11101 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11102 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11103 | -s "found fragmented DTLS handshake message" \ |
| 11104 | -c "found fragmented DTLS handshake message" \ |
| 11105 | -C "error" |
| 11106 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11107 | # An autoreduction on the client-side might happen if the server is |
| 11108 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11109 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11110 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11111 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11112 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11113 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11114 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11115 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11116 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11117 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11118 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11119 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11120 | exchanges=2 renegotiation=1 \ |
| 11121 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11122 | hs_timeout=10000-60000 \ |
| 11123 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11124 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11125 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11126 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11127 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11128 | hs_timeout=10000-60000 \ |
| 11129 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11130 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11131 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11132 | -s "found fragmented DTLS handshake message" \ |
| 11133 | -c "found fragmented DTLS handshake message" \ |
| 11134 | -C "error" |
| 11135 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11136 | # An autoreduction on the client-side might happen if the server is |
| 11137 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11138 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11139 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11140 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11141 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11142 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11143 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11144 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11145 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11146 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11147 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11148 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11149 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11150 | exchanges=2 renegotiation=1 \ |
| 11151 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11152 | hs_timeout=10000-60000 \ |
| 11153 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11154 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11155 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11156 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11157 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11158 | hs_timeout=10000-60000 \ |
| 11159 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11160 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11161 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11162 | -s "found fragmented DTLS handshake message" \ |
| 11163 | -c "found fragmented DTLS handshake message" \ |
| 11164 | -C "error" |
| 11165 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11166 | # An autoreduction on the client-side might happen if the server is |
| 11167 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11168 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11169 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11170 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11171 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11172 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11173 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11174 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11175 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11176 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11177 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11178 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11179 | exchanges=2 renegotiation=1 \ |
| 11180 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11181 | hs_timeout=10000-60000 \ |
| 11182 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11183 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11184 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11185 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11186 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11187 | hs_timeout=10000-60000 \ |
| 11188 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11189 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11190 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11191 | -s "found fragmented DTLS handshake message" \ |
| 11192 | -c "found fragmented DTLS handshake message" \ |
| 11193 | -C "error" |
| 11194 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11195 | # 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] | 11196 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11197 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11198 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11199 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11200 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 11201 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11202 | "$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] | 11203 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11204 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11205 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11206 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11207 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11208 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11209 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11210 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11211 | 0 \ |
| 11212 | -s "found fragmented DTLS handshake message" \ |
| 11213 | -c "found fragmented DTLS handshake message" \ |
| 11214 | -C "error" |
| 11215 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11216 | # 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] | 11217 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11218 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11219 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11220 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11221 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 11222 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 11223 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11224 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11225 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11226 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 11227 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11228 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11229 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11230 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11231 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 11232 | 0 \ |
| 11233 | -s "found fragmented DTLS handshake message" \ |
| 11234 | -c "found fragmented DTLS handshake message" \ |
| 11235 | -C "error" |
| 11236 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11237 | # interop tests for DTLS fragmentating with reliable connection |
| 11238 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11239 | # here and below we just want to test that the we fragment in a way that |
| 11240 | # pleases other implementations, so we don't need the peer to fragment |
| 11241 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11242 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 11243 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11244 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11245 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 11246 | "$G_SRV -u" \ |
| 11247 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11248 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11249 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11250 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11251 | 0 \ |
| 11252 | -c "fragmenting handshake message" \ |
| 11253 | -C "error" |
| 11254 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 11255 | # We use --insecure for the GnuTLS client because it expects |
| 11256 | # the hostname / IP it connects to to be the name used in the |
| 11257 | # certificate obtained from the server. Here, however, it |
| 11258 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 11259 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 11260 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 11261 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11262 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11263 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 11264 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 11265 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11266 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11267 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Valerio Setti | 3b2c028 | 2023-03-08 10:22:29 +0100 | [diff] [blame] | 11268 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11269 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11270 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11271 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 11272 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11273 | 0 \ |
| 11274 | -s "fragmenting handshake message" |
| 11275 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11276 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11277 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11278 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11279 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 11280 | "$O_SRV -dtls1_2 -verify 10" \ |
| 11281 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11282 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11283 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11284 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11285 | 0 \ |
| 11286 | -c "fragmenting handshake message" \ |
| 11287 | -C "error" |
| 11288 | |
| 11289 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11290 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11291 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11292 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 11293 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11294 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11295 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11296 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11297 | "$O_CLI -dtls1_2" \ |
| 11298 | 0 \ |
| 11299 | -s "fragmenting handshake message" |
| 11300 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11301 | # interop tests for DTLS fragmentating with unreliable connection |
| 11302 | # |
| 11303 | # again we just want to test that the we fragment in a way that |
| 11304 | # pleases other implementations, so we don't need the peer to fragment |
| 11305 | requires_gnutls_next |
| 11306 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11307 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11308 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11309 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11310 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 11311 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11312 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11313 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11314 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11315 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11316 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11317 | 0 \ |
| 11318 | -c "fragmenting handshake message" \ |
| 11319 | -C "error" |
| 11320 | |
| 11321 | requires_gnutls_next |
| 11322 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11323 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11324 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11325 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11326 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 11327 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11328 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11329 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11330 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11331 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11332 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11333 | 0 \ |
| 11334 | -s "fragmenting handshake message" |
| 11335 | |
Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 11336 | ## The test below requires 1.1.1a or higher version of openssl, otherwise |
| 11337 | ## 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] | 11338 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11339 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11340 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11341 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11342 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11343 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 11344 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11345 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11346 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11347 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11348 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11349 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11350 | 0 \ |
| 11351 | -c "fragmenting handshake message" \ |
| 11352 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11353 | |
Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 11354 | ## the test below will time out with certain seed. |
Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 11355 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 11356 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11357 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11358 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11359 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11360 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11361 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 11362 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11363 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11364 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11365 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11366 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11367 | "$O_CLI -dtls1_2" \ |
| 11368 | 0 \ |
| 11369 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11370 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11371 | # Tests for DTLS-SRTP (RFC 5764) |
| 11372 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11373 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11374 | run_test "DTLS-SRTP all profiles supported" \ |
| 11375 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11376 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11377 | 0 \ |
| 11378 | -s "found use_srtp extension" \ |
| 11379 | -s "found srtp profile" \ |
| 11380 | -s "selected srtp profile" \ |
| 11381 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11382 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11383 | -c "client hello, adding use_srtp extension" \ |
| 11384 | -c "found use_srtp extension" \ |
| 11385 | -c "found srtp profile" \ |
| 11386 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11387 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11388 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11389 | -C "error" |
| 11390 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11391 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11392 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11393 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11394 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 11395 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11396 | "$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] | 11397 | 0 \ |
| 11398 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11399 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 11400 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11401 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11402 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11403 | -c "client hello, adding use_srtp extension" \ |
| 11404 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11405 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11406 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11407 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11408 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11409 | -C "error" |
| 11410 | |
| 11411 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11412 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11413 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11414 | "$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] | 11415 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11416 | 0 \ |
| 11417 | -s "found use_srtp extension" \ |
| 11418 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11419 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11420 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11421 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11422 | -c "client hello, adding use_srtp extension" \ |
| 11423 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11424 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11425 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11426 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11427 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11428 | -C "error" |
| 11429 | |
| 11430 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11431 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11432 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 11433 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11434 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11435 | 0 \ |
| 11436 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11437 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11438 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11439 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11440 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11441 | -c "client hello, adding use_srtp extension" \ |
| 11442 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11443 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11444 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11445 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11446 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11447 | -C "error" |
| 11448 | |
| 11449 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11450 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11451 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 11452 | "$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] | 11453 | "$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] | 11454 | 0 \ |
| 11455 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11456 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11457 | -S "selected srtp profile" \ |
| 11458 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11459 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11460 | -c "client hello, adding use_srtp extension" \ |
| 11461 | -C "found use_srtp extension" \ |
| 11462 | -C "found srtp profile" \ |
| 11463 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11464 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11465 | -C "error" |
| 11466 | |
| 11467 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11468 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11469 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 11470 | "$P_SRV dtls=1 debug_level=3" \ |
| 11471 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11472 | 0 \ |
| 11473 | -s "found use_srtp extension" \ |
| 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 | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11476 | -c "client hello, adding use_srtp extension" \ |
| 11477 | -C "found use_srtp extension" \ |
| 11478 | -C "found srtp profile" \ |
| 11479 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11480 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11481 | -C "error" |
| 11482 | |
| 11483 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11485 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 11486 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 11487 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11488 | 0 \ |
| 11489 | -s "found use_srtp extension" \ |
| 11490 | -s "found srtp profile" \ |
| 11491 | -s "selected srtp profile" \ |
| 11492 | -s "server hello, adding use_srtp extension" \ |
| 11493 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11494 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11495 | -c "client hello, adding use_srtp extension" \ |
| 11496 | -c "found use_srtp extension" \ |
| 11497 | -c "found srtp profile" \ |
| 11498 | -c "selected srtp profile" \ |
| 11499 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11500 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11501 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11502 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 11503 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11504 | -C "error" |
| 11505 | |
| 11506 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11507 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11508 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 11509 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11510 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11511 | 0 \ |
| 11512 | -s "found use_srtp extension" \ |
| 11513 | -s "found srtp profile" \ |
| 11514 | -s "selected srtp profile" \ |
| 11515 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11516 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 11517 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11518 | -S "dumping 'using mki' (8 bytes)" \ |
| 11519 | -c "client hello, adding use_srtp extension" \ |
| 11520 | -c "found use_srtp extension" \ |
| 11521 | -c "found srtp profile" \ |
| 11522 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11523 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 11524 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11525 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11526 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11527 | -C "dumping 'received mki' (8 bytes)" \ |
| 11528 | -C "error" |
| 11529 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11530 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11531 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11532 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 11533 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11534 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11535 | 0 \ |
| 11536 | -s "found use_srtp extension" \ |
| 11537 | -s "found srtp profile" \ |
| 11538 | -s "selected srtp profile" \ |
| 11539 | -s "server hello, adding use_srtp extension" \ |
| 11540 | -s "DTLS-SRTP key material is"\ |
| 11541 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11542 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 11543 | |
| 11544 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11545 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11546 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 11547 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11548 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11549 | 0 \ |
| 11550 | -s "found use_srtp extension" \ |
| 11551 | -s "found srtp profile" \ |
| 11552 | -s "selected srtp profile" \ |
| 11553 | -s "server hello, adding use_srtp extension" \ |
| 11554 | -s "DTLS-SRTP key material is"\ |
| 11555 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11556 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11557 | |
| 11558 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11559 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11560 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 11561 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11562 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11563 | 0 \ |
| 11564 | -s "found use_srtp extension" \ |
| 11565 | -s "found srtp profile" \ |
| 11566 | -s "selected srtp profile" \ |
| 11567 | -s "server hello, adding use_srtp extension" \ |
| 11568 | -s "DTLS-SRTP key material is"\ |
| 11569 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11570 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11571 | |
| 11572 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11574 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 11575 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11576 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11577 | 0 \ |
| 11578 | -s "found use_srtp extension" \ |
| 11579 | -s "found srtp profile" \ |
| 11580 | -s "selected srtp profile" \ |
| 11581 | -s "server hello, adding use_srtp extension" \ |
| 11582 | -s "DTLS-SRTP key material is"\ |
| 11583 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11584 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11585 | |
| 11586 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11587 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11588 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 11589 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11590 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11591 | 0 \ |
| 11592 | -s "found use_srtp extension" \ |
| 11593 | -s "found srtp profile" \ |
| 11594 | -s "selected srtp profile" \ |
| 11595 | -s "server hello, adding use_srtp extension" \ |
| 11596 | -s "DTLS-SRTP key material is"\ |
| 11597 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11598 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11599 | |
| 11600 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11601 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11602 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 11603 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 11604 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11605 | 0 \ |
| 11606 | -s "found use_srtp extension" \ |
| 11607 | -s "found srtp profile" \ |
| 11608 | -S "selected srtp profile" \ |
| 11609 | -S "server hello, adding use_srtp extension" \ |
| 11610 | -S "DTLS-SRTP key material is"\ |
| 11611 | -C "SRTP Extension negotiated, profile" |
| 11612 | |
| 11613 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11614 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11615 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 11616 | "$P_SRV dtls=1 debug_level=3" \ |
| 11617 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11618 | 0 \ |
| 11619 | -s "found use_srtp extension" \ |
| 11620 | -S "server hello, adding use_srtp extension" \ |
| 11621 | -S "DTLS-SRTP key material is"\ |
| 11622 | -C "SRTP Extension negotiated, profile" |
| 11623 | |
| 11624 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11625 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11626 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 11627 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11628 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11629 | 0 \ |
| 11630 | -c "client hello, adding use_srtp extension" \ |
| 11631 | -c "found use_srtp extension" \ |
| 11632 | -c "found srtp profile" \ |
| 11633 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 11634 | -c "DTLS-SRTP key material is"\ |
| 11635 | -C "error" |
| 11636 | |
| 11637 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11638 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11639 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 11640 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11641 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11642 | 0 \ |
| 11643 | -c "client hello, adding use_srtp extension" \ |
| 11644 | -c "found use_srtp extension" \ |
| 11645 | -c "found srtp profile" \ |
| 11646 | -c "selected srtp profile" \ |
| 11647 | -c "DTLS-SRTP key material is"\ |
| 11648 | -C "error" |
| 11649 | |
| 11650 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11651 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11652 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 11653 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11654 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11655 | 0 \ |
| 11656 | -c "client hello, adding use_srtp extension" \ |
| 11657 | -c "found use_srtp extension" \ |
| 11658 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11659 | -c "selected srtp profile" \ |
| 11660 | -c "DTLS-SRTP key material is"\ |
| 11661 | -C "error" |
| 11662 | |
| 11663 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11665 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 11666 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11667 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11668 | 0 \ |
| 11669 | -c "client hello, adding use_srtp extension" \ |
| 11670 | -c "found use_srtp extension" \ |
| 11671 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11672 | -c "selected srtp profile" \ |
| 11673 | -c "DTLS-SRTP key material is"\ |
| 11674 | -C "error" |
| 11675 | |
| 11676 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11677 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11678 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 11679 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11680 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11681 | 0 \ |
| 11682 | -c "client hello, adding use_srtp extension" \ |
| 11683 | -c "found use_srtp extension" \ |
| 11684 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11685 | -c "selected srtp profile" \ |
| 11686 | -c "DTLS-SRTP key material is"\ |
| 11687 | -C "error" |
| 11688 | |
| 11689 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11691 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 11692 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11693 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 11694 | 0 \ |
| 11695 | -c "client hello, adding use_srtp extension" \ |
| 11696 | -C "found use_srtp extension" \ |
| 11697 | -C "found srtp profile" \ |
| 11698 | -C "selected srtp profile" \ |
| 11699 | -C "DTLS-SRTP key material is"\ |
| 11700 | -C "error" |
| 11701 | |
| 11702 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11703 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11704 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 11705 | "$O_SRV -dtls" \ |
| 11706 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11707 | 0 \ |
| 11708 | -c "client hello, adding use_srtp extension" \ |
| 11709 | -C "found use_srtp extension" \ |
| 11710 | -C "found srtp profile" \ |
| 11711 | -C "selected srtp profile" \ |
| 11712 | -C "DTLS-SRTP key material is"\ |
| 11713 | -C "error" |
| 11714 | |
| 11715 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11716 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11717 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 11718 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11719 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11720 | 0 \ |
| 11721 | -c "client hello, adding use_srtp extension" \ |
| 11722 | -c "found use_srtp extension" \ |
| 11723 | -c "found srtp profile" \ |
| 11724 | -c "selected srtp profile" \ |
| 11725 | -c "DTLS-SRTP key material is"\ |
| 11726 | -c "DTLS-SRTP no mki value negotiated"\ |
| 11727 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11728 | -C "dumping 'received mki' (8 bytes)" \ |
| 11729 | -C "error" |
| 11730 | |
| 11731 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11732 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11733 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11734 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11735 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11736 | "$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] | 11737 | 0 \ |
| 11738 | -s "found use_srtp extension" \ |
| 11739 | -s "found srtp profile" \ |
| 11740 | -s "selected srtp profile" \ |
| 11741 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11742 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11743 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 11744 | |
| 11745 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11746 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11748 | 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] | 11749 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11750 | "$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] | 11751 | 0 \ |
| 11752 | -s "found use_srtp extension" \ |
| 11753 | -s "found srtp profile" \ |
| 11754 | -s "selected srtp profile" \ |
| 11755 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11756 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11757 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 11758 | |
| 11759 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11760 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11761 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11762 | 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] | 11763 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11764 | "$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] | 11765 | 0 \ |
| 11766 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11767 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11768 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11769 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11770 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11771 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 11772 | |
| 11773 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11774 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11775 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11776 | 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] | 11777 | "$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] | 11778 | "$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] | 11779 | 0 \ |
| 11780 | -s "found use_srtp extension" \ |
| 11781 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11782 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11783 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11784 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11785 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 11786 | |
| 11787 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11788 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11789 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11790 | 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] | 11791 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11792 | "$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] | 11793 | 0 \ |
| 11794 | -s "found use_srtp extension" \ |
| 11795 | -s "found srtp profile" \ |
| 11796 | -s "selected srtp profile" \ |
| 11797 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11798 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11799 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 11800 | |
| 11801 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11802 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11804 | 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] | 11805 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 11806 | "$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] | 11807 | 0 \ |
| 11808 | -s "found use_srtp extension" \ |
| 11809 | -s "found srtp profile" \ |
| 11810 | -S "selected srtp profile" \ |
| 11811 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11812 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11813 | -C "SRTP profile:" |
| 11814 | |
| 11815 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11816 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11817 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11818 | 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] | 11819 | "$P_SRV dtls=1 debug_level=3" \ |
| 11820 | "$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] | 11821 | 0 \ |
| 11822 | -s "found use_srtp extension" \ |
| 11823 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11824 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11825 | -C "SRTP profile:" |
| 11826 | |
| 11827 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11828 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11829 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11830 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 11831 | "$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" \ |
| 11832 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11833 | 0 \ |
| 11834 | -c "client hello, adding use_srtp extension" \ |
| 11835 | -c "found use_srtp extension" \ |
| 11836 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11837 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11838 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11839 | -C "error" |
| 11840 | |
| 11841 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11842 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11843 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11844 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 11845 | "$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" \ |
| 11846 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11847 | 0 \ |
| 11848 | -c "client hello, adding use_srtp extension" \ |
| 11849 | -c "found use_srtp extension" \ |
| 11850 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11851 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11852 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11853 | -C "error" |
| 11854 | |
| 11855 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11856 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11857 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11858 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 11859 | "$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" \ |
| 11860 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11861 | 0 \ |
| 11862 | -c "client hello, adding use_srtp extension" \ |
| 11863 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11864 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11865 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11866 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11867 | -C "error" |
| 11868 | |
| 11869 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11870 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11871 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11872 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 11873 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11874 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11875 | 0 \ |
| 11876 | -c "client hello, adding use_srtp extension" \ |
| 11877 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11878 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11879 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11880 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11881 | -C "error" |
| 11882 | |
| 11883 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11884 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11885 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11886 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 11887 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11888 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11889 | 0 \ |
| 11890 | -c "client hello, adding use_srtp extension" \ |
| 11891 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11892 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11893 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11894 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11895 | -C "error" |
| 11896 | |
| 11897 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11898 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11899 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11900 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 11901 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11902 | "$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] | 11903 | 0 \ |
| 11904 | -c "client hello, adding use_srtp extension" \ |
| 11905 | -C "found use_srtp extension" \ |
| 11906 | -C "found srtp profile" \ |
| 11907 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11908 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11909 | -C "error" |
| 11910 | |
| 11911 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11912 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11913 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11914 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 11915 | "$G_SRV -u" \ |
| 11916 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11917 | 0 \ |
| 11918 | -c "client hello, adding use_srtp extension" \ |
| 11919 | -C "found use_srtp extension" \ |
| 11920 | -C "found srtp profile" \ |
| 11921 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11922 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11923 | -C "error" |
| 11924 | |
| 11925 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11926 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11927 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11928 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 11929 | "$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" \ |
| 11930 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11931 | 0 \ |
| 11932 | -c "client hello, adding use_srtp extension" \ |
| 11933 | -c "found use_srtp extension" \ |
| 11934 | -c "found srtp profile" \ |
| 11935 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11936 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 11937 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11938 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11939 | -c "dumping 'received mki' (8 bytes)" \ |
| 11940 | -C "error" |
| 11941 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 11942 | # Tests for specific things with "unreliable" UDP connection |
| 11943 | |
| 11944 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11945 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 11946 | run_test "DTLS proxy: reference" \ |
| 11947 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 11948 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 11949 | "$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] | 11950 | 0 \ |
| 11951 | -C "replayed record" \ |
| 11952 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 11953 | -C "Buffer record from epoch" \ |
| 11954 | -S "Buffer record from epoch" \ |
| 11955 | -C "ssl_buffer_message" \ |
| 11956 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 11957 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11958 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 11959 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11960 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 11961 | -c "HTTP/1.0 200 OK" |
| 11962 | |
| 11963 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11964 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11965 | run_test "DTLS proxy: duplicate every packet" \ |
| 11966 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 11967 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 11968 | "$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] | 11969 | 0 \ |
| 11970 | -c "replayed record" \ |
| 11971 | -s "replayed record" \ |
| 11972 | -c "record from another epoch" \ |
| 11973 | -s "record from another epoch" \ |
| 11974 | -S "resend" \ |
| 11975 | -s "Extra-header:" \ |
| 11976 | -c "HTTP/1.0 200 OK" |
| 11977 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11978 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11979 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 11980 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11981 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 11982 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 11983 | 0 \ |
| 11984 | -c "replayed record" \ |
| 11985 | -S "replayed record" \ |
| 11986 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11987 | -s "record from another epoch" \ |
| 11988 | -c "resend" \ |
| 11989 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11990 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11991 | -c "HTTP/1.0 200 OK" |
| 11992 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11993 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11994 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 11995 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11996 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 11997 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 11998 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11999 | -c "next record in same datagram" \ |
| 12000 | -s "next record in same datagram" |
| 12001 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12002 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12003 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 12004 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12005 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 12006 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 12007 | 0 \ |
| 12008 | -c "next record in same datagram" \ |
| 12009 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12010 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12011 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 12012 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 12013 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12014 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 12015 | "$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] | 12016 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12017 | -c "discarding invalid record (mac)" \ |
| 12018 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12019 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12020 | -c "HTTP/1.0 200 OK" \ |
| 12021 | -S "too many records with bad MAC" \ |
| 12022 | -S "Verification of the message MAC failed" |
| 12023 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12024 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12025 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 12026 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12027 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 12028 | "$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] | 12029 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12030 | -C "discarding invalid record (mac)" \ |
| 12031 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12032 | -S "Extra-header:" \ |
| 12033 | -C "HTTP/1.0 200 OK" \ |
| 12034 | -s "too many records with bad MAC" \ |
| 12035 | -s "Verification of the message MAC failed" |
| 12036 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12037 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12038 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 12039 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12040 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 12041 | "$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] | 12042 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12043 | -c "discarding invalid record (mac)" \ |
| 12044 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12045 | -s "Extra-header:" \ |
| 12046 | -c "HTTP/1.0 200 OK" \ |
| 12047 | -S "too many records with bad MAC" \ |
| 12048 | -S "Verification of the message MAC failed" |
| 12049 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12050 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12051 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 12052 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12053 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 12054 | "$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] | 12055 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12056 | -c "discarding invalid record (mac)" \ |
| 12057 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12058 | -s "Extra-header:" \ |
| 12059 | -c "HTTP/1.0 200 OK" \ |
| 12060 | -s "too many records with bad MAC" \ |
| 12061 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12062 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12063 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12064 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 12065 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 12066 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 12067 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12068 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 12069 | -c "record from another epoch" \ |
| 12070 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12071 | -s "Extra-header:" \ |
| 12072 | -c "HTTP/1.0 200 OK" |
| 12073 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 12074 | # Tests for reordering support with DTLS |
| 12075 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12076 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12077 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12078 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 12079 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12080 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12081 | hs_timeout=2500-60000" \ |
| 12082 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12083 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 12084 | 0 \ |
| 12085 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12086 | -c "Next handshake message has been buffered - load"\ |
| 12087 | -S "Buffering HS message" \ |
| 12088 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12089 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12090 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12091 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12092 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 12093 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12094 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12095 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12096 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 12097 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12098 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12099 | hs_timeout=2500-60000" \ |
| 12100 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12101 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12102 | 0 \ |
| 12103 | -c "Buffering HS message" \ |
| 12104 | -c "found fragmented DTLS handshake message"\ |
| 12105 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 12106 | -c "Next handshake message has been buffered - load"\ |
| 12107 | -S "Buffering HS message" \ |
| 12108 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12109 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12110 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12111 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 12112 | -S "Remember CCS message" |
| 12113 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12114 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 12115 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 12116 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 12117 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12118 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12119 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12120 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12121 | 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] | 12122 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12123 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12124 | hs_timeout=2500-60000" \ |
| 12125 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12126 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12127 | 0 \ |
| 12128 | -c "Buffering HS message" \ |
| 12129 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12130 | -C "attempt to make space by freeing buffered messages" \ |
| 12131 | -S "Buffering HS message" \ |
| 12132 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12133 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12134 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12135 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12136 | -S "Remember CCS message" |
| 12137 | |
| 12138 | # The size constraints ensure that the delayed certificate message can't |
| 12139 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 12140 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12141 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12142 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 12143 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12145 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 12146 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12147 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12148 | hs_timeout=2500-60000" \ |
| 12149 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12150 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12151 | 0 \ |
| 12152 | -c "Buffering HS message" \ |
| 12153 | -c "attempt to make space by freeing buffered future messages" \ |
| 12154 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12155 | -S "Buffering HS message" \ |
| 12156 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12157 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12158 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12159 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12160 | -S "Remember CCS message" |
| 12161 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12162 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12163 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12164 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 12165 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12166 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 12167 | hs_timeout=2500-60000" \ |
| 12168 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12169 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12170 | 0 \ |
| 12171 | -C "Buffering HS message" \ |
| 12172 | -C "Next handshake message has been buffered - load"\ |
| 12173 | -s "Buffering HS message" \ |
| 12174 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12175 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12176 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12177 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12178 | -S "Remember CCS message" |
| 12179 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12180 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12181 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12182 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12183 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 12184 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12185 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12186 | hs_timeout=2500-60000" \ |
| 12187 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12188 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12189 | 0 \ |
| 12190 | -C "Buffering HS message" \ |
| 12191 | -C "Next handshake message has been buffered - load"\ |
| 12192 | -S "Buffering HS message" \ |
| 12193 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12194 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12195 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12196 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12197 | -S "Remember CCS message" |
| 12198 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12199 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12201 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 12202 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12203 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12204 | hs_timeout=2500-60000" \ |
| 12205 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12206 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12207 | 0 \ |
| 12208 | -C "Buffering HS message" \ |
| 12209 | -C "Next handshake message has been buffered - load"\ |
| 12210 | -S "Buffering HS message" \ |
| 12211 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12212 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12213 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12214 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12215 | -s "Remember CCS message" |
| 12216 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12217 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12218 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12219 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12220 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12221 | hs_timeout=2500-60000" \ |
| 12222 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12223 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 12224 | 0 \ |
| 12225 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12226 | -s "Found buffered record from current epoch - load" \ |
| 12227 | -c "Buffer record from epoch 1" \ |
| 12228 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12229 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12230 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 12231 | # from the server are delayed, so that the encrypted Finished message |
| 12232 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 12233 | # in afterwards, the encrypted Finished message must be freed in order |
| 12234 | # to make space for the NewSessionTicket to be reassembled. |
| 12235 | # This works only in very particular circumstances: |
| 12236 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 12237 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 12238 | # the encrypted Finished message. |
| 12239 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 12240 | # needs to be fragmented. |
| 12241 | # - All messages sent by the server must be small enough to be either sent |
| 12242 | # without fragmentation or be reassembled within the bounds of |
| 12243 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 12244 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 12245 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 12246 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12247 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 12248 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12249 | "$P_SRV mtu=140 response_size=90 dgram_packing=0 psk=73776f726466697368 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 12250 | "$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] | 12251 | 0 \ |
| 12252 | -s "Buffer record from epoch 1" \ |
| 12253 | -s "Found buffered record from current epoch - load" \ |
| 12254 | -c "Buffer record from epoch 1" \ |
| 12255 | -C "Found buffered record from current epoch - load" \ |
| 12256 | -c "Enough space available after freeing future epoch record" |
| 12257 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 12258 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 12259 | |
| 12260 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12261 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 12262 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12263 | "$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] | 12264 | psk=73776f726466697368" \ |
| 12265 | "$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] | 12266 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12267 | 0 \ |
| 12268 | -s "Extra-header:" \ |
| 12269 | -c "HTTP/1.0 200 OK" |
| 12270 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12271 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12272 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 12273 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12274 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 12275 | "$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] | 12276 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 12277 | 0 \ |
| 12278 | -s "Extra-header:" \ |
| 12279 | -c "HTTP/1.0 200 OK" |
| 12280 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12281 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12282 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12283 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 12284 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12285 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 12286 | "$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] | 12287 | 0 \ |
| 12288 | -s "Extra-header:" \ |
| 12289 | -c "HTTP/1.0 200 OK" |
| 12290 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12291 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12292 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12293 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 12294 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12295 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 12296 | "$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] | 12297 | 0 \ |
| 12298 | -s "Extra-header:" \ |
| 12299 | -c "HTTP/1.0 200 OK" |
| 12300 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12301 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12302 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12303 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12304 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 12305 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12306 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 12307 | "$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] | 12308 | 0 \ |
| 12309 | -s "Extra-header:" \ |
| 12310 | -c "HTTP/1.0 200 OK" |
| 12311 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12312 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12313 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12314 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12315 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 12316 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12317 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 12318 | "$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] | 12319 | 0 \ |
| 12320 | -s "Extra-header:" \ |
| 12321 | -c "HTTP/1.0 200 OK" |
| 12322 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12323 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12324 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12325 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12326 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 12327 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12328 | "$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] | 12329 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12330 | "$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] | 12331 | 0 \ |
| 12332 | -s "Extra-header:" \ |
| 12333 | -c "HTTP/1.0 200 OK" |
| 12334 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12335 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 12336 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 12337 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 12338 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12339 | "$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] | 12340 | psk=73776f726466697368 debug_level=3" \ |
| 12341 | "$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] | 12342 | 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] | 12343 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12344 | 0 \ |
| 12345 | -s "a session has been resumed" \ |
| 12346 | -c "a session has been resumed" \ |
| 12347 | -s "Extra-header:" \ |
| 12348 | -c "HTTP/1.0 200 OK" |
| 12349 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12350 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 12351 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 12352 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 12353 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12354 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12355 | psk=73776f726466697368 debug_level=3 nbio=2" \ |
| 12356 | "$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] | 12357 | 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] | 12358 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 12359 | 0 \ |
| 12360 | -s "a session has been resumed" \ |
| 12361 | -c "a session has been resumed" \ |
| 12362 | -s "Extra-header:" \ |
| 12363 | -c "HTTP/1.0 200 OK" |
| 12364 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12365 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12366 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12367 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 12368 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12369 | "$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] | 12370 | psk=73776f726466697368 renegotiation=1 debug_level=2" \ |
| 12371 | "$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] | 12372 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 12373 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12374 | 0 \ |
| 12375 | -c "=> renegotiate" \ |
| 12376 | -s "=> renegotiate" \ |
| 12377 | -s "Extra-header:" \ |
| 12378 | -c "HTTP/1.0 200 OK" |
| 12379 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12380 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12381 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12382 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 12383 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12384 | "$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] | 12385 | psk=73776f726466697368 renegotiation=1 debug_level=2" \ |
| 12386 | "$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] | 12387 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12388 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12389 | 0 \ |
| 12390 | -c "=> renegotiate" \ |
| 12391 | -s "=> renegotiate" \ |
| 12392 | -s "Extra-header:" \ |
| 12393 | -c "HTTP/1.0 200 OK" |
| 12394 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12395 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12396 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12397 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 12398 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12399 | "$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] | 12400 | psk=73776f726466697368 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12401 | debug_level=2" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12402 | "$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] | 12403 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12404 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12405 | 0 \ |
| 12406 | -c "=> renegotiate" \ |
| 12407 | -s "=> renegotiate" \ |
| 12408 | -s "Extra-header:" \ |
| 12409 | -c "HTTP/1.0 200 OK" |
| 12410 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12411 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12412 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12413 | 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] | 12414 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12415 | "$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] | 12416 | psk=73776f726466697368 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12417 | debug_level=2 nbio=2" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12418 | "$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] | 12419 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12420 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12421 | 0 \ |
| 12422 | -c "=> renegotiate" \ |
| 12423 | -s "=> renegotiate" \ |
| 12424 | -s "Extra-header:" \ |
| 12425 | -c "HTTP/1.0 200 OK" |
| 12426 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12427 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 12428 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 12429 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error |
| 12430 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12431 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12432 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12433 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12434 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 12435 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 12436 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ |
| 12437 | "$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] | 12438 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 12439 | -c "HTTP/1.0 200 OK" |
| 12440 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12441 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12442 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12443 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12444 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12445 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 12446 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12447 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12448 | "$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] | 12449 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12450 | -c "HTTP/1.0 200 OK" |
| 12451 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12452 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12453 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12454 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12455 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12456 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 12457 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12458 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12459 | "$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] | 12460 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12461 | -c "HTTP/1.0 200 OK" |
| 12462 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 12463 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12464 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12465 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12467 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 12468 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 12469 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12470 | "$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] | 12471 | 0 \ |
| 12472 | -s "Extra-header:" \ |
| 12473 | -c "Extra-header:" |
| 12474 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12475 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12476 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12477 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12478 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12479 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 12480 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12481 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12482 | "$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] | 12483 | 0 \ |
| 12484 | -s "Extra-header:" \ |
| 12485 | -c "Extra-header:" |
| 12486 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12487 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12488 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12489 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12490 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12491 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 12492 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12493 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12494 | "$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] | 12495 | 0 \ |
| 12496 | -s "Extra-header:" \ |
| 12497 | -c "Extra-header:" |
| 12498 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12499 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12500 | run_test "export keys functionality" \ |
| 12501 | "$P_SRV eap_tls=1 debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 12502 | "$P_CLI force_version=tls12 eap_tls=1 debug_level=3" \ |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12503 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 12504 | -c "EAP-TLS key material is:"\ |
| 12505 | -s "EAP-TLS key material is:"\ |
| 12506 | -c "EAP-TLS IV is:" \ |
| 12507 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12508 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 12509 | # openssl feature tests: check if tls1.3 exists. |
| 12510 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12511 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 12512 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 12513 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 12514 | 0 \ |
| 12515 | -c "TLS 1.3" \ |
| 12516 | -s "TLS 1.3" |
| 12517 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 12518 | # 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] | 12519 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 12520 | requires_gnutls_next_no_ticket |
| 12521 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12522 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 12523 | "$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] | 12524 | "$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] | 12525 | 0 \ |
| 12526 | -s "Version: TLS1.3" \ |
| 12527 | -c "Version: TLS1.3" |
| 12528 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 12529 | # TLS1.3 test cases |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12530 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12531 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12532 | requires_ciphersuite_enabled TLS1-3-CHACHA20-POLY1305-SHA256 |
Valerio Setti | cf29c5d | 2023-09-01 09:03:41 +0200 | [diff] [blame] | 12533 | requires_any_configs_enabled "PSA_WANT_ECC_MONTGOMERY_255" |
| 12534 | requires_any_configs_enabled "PSA_WANT_ECC_SECP_R1_256" |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12535 | run_test "TLS 1.3: Default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12536 | "$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] | 12537 | "$P_CLI allow_sha1=0" \ |
| 12538 | 0 \ |
| 12539 | -s "Protocol is TLSv1.3" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12540 | -s "Ciphersuite is TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12541 | -s "ECDH/FFDH group: " \ |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12542 | -s "selected signature algorithm ecdsa_secp256r1_sha256" |
| 12543 | |
Ronald Cron | 587cfe6 | 2024-02-08 08:56:09 +0100 | [diff] [blame] | 12544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12545 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12546 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 12547 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 12548 | run_test "Establish TLS 1.2 then TLS 1.3 session" \ |
| 12549 | "$P_SRV" \ |
| 12550 | "( $P_CLI force_version=tls12; \ |
| 12551 | $P_CLI force_version=tls13 )" \ |
| 12552 | 0 \ |
| 12553 | -s "Protocol is TLSv1.2" \ |
| 12554 | -s "Protocol is TLSv1.3" \ |
| 12555 | |
Ronald Cron | 90abb22 | 2024-02-08 09:02:49 +0100 | [diff] [blame] | 12556 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12557 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12558 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 12559 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 12560 | run_test "Establish TLS 1.3 then TLS 1.2 session" \ |
| 12561 | "$P_SRV" \ |
| 12562 | "( $P_CLI force_version=tls13; \ |
| 12563 | $P_CLI force_version=tls12 )" \ |
| 12564 | 0 \ |
| 12565 | -s "Protocol is TLSv1.3" \ |
| 12566 | -s "Protocol is TLSv1.2" \ |
| 12567 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12568 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12569 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12570 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12571 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12572 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12573 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12574 | "$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] | 12575 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 12576 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12577 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12578 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12579 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12580 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12581 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12582 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12583 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12584 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12585 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12586 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12587 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12588 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12589 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12590 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12591 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 12592 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12593 | -c "=> parse certificate verify" \ |
| 12594 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12595 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12596 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 12597 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12598 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 12599 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 12600 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 12601 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12602 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12603 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12604 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12605 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12606 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12607 | "$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] | 12608 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 12609 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12610 | -s "SERVER HELLO was queued" \ |
| 12611 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12612 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12613 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12614 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12615 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12616 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12617 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12618 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12619 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12620 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12621 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12622 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12623 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12624 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12625 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 12626 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12627 | -c "=> parse certificate verify" \ |
| 12628 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12629 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12630 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 12631 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12632 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12633 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12634 | requires_openssl_tls1_3_with_compatible_ephemeral |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12635 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12636 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12637 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12638 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12639 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12640 | run_test "TLS 1.3: alpn - openssl" \ |
| 12641 | "$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] | 12642 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12643 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12644 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12645 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12646 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12647 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12648 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12649 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12650 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12651 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12652 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12653 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12654 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12655 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12656 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12657 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12658 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12659 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12660 | -c "=> parse certificate verify" \ |
| 12661 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12662 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 12663 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12664 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12665 | -c "HTTP/1.0 200 ok" \ |
| 12666 | -c "Application Layer Protocol is h2" |
| 12667 | |
| 12668 | requires_gnutls_tls1_3 |
| 12669 | requires_gnutls_next_no_ticket |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12670 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12671 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12672 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12673 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12674 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12675 | run_test "TLS 1.3: alpn - gnutls" \ |
| 12676 | "$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] | 12677 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12678 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12679 | -s "SERVER HELLO was queued" \ |
| 12680 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12681 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12682 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12683 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12684 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12685 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12686 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12687 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12688 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12689 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12690 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12691 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12692 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12693 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12694 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12695 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12696 | -c "=> parse certificate verify" \ |
| 12697 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12698 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 12699 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12700 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12701 | -c "HTTP/1.0 200 OK" \ |
| 12702 | -c "Application Layer Protocol is h2" |
| 12703 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12704 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12705 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 12706 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12707 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12708 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12709 | run_test "TLS 1.3: server alpn - openssl" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12710 | "$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] | 12711 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ |
| 12712 | 0 \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12713 | -s "found alpn extension" \ |
| 12714 | -s "server side, adding alpn extension" \ |
| 12715 | -s "Protocol is TLSv1.3" \ |
| 12716 | -s "HTTP/1.0 200 OK" \ |
| 12717 | -s "Application Layer Protocol is h2" |
| 12718 | |
| 12719 | requires_gnutls_tls1_3 |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12720 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 12721 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12722 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12723 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12724 | run_test "TLS 1.3: server alpn - gnutls" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12725 | "$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] | 12726 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ |
| 12727 | 0 \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12728 | -s "found alpn extension" \ |
| 12729 | -s "server side, adding alpn extension" \ |
| 12730 | -s "Protocol is TLSv1.3" \ |
| 12731 | -s "HTTP/1.0 200 OK" \ |
| 12732 | -s "Application Layer Protocol is h2" |
| 12733 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12734 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12735 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12736 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12737 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12738 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12739 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12740 | "$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] | 12741 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12742 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12743 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12744 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12745 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12746 | -c "HTTP/1.0 200 ok" \ |
| 12747 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12748 | |
| 12749 | requires_gnutls_tls1_3 |
| 12750 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12751 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12752 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12753 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12754 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12755 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12756 | "$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] | 12757 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12758 | 0 \ |
| 12759 | -c "got a certificate request" \ |
| 12760 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 12761 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12762 | -c "HTTP/1.0 200 OK" \ |
| 12763 | -c "Protocol is TLSv1.3" |
| 12764 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12765 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12766 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12767 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12768 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12769 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12770 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12771 | "$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] | 12772 | "$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] | 12773 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12774 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12775 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12776 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12777 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12778 | |
| 12779 | requires_gnutls_tls1_3 |
| 12780 | requires_gnutls_next_no_ticket |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12781 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12782 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12783 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12784 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12785 | "$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] | 12786 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/cli2.crt \ |
| 12787 | key_file=$DATA_FILES_PATH/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 12788 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12789 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12790 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12791 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12792 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12793 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12794 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12795 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12796 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12797 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12798 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12799 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12800 | "$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] | 12801 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12802 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12803 | 0 \ |
| 12804 | -c "got a certificate request" \ |
| 12805 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12806 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12807 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12808 | |
| 12809 | requires_gnutls_tls1_3 |
| 12810 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12811 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12812 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12813 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12814 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12815 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12816 | "$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] | 12817 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12818 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12819 | 0 \ |
| 12820 | -c "got a certificate request" \ |
| 12821 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12822 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12823 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12824 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12825 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12826 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12827 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12828 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12829 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12830 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12831 | "$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] | 12832 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12833 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12834 | 0 \ |
| 12835 | -c "got a certificate request" \ |
| 12836 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12837 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12838 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12839 | |
| 12840 | requires_gnutls_tls1_3 |
| 12841 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12842 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12843 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12844 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12845 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12846 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12847 | "$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] | 12848 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12849 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12850 | 0 \ |
| 12851 | -c "got a certificate request" \ |
| 12852 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12853 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12854 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12855 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12856 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12857 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12858 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12859 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12860 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12861 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12862 | "$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] | 12863 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12864 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12865 | 0 \ |
| 12866 | -c "got a certificate request" \ |
| 12867 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12868 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12869 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12870 | |
| 12871 | requires_gnutls_tls1_3 |
| 12872 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12873 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12874 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12875 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12876 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12877 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12878 | "$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] | 12879 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12880 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12881 | 0 \ |
| 12882 | -c "got a certificate request" \ |
| 12883 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12884 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12885 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12886 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12887 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12888 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12889 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12890 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12891 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12892 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12893 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12894 | "$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] | 12895 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12896 | 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] | 12897 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12898 | -c "got a certificate request" \ |
| 12899 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12900 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12901 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12902 | |
| 12903 | requires_gnutls_tls1_3 |
| 12904 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12905 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12906 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12907 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12908 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12909 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12910 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12911 | "$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] | 12912 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12913 | 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] | 12914 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12915 | -c "got a certificate request" \ |
| 12916 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12917 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12918 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12919 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12920 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12921 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12922 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12923 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12924 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12925 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12926 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 12927 | "$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] | 12928 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12929 | 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] | 12930 | 0 \ |
| 12931 | -c "got a certificate request" \ |
| 12932 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12933 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12934 | -c "Protocol is TLSv1.3" |
| 12935 | |
| 12936 | requires_gnutls_tls1_3 |
| 12937 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12938 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12939 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12940 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12941 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12942 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12943 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 12944 | "$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] | 12945 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12946 | 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] | 12947 | 0 \ |
| 12948 | -c "got a certificate request" \ |
| 12949 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12950 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12951 | -c "Protocol is TLSv1.3" |
| 12952 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12953 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12954 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12955 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12956 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12957 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12958 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12959 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 12960 | "$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] | 12961 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12962 | 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] | 12963 | 0 \ |
| 12964 | -c "got a certificate request" \ |
| 12965 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12966 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12967 | -c "Protocol is TLSv1.3" |
| 12968 | |
| 12969 | requires_gnutls_tls1_3 |
| 12970 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12971 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12972 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12973 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12974 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12975 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12976 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 12977 | "$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] | 12978 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12979 | 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] | 12980 | 0 \ |
| 12981 | -c "got a certificate request" \ |
| 12982 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12983 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12984 | -c "Protocol is TLSv1.3" |
| 12985 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12986 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12987 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12988 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12989 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12990 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12991 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 12992 | 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] | 12993 | "$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] | 12994 | -sigalgs ecdsa_secp256r1_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12995 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12996 | 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] | 12997 | 1 \ |
| 12998 | -c "got a certificate request" \ |
| 12999 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13000 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13001 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 13002 | |
| 13003 | requires_gnutls_tls1_3 |
| 13004 | requires_gnutls_next_no_ticket |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 13005 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13006 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13007 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13008 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13009 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 13010 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 13011 | "$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] | 13012 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13013 | 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] | 13014 | 1 \ |
| 13015 | -c "got a certificate request" \ |
| 13016 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13017 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13018 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 13019 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13020 | # Test using an opaque private key for client authentication |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13021 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13022 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13023 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13024 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13025 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13026 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 13027 | "$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] | 13028 | "$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] | 13029 | 0 \ |
| 13030 | -c "got a certificate request" \ |
| 13031 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13032 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13033 | -c "Protocol is TLSv1.3" |
| 13034 | |
| 13035 | requires_gnutls_tls1_3 |
| 13036 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13037 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13038 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13039 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13040 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13041 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 13042 | "$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] | 13043 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/cli2.crt \ |
| 13044 | key_file=$DATA_FILES_PATH/cli2.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13045 | 0 \ |
| 13046 | -c "got a certificate request" \ |
| 13047 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13048 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13049 | -c "Protocol is TLSv1.3" |
| 13050 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13051 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13052 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13053 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13054 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13055 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13056 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13057 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 13058 | "$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] | 13059 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 13060 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13061 | 0 \ |
| 13062 | -c "got a certificate request" \ |
| 13063 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13064 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13065 | -c "Protocol is TLSv1.3" |
| 13066 | |
| 13067 | requires_gnutls_tls1_3 |
| 13068 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13069 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13070 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13071 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13072 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13073 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13074 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 13075 | "$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] | 13076 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 13077 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13078 | 0 \ |
| 13079 | -c "got a certificate request" \ |
| 13080 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13081 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13082 | -c "Protocol is TLSv1.3" |
| 13083 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13084 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13085 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13086 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13087 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13088 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13089 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13090 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 13091 | "$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] | 13092 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 13093 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13094 | 0 \ |
| 13095 | -c "got a certificate request" \ |
| 13096 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13097 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13098 | -c "Protocol is TLSv1.3" |
| 13099 | |
| 13100 | requires_gnutls_tls1_3 |
| 13101 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13102 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13103 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13104 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13105 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13106 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13107 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 13108 | "$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] | 13109 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 13110 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13111 | 0 \ |
| 13112 | -c "got a certificate request" \ |
| 13113 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13114 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13115 | -c "Protocol is TLSv1.3" |
| 13116 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13117 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13118 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13119 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13120 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13121 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13122 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13123 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 13124 | "$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] | 13125 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13126 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13127 | 0 \ |
| 13128 | -c "got a certificate request" \ |
| 13129 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13130 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13131 | -c "Protocol is TLSv1.3" |
| 13132 | |
| 13133 | requires_gnutls_tls1_3 |
| 13134 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13135 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13136 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13137 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13138 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13139 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13140 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 13141 | "$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] | 13142 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13143 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13144 | 0 \ |
| 13145 | -c "got a certificate request" \ |
| 13146 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13147 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13148 | -c "Protocol is TLSv1.3" |
| 13149 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13150 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13151 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13152 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13153 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13154 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13155 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13156 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13157 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 13158 | "$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] | 13159 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13160 | 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] | 13161 | 0 \ |
| 13162 | -c "got a certificate request" \ |
| 13163 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13164 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13165 | -c "Protocol is TLSv1.3" |
| 13166 | |
| 13167 | requires_gnutls_tls1_3 |
| 13168 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13169 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13170 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13171 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13172 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13173 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13174 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13175 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 13176 | "$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] | 13177 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13178 | 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] | 13179 | 0 \ |
| 13180 | -c "got a certificate request" \ |
| 13181 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13182 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13183 | -c "Protocol is TLSv1.3" |
| 13184 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13185 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13186 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13187 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13188 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13189 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13190 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13191 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13192 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 13193 | "$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] | 13194 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13195 | 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] | 13196 | 0 \ |
| 13197 | -c "got a certificate request" \ |
| 13198 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13199 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13200 | -c "Protocol is TLSv1.3" |
| 13201 | |
| 13202 | requires_gnutls_tls1_3 |
| 13203 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13204 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13205 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13206 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13207 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13208 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13209 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13210 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 13211 | "$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] | 13212 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13213 | 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] | 13214 | 0 \ |
| 13215 | -c "got a certificate request" \ |
| 13216 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13217 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13218 | -c "Protocol is TLSv1.3" |
| 13219 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13220 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13221 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13222 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13223 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13224 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13225 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13226 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13227 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 13228 | "$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] | 13229 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13230 | 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] | 13231 | 0 \ |
| 13232 | -c "got a certificate request" \ |
| 13233 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13234 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13235 | -c "Protocol is TLSv1.3" |
| 13236 | |
| 13237 | requires_gnutls_tls1_3 |
| 13238 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13239 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13240 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13241 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13242 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13243 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13244 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13245 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \ |
| 13246 | "$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] | 13247 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13248 | 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] | 13249 | 0 \ |
| 13250 | -c "got a certificate request" \ |
| 13251 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13252 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13253 | -c "Protocol is TLSv1.3" |
| 13254 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13255 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13256 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13257 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13258 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13259 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13260 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13261 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13262 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 13263 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 13264 | -sigalgs ecdsa_secp256r1_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13265 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13266 | 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] | 13267 | 1 \ |
| 13268 | -c "got a certificate request" \ |
| 13269 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13270 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13271 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13272 | |
| 13273 | requires_gnutls_tls1_3 |
| 13274 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13275 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13276 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13277 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13278 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13279 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13280 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13281 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 13282 | "$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] | 13283 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13284 | 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] | 13285 | 1 \ |
| 13286 | -c "got a certificate request" \ |
| 13287 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13288 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13289 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13290 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13291 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13292 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13293 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13294 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13295 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13296 | 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] | 13297 | "$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] | 13298 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13299 | 0 \ |
| 13300 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13301 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13302 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13303 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13304 | -c "HTTP/1.0 200 ok" |
| 13305 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13306 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13307 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13308 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13309 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13310 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13311 | 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] | 13312 | "$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] | 13313 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 13314 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13315 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13316 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13317 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13318 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 13319 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13320 | |
| 13321 | requires_gnutls_tls1_3 |
| 13322 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13323 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13324 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13325 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13326 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13327 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13328 | 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] | 13329 | "$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] | 13330 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13331 | 0 \ |
| 13332 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13333 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13334 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13335 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13336 | -c "HTTP/1.0 200 OK" |
| 13337 | |
| 13338 | requires_gnutls_tls1_3 |
| 13339 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13340 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13341 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13342 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13343 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13344 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13345 | 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] | 13346 | "$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] | 13347 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 13348 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13349 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13350 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13351 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13352 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 13353 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13354 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13355 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13356 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 13357 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13358 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 13359 | run_test "TLS 1.3: Server side check - openssl" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13360 | "$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] | 13361 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 13362 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 13363 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13364 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13365 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13366 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 13367 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13368 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13369 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 13370 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13371 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13372 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13373 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13374 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13375 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13376 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13377 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13378 | "$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] | 13379 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13380 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13381 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13382 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13383 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13384 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 13385 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13386 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13387 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13388 | -s "=> parse client hello" \ |
| 13389 | -s "<= parse client hello" |
| 13390 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13391 | requires_gnutls_tls1_3 |
| 13392 | requires_gnutls_next_no_ticket |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13393 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 13394 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13395 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 13396 | run_test "TLS 1.3: Server side check - gnutls" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13397 | "$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] | 13398 | "$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] | 13399 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 13400 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13401 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13402 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13403 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 13404 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13405 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13406 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 13407 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 13408 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13409 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13410 | requires_gnutls_tls1_3 |
| 13411 | requires_gnutls_next_no_ticket |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13412 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13413 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13414 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13415 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13416 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13417 | "$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] | 13418 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13419 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13420 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13421 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13422 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13423 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 13424 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13425 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13426 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13427 | -s "=> parse client hello" \ |
| 13428 | -s "<= parse client hello" |
| 13429 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13430 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13431 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 13432 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13433 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13434 | run_test "TLS 1.3: Server side check - mbedtls" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13435 | "$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] | 13436 | "$P_CLI debug_level=4" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 13437 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13438 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13439 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13440 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13441 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13442 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13443 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13444 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 13445 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 13446 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 13447 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13448 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13449 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13450 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13451 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13452 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13453 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13454 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13455 | "$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] | 13456 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13457 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13458 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13459 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13460 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13461 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13462 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13463 | -s "=> parse client hello" \ |
| 13464 | -s "<= parse client hello" |
| 13465 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13466 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13467 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13468 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13469 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13470 | 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] | 13471 | "$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] | 13472 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13473 | 1 \ |
| 13474 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13475 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13476 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13477 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13478 | -s "=> write certificate request" \ |
| 13479 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 13480 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13481 | -s "=> parse client hello" \ |
| 13482 | -s "<= parse client hello" |
| 13483 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13484 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13485 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13486 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13487 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13488 | 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] | 13489 | "$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] | 13490 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13491 | 0 \ |
| 13492 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13493 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13494 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13495 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13496 | -s "=> write certificate request" \ |
| 13497 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13498 | -s "=> parse client hello" \ |
| 13499 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13500 | |
| 13501 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13502 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13503 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13504 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13505 | requires_config_enabled PSA_WANT_ALG_ECDH |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13506 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13507 | "$P_SRV debug_level=4 groups=secp384r1" \ |
| 13508 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 13509 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13510 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13511 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13512 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13513 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 13514 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13515 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13516 | -s "=> write hello retry request" \ |
| 13517 | -s "<= write hello retry request" |
| 13518 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13519 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13520 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13521 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13522 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13523 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13524 | "$P_SRV debug_level=4 crt_file=none key_file=none" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 13525 | "$P_CLI debug_level=4" \ |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13526 | 1 \ |
| 13527 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13528 | -s "No certificate available." |
| 13529 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13530 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13531 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13532 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13533 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13534 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13535 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13536 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13537 | 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,-,-,-" \ |
| 13538 | "$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] | 13539 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13540 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13541 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13542 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 13543 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13544 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13545 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13546 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13547 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13548 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13549 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13550 | 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,-,-,-" \ |
| 13551 | "$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] | 13552 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13553 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13554 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13555 | |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 13556 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13557 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13558 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13559 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13560 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13561 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13562 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13563 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
| 13564 | "$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] | 13565 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13566 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13567 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 13568 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 13569 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 13570 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 13571 | TEST_SUITE_NAME=${i##*/} |
| 13572 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 13573 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 13574 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 13575 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 13576 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13577 | # Test 1.3 compatibility mode |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13578 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13579 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13580 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13581 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13582 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13583 | run_test "TLS 1.3 m->m both peers do not support middlebox compatibility" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13584 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13585 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13586 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13587 | -s "Protocol is TLSv1.3" \ |
| 13588 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13589 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13590 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13591 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13592 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13593 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13594 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13595 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13596 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13597 | run_test "TLS 1.3 m->m both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13598 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13599 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13600 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13601 | -s "Protocol is TLSv1.3" \ |
| 13602 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13603 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13604 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13605 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13606 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13607 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13608 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13609 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13610 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13611 | 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] | 13612 | "$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] | 13613 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13614 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13615 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13616 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13617 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13618 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13619 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13620 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13621 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13622 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13623 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13624 | 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] | 13625 | "$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] | 13626 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13627 | 1 \ |
| 13628 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 13629 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13630 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13631 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13632 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13633 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13634 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13635 | run_test "TLS 1.3 m->O both with middlebox compat support" \ |
| 13636 | "$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] | 13637 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13638 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13639 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13640 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13641 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13642 | requires_gnutls_tls1_3 |
| 13643 | requires_gnutls_next_no_ticket |
| 13644 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13645 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13646 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13647 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13648 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13649 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 13650 | "$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] | 13651 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13652 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13653 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13654 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13655 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13656 | |
| 13657 | requires_gnutls_tls1_3 |
| 13658 | requires_gnutls_next_no_ticket |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13659 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13660 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13661 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13662 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13663 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 13664 | "$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] | 13665 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13666 | 1 \ |
| 13667 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 13668 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13669 | requires_gnutls_tls1_3 |
| 13670 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13671 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13672 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13673 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13674 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13675 | run_test "TLS 1.3 m->G both with middlebox compat support" \ |
| 13676 | "$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] | 13677 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13678 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13679 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13680 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13681 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13682 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13683 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13684 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13685 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13686 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13687 | 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] | 13688 | "$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] | 13689 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13690 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13691 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13692 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13693 | -C "14 03 03 00 01" |
| 13694 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13695 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13696 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13697 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13698 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13699 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13700 | 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] | 13701 | "$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] | 13702 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13703 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13704 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13705 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" |
| 13706 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13707 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13708 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13709 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13710 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13711 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13712 | run_test "TLS 1.3 O->m both with middlebox compat support" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13713 | "$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] | 13714 | "$O_NEXT_CLI -msg -debug" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13715 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13716 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13717 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13718 | -c "14 03 03 00 01" |
| 13719 | |
| 13720 | requires_gnutls_tls1_3 |
| 13721 | requires_gnutls_next_no_ticket |
| 13722 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13723 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13724 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13725 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13726 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13727 | 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] | 13728 | "$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] | 13729 | "$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] | 13730 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13731 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13732 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13733 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 13734 | |
| 13735 | requires_gnutls_tls1_3 |
| 13736 | requires_gnutls_next_no_ticket |
| 13737 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13738 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13739 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13740 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13741 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13742 | 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] | 13743 | "$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] | 13744 | "$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] | 13745 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13746 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13747 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13748 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 13749 | -c "discarding change cipher spec in TLS1.3" |
| 13750 | |
| 13751 | requires_gnutls_tls1_3 |
| 13752 | requires_gnutls_next_no_ticket |
| 13753 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13754 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13755 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13756 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13757 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13758 | run_test "TLS 1.3 G->m both with middlebox compat support" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13759 | "$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] | 13760 | "$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] | 13761 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13762 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13763 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13764 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 13765 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13766 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13767 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13768 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13769 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13770 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13771 | 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] | 13772 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 13773 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13774 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13775 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13776 | -c "Protocol is TLSv1.3" \ |
| 13777 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13778 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13779 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13780 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13781 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13782 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13783 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13784 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13785 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13786 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13787 | 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] | 13788 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 13789 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13790 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13791 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13792 | -c "Protocol is TLSv1.3" \ |
| 13793 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13794 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13795 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13796 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13797 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13798 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13799 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13800 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13801 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13802 | run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ |
| 13803 | "$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] | 13804 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13805 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13806 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13807 | -c "received HelloRetryRequest message" \ |
| 13808 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13809 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13810 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13811 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13812 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13813 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13814 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13815 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13816 | run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ |
| 13817 | "$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] | 13818 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13819 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13820 | -c "received HelloRetryRequest message" \ |
| 13821 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 13822 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13823 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13824 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13825 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13826 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13827 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13828 | run_test "TLS 1.3 m->O HRR both with middlebox compat support" \ |
| 13829 | "$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] | 13830 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13831 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13832 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13833 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13834 | |
| 13835 | requires_gnutls_tls1_3 |
| 13836 | requires_gnutls_next_no_ticket |
| 13837 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13838 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13839 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13840 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13841 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13842 | run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ |
| 13843 | "$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] | 13844 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13845 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13846 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13847 | -c "received HelloRetryRequest message" \ |
| 13848 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13849 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13850 | |
| 13851 | requires_gnutls_tls1_3 |
| 13852 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13853 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13854 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13855 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13856 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13857 | run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \ |
| 13858 | "$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] | 13859 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13860 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13861 | -c "received HelloRetryRequest message" \ |
| 13862 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 13863 | |
| 13864 | requires_gnutls_tls1_3 |
| 13865 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13866 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13867 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13868 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13869 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13870 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13871 | run_test "TLS 1.3 m->G HRR both with middlebox compat support" \ |
| 13872 | "$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] | 13873 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13874 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13875 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13876 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13877 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13878 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13879 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13880 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13881 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13882 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13883 | run_test "TLS 1.3 O->m HRR both peers do not support middlebox compatibility" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13884 | "$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] | 13885 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13886 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13887 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13888 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13889 | -C "14 03 03 00 01" |
| 13890 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13891 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13892 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13893 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13894 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13895 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13896 | 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] | 13897 | "$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] | 13898 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13899 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13900 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13901 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13902 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13903 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13904 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13905 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13906 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13907 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13908 | 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] | 13909 | "$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] | 13910 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13911 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13912 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13913 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13914 | -c "14 03 03 00 01" |
| 13915 | |
| 13916 | requires_gnutls_tls1_3 |
| 13917 | requires_gnutls_next_no_ticket |
| 13918 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13919 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13920 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13921 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13922 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13923 | 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] | 13924 | "$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] | 13925 | "$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] | 13926 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13927 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13928 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13929 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 13930 | |
| 13931 | requires_gnutls_tls1_3 |
| 13932 | requires_gnutls_next_no_ticket |
| 13933 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13934 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13935 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13936 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13937 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13938 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13939 | 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] | 13940 | "$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] | 13941 | "$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] | 13942 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13943 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13944 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13945 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 13946 | -c "discarding change cipher spec in TLS1.3" |
| 13947 | |
| 13948 | requires_gnutls_tls1_3 |
| 13949 | requires_gnutls_next_no_ticket |
| 13950 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13951 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13952 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13953 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13954 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13955 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13956 | 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] | 13957 | "$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] | 13958 | "$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] | 13959 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13960 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13961 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13962 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 13963 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13964 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13965 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13966 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13967 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13968 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13969 | run_test "TLS 1.3: Check signature algorithm order, m->O" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13970 | "$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] | 13971 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 13972 | -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] | 13973 | "$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] | 13974 | 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] | 13975 | 0 \ |
| 13976 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13977 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13978 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13979 | |
| 13980 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13981 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13982 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13983 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13984 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13985 | run_test "TLS 1.3: Check signature algorithm order, m->G" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13986 | "$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] | 13987 | -d 4 |
| 13988 | --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] | 13989 | "$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] | 13990 | 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] | 13991 | 0 \ |
| 13992 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13993 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13994 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13995 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13996 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13997 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13998 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13999 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14000 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14001 | run_test "TLS 1.3: Check signature algorithm order, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14002 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14003 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14004 | 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] | 14005 | 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] | 14006 | "$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] | 14007 | 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] | 14008 | 0 \ |
| 14009 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14010 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 14011 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14012 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 14013 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14014 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14015 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14016 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14017 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14018 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14019 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14020 | run_test "TLS 1.3: Check signature algorithm order, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14021 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14022 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14023 | 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] | 14024 | 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] | 14025 | "$O_NEXT_CLI_NO_CERT -msg -CAfile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14026 | -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] | 14027 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 14028 | 0 \ |
| 14029 | -c "TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14030 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14031 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 14032 | |
| 14033 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14034 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14035 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14036 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14037 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14038 | run_test "TLS 1.3: Check signature algorithm order, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14039 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14040 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14041 | 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] | 14042 | 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] | 14043 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14044 | --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] | 14045 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" \ |
| 14046 | 0 \ |
| 14047 | -c "Negotiated version: 3.4" \ |
| 14048 | -c "HTTP/1.0 200 [Oo][Kk]" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14049 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14050 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 14051 | |
| 14052 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14053 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14054 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14055 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14056 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14057 | 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] | 14058 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14059 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14060 | 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] | 14061 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14062 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14063 | --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] | 14064 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512" \ |
| 14065 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 14066 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14067 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14068 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14069 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14070 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14071 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14072 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14073 | 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] | 14074 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14075 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14076 | 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] | 14077 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14078 | "$O_NEXT_CLI_NO_CERT -msg -CAfile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14079 | -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] | 14080 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \ |
| 14081 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 14082 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14083 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14084 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14085 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14086 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14087 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14088 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14089 | 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] | 14090 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14091 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14092 | 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] | 14093 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14094 | "$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] | 14095 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14096 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 14097 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14098 | |
| 14099 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14100 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14101 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14102 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14103 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14104 | run_test "TLS 1.3: Check server no suitable certificate, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14105 | "$P_SRV debug_level=4 |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14106 | 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] | 14107 | 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] | 14108 | "$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] | 14109 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \ |
| 14110 | 1 \ |
| 14111 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14112 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14113 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14114 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14115 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14116 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14117 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14118 | run_test "TLS 1.3: Check server no suitable certificate, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14119 | "$P_SRV debug_level=4 |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14120 | 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] | 14121 | 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] | 14122 | "$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] | 14123 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \ |
| 14124 | 1 \ |
| 14125 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14126 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14127 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14128 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14129 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14130 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14131 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14132 | run_test "TLS 1.3: Check server no suitable certificate, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14133 | "$P_SRV debug_level=4 |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14134 | 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] | 14135 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 14136 | "$P_CLI allow_sha1=0 debug_level=4 \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 14137 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14138 | 1 \ |
| 14139 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14140 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14141 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14142 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14143 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14144 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14145 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14146 | run_test "TLS 1.3: Check client no signature algorithm, m->O" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14147 | "$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] | 14148 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 14149 | -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] | 14150 | "$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] | 14151 | 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] | 14152 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14153 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14154 | |
| 14155 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14156 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14157 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14158 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14159 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14160 | run_test "TLS 1.3: Check client no signature algorithm, m->G" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14161 | "$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] | 14162 | -d 4 |
| 14163 | --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] | 14164 | "$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] | 14165 | 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] | 14166 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14167 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14168 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14169 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14170 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14171 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14172 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14173 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14174 | run_test "TLS 1.3: Check client no signature algorithm, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14175 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14176 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14177 | 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] | 14178 | 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] | 14179 | "$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] | 14180 | 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] | 14181 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14182 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14183 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14184 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 14185 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 14186 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14187 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 14188 | 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] | 14189 | "$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] | 14190 | -msg -tls1_2 |
| 14191 | -Verify 10 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14192 | "$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] | 14193 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 14194 | min_version=tls12 max_version=tls13 " \ |
| 14195 | 0 \ |
| 14196 | -c "Protocol is TLSv1.2" \ |
| 14197 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14198 | |
| 14199 | |
| 14200 | requires_gnutls_tls1_3 |
| 14201 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 14202 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14203 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 14204 | 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] | 14205 | "$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] | 14206 | -d 4 |
| 14207 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14208 | "$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] | 14209 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 14210 | min_version=tls12 max_version=tls13 " \ |
| 14211 | 0 \ |
| 14212 | -c "Protocol is TLSv1.2" \ |
| 14213 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14214 | |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14215 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14216 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14217 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14218 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14219 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14220 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14221 | requires_config_enabled PSA_WANT_DH_RFC7919_3072 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14222 | requires_gnutls_tls1_3 |
| 14223 | requires_gnutls_next_no_ticket |
| 14224 | requires_gnutls_next_disable_tls13_compat |
| 14225 | 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] | 14226 | "$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" \ |
| 14227 | "$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] | 14228 | 0 \ |
| 14229 | -s "Protocol is TLSv1.3" \ |
| 14230 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14231 | -s "received signature algorithm: 0x804" \ |
| 14232 | -s "got named group: ffdhe3072(0101)" \ |
| 14233 | -s "Certificate verification was skipped" \ |
| 14234 | -C "received HelloRetryRequest message" |
| 14235 | |
| 14236 | |
| 14237 | requires_gnutls_tls1_3 |
| 14238 | requires_gnutls_next_no_ticket |
| 14239 | requires_gnutls_next_disable_tls13_compat |
| 14240 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14241 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14242 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14243 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14244 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14245 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14246 | requires_config_enabled PSA_WANT_DH_RFC7919_3072 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14247 | 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] | 14248 | "$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" \ |
| 14249 | "$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] | 14250 | 0 \ |
| 14251 | -c "HTTP/1.0 200 OK" \ |
| 14252 | -c "Protocol is TLSv1.3" \ |
| 14253 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14254 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14255 | -c "NamedGroup: ffdhe3072 ( 101 )" \ |
| 14256 | -c "Verifying peer X.509 certificate... ok" \ |
| 14257 | -C "received HelloRetryRequest message" |
| 14258 | |
| 14259 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14260 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14261 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14262 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14263 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14264 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14265 | requires_config_enabled PSA_WANT_DH_RFC7919_4096 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14266 | requires_gnutls_tls1_3 |
| 14267 | requires_gnutls_next_no_ticket |
| 14268 | requires_gnutls_next_disable_tls13_compat |
| 14269 | 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] | 14270 | "$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" \ |
| 14271 | "$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] | 14272 | 0 \ |
| 14273 | -s "Protocol is TLSv1.3" \ |
| 14274 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14275 | -s "received signature algorithm: 0x804" \ |
| 14276 | -s "got named group: ffdhe4096(0102)" \ |
| 14277 | -s "Certificate verification was skipped" \ |
| 14278 | -C "received HelloRetryRequest message" |
| 14279 | |
| 14280 | |
| 14281 | requires_gnutls_tls1_3 |
| 14282 | requires_gnutls_next_no_ticket |
| 14283 | requires_gnutls_next_disable_tls13_compat |
| 14284 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14285 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14286 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14287 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14288 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14289 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14290 | requires_config_enabled PSA_WANT_DH_RFC7919_4096 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14291 | 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] | 14292 | "$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" \ |
| 14293 | "$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] | 14294 | 0 \ |
| 14295 | -c "HTTP/1.0 200 OK" \ |
| 14296 | -c "Protocol is TLSv1.3" \ |
| 14297 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14298 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14299 | -c "NamedGroup: ffdhe4096 ( 102 )" \ |
| 14300 | -c "Verifying peer X.509 certificate... ok" \ |
| 14301 | -C "received HelloRetryRequest message" |
| 14302 | |
| 14303 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14304 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14305 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14306 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14307 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14308 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14309 | requires_config_enabled PSA_WANT_DH_RFC7919_6144 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14310 | requires_gnutls_tls1_3 |
| 14311 | requires_gnutls_next_no_ticket |
| 14312 | requires_gnutls_next_disable_tls13_compat |
| 14313 | 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] | 14314 | "$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" \ |
| 14315 | "$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] | 14316 | 0 \ |
| 14317 | -s "Protocol is TLSv1.3" \ |
| 14318 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14319 | -s "received signature algorithm: 0x804" \ |
| 14320 | -s "got named group: ffdhe6144(0103)" \ |
| 14321 | -s "Certificate verification was skipped" \ |
| 14322 | -C "received HelloRetryRequest message" |
| 14323 | |
| 14324 | requires_gnutls_tls1_3 |
| 14325 | requires_gnutls_next_no_ticket |
| 14326 | requires_gnutls_next_disable_tls13_compat |
| 14327 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14328 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14329 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14330 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14331 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14332 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14333 | requires_config_enabled PSA_WANT_DH_RFC7919_6144 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14334 | 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] | 14335 | "$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" \ |
| 14336 | "$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] | 14337 | 0 \ |
| 14338 | -c "HTTP/1.0 200 OK" \ |
| 14339 | -c "Protocol is TLSv1.3" \ |
| 14340 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14341 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14342 | -c "NamedGroup: ffdhe6144 ( 103 )" \ |
| 14343 | -c "Verifying peer X.509 certificate... ok" \ |
| 14344 | -C "received HelloRetryRequest message" |
| 14345 | |
| 14346 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14347 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14348 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14349 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14350 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14351 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14352 | requires_config_enabled PSA_WANT_DH_RFC7919_8192 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14353 | requires_gnutls_tls1_3 |
| 14354 | requires_gnutls_next_no_ticket |
| 14355 | requires_gnutls_next_disable_tls13_compat |
| 14356 | client_needs_more_time 4 |
| 14357 | 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] | 14358 | "$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" \ |
| 14359 | "$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] | 14360 | 0 \ |
| 14361 | -s "Protocol is TLSv1.3" \ |
| 14362 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14363 | -s "received signature algorithm: 0x804" \ |
| 14364 | -s "got named group: ffdhe8192(0104)" \ |
| 14365 | -s "Certificate verification was skipped" \ |
| 14366 | -C "received HelloRetryRequest message" |
| 14367 | |
| 14368 | requires_gnutls_tls1_3 |
| 14369 | requires_gnutls_next_no_ticket |
| 14370 | requires_gnutls_next_disable_tls13_compat |
| 14371 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14372 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14373 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14374 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14375 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14376 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14377 | requires_config_enabled PSA_WANT_DH_RFC7919_8192 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14378 | client_needs_more_time 4 |
| 14379 | 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] | 14380 | "$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" \ |
| 14381 | "$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] | 14382 | 0 \ |
| 14383 | -c "HTTP/1.0 200 OK" \ |
| 14384 | -c "Protocol is TLSv1.3" \ |
| 14385 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14386 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14387 | -c "NamedGroup: ffdhe8192 ( 104 )" \ |
| 14388 | -c "Verifying peer X.509 certificate... ok" \ |
| 14389 | -C "received HelloRetryRequest message" |
| 14390 | |
Ronald Cron | 8a74f07 | 2023-06-14 17:59:29 +0200 | [diff] [blame] | 14391 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 14392 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14393 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14394 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 14395 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14396 | 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] | 14397 | "$P_SRV nbio=2 psk=73776f726466697368 psk_identity=0a0b0c tls13_kex_modes=psk groups=none" \ |
| 14398 | "$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] | 14399 | 0 \ |
| 14400 | -C "received HelloRetryRequest message" \ |
| 14401 | -c "Selected key exchange mode: psk$" \ |
| 14402 | -c "HTTP/1.0 200 OK" |
| 14403 | |
Waleed Elmelegy | 0b190f1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14404 | # Legacy_compression_methods testing |
| 14405 | |
| 14406 | requires_gnutls |
Waleed Elmelegy | dc99c89 | 2024-07-15 17:25:04 +0000 | [diff] [blame] | 14407 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Waleed Elmelegy | 0b190f1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14408 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Waleed Elmelegy | dc99c89 | 2024-07-15 17:25:04 +0000 | [diff] [blame] | 14409 | run_test "TLS 1.2 ClientHello indicating support for deflate compression method" \ |
| 14410 | "$P_SRV debug_level=3" \ |
| 14411 | "$G_CLI --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+COMP-DEFLATE localhost" \ |
| 14412 | 0 \ |
| 14413 | -c "Handshake was completed" \ |
| 14414 | -s "dumping .client hello, compression. (2 bytes)" |
Waleed Elmelegy | 0b190f1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14415 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14416 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 14417 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14418 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 14419 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 14420 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 14421 | requires_max_content_len 16384 |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 14422 | run_tests_memory_after_handshake |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14423 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14424 | if [ "$LIST_TESTS" -eq 0 ]; then |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 14425 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14426 | # Final report |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 14427 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14428 | echo "------------------------------------------------------------------------" |
| 14429 | |
| 14430 | if [ $FAILS = 0 ]; then |
| 14431 | printf "PASSED" |
| 14432 | else |
| 14433 | printf "FAILED" |
| 14434 | fi |
| 14435 | PASSES=$(( $TESTS - $FAILS )) |
| 14436 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
| 14437 | |
Gilles Peskine | 39c5207 | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 14438 | if [ $((TESTS - SKIPS)) -lt $MIN_TESTS ]; then |
| 14439 | cat <<EOF |
| 14440 | Error: Expected to run at least $MIN_TESTS, but only ran $((TESTS - SKIPS)). |
| 14441 | Maybe a bad filter ('$FILTER') or a bad configuration? |
| 14442 | EOF |
| 14443 | if [ $FAILS -eq 0 ]; then |
| 14444 | FAILS=1 |
| 14445 | fi |
| 14446 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 14447 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 14448 | |
Tom Cosgrove | fc0e79e | 2023-01-13 12:13:41 +0000 | [diff] [blame] | 14449 | if [ $FAILS -gt 255 ]; then |
| 14450 | # Clamp at 255 as caller gets exit code & 0xFF |
| 14451 | # (so 256 would be 0, or success, etc) |
| 14452 | FAILS=255 |
| 14453 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 14454 | exit $FAILS |