Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # |
Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 5 | # Copyright The Mbed TLS Contributors |
Dave Rodgman | 16799db | 2023-11-02 19:47:20 +0000 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
Bence Szépkúti | c7da1fe | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 7 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 8 | # Purpose |
| 9 | # |
| 10 | # Executes tests to prove various TLS/SSL options and extensions. |
| 11 | # |
| 12 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 13 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 14 | # (session resumption from cache or ticket, renego, etc). |
| 15 | # |
| 16 | # The tests assume a build with default options, with exceptions expressed |
| 17 | # with a dependency. The tests focus on functionality and do not consider |
| 18 | # performance. |
| 19 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 20 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 21 | set -u |
| 22 | |
Jaeden Amero | 6e70eb2 | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 23 | # Limit the size of each log to 10 GiB, in case of failures with this script |
| 24 | # where it may output seemingly unlimited length error logs. |
| 25 | ulimit -f 20971520 |
| 26 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 27 | ORIGINAL_PWD=$PWD |
| 28 | if ! cd "$(dirname "$0")"; then |
| 29 | exit 125 |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 30 | fi |
| 31 | |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 32 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 33 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 34 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 35 | : ${P_PXY:=../programs/test/udp_proxy} |
Jerry Yu | d04fd35 | 2021-12-06 16:52:57 +0800 | [diff] [blame] | 36 | : ${P_QUERY:=../programs/test/query_compile_time_config} |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 37 | : ${OPENSSL:=openssl} |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 38 | : ${GNUTLS_CLI:=gnutls-cli} |
| 39 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 40 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 41 | |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 42 | # The OPENSSL variable used to be OPENSSL_CMD for historical reasons. |
| 43 | # To help the migration, error out if the old variable is set, |
| 44 | # but only if it has a different value than the new one. |
| 45 | if [ "${OPENSSL_CMD+set}" = set ]; then |
| 46 | # the variable is set, we can now check its value |
| 47 | if [ "$OPENSSL_CMD" != "$OPENSSL" ]; then |
| 48 | echo "Please use OPENSSL instead of OPENSSL_CMD." >&2 |
| 49 | exit 125 |
| 50 | fi |
| 51 | fi |
| 52 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 53 | guess_config_name() { |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 54 | if git diff --quiet ../include/mbedtls/mbedtls_config.h 2>/dev/null; then |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 55 | echo "default" |
| 56 | else |
| 57 | echo "unknown" |
| 58 | fi |
| 59 | } |
| 60 | : ${MBEDTLS_TEST_OUTCOME_FILE=} |
| 61 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} |
| 62 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} |
Jerry Yu | 53a332d | 2023-10-23 13:52:49 +0800 | [diff] [blame] | 63 | : ${EARLY_DATA_INPUT:=data_files/tls13_early_data.txt} |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 64 | |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 65 | O_SRV="$OPENSSL s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 66 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL s_client" |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 67 | G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 68 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt" |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 69 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 70 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 71 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 72 | |
Gilles Peskine | f9c798c | 2024-04-29 17:46:24 +0200 | [diff] [blame] | 73 | # If $OPENSSL is at least 1.1.1, use it as OPENSSL_NEXT as well. |
| 74 | if [ -z "${OPENSSL_NEXT:-}" ]; then |
| 75 | case $($OPENSSL version) in |
| 76 | OpenSSL\ 1.1.[1-9]*) OPENSSL_NEXT=$OPENSSL;; |
| 77 | OpenSSL\ [3-9]*) OPENSSL_NEXT=$OPENSSL;; |
| 78 | esac |
| 79 | fi |
| 80 | |
| 81 | # If $GNUTLS_CLI is at least 3.7, use it as GNUTLS_NEXT_CLI as well. |
| 82 | if [ -z "${GNUTLS_NEXT_CLI:-}" ]; then |
| 83 | case $($GNUTLS_CLI --version) in |
| 84 | gnutls-cli\ 3.[1-9][0-9]*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 85 | gnutls-cli\ 3.[7-9].*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 86 | gnutls-cli\ [4-9]*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 87 | esac |
| 88 | fi |
| 89 | |
| 90 | # If $GNUTLS_SERV is at least 3.7, use it as GNUTLS_NEXT_SERV as well. |
| 91 | if [ -z "${GNUTLS_NEXT_SERV:-}" ]; then |
| 92 | case $($GNUTLS_SERV --version) in |
| 93 | gnutls-cli\ 3.[1-9][0-9]*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 94 | gnutls-cli\ 3.[7-9].*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 95 | gnutls-cli\ [4-9]*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 96 | esac |
| 97 | fi |
| 98 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 99 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
XiaokangQian | 30f5560 | 2021-11-24 01:54:50 +0000 | [diff] [blame] | 100 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 101 | O_NEXT_SRV_EARLY_DATA="$OPENSSL_NEXT s_server -early_data -cert data_files/server5.crt -key data_files/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 102 | O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www " |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 103 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client -CAfile data_files/test-ca_cat12.crt" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 104 | 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] | 105 | else |
| 106 | O_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 107 | O_NEXT_SRV_NO_CERT=false |
Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 108 | O_NEXT_SRV_EARLY_DATA=false |
XiaokangQian | b1847a2 | 2022-06-08 07:49:31 +0000 | [diff] [blame] | 109 | O_NEXT_CLI_NO_CERT=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 110 | O_NEXT_CLI=false |
| 111 | fi |
| 112 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 113 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 114 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 115 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 116 | else |
| 117 | G_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 118 | G_NEXT_SRV_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 119 | fi |
| 120 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 121 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 122 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 123 | 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] | 124 | else |
| 125 | G_NEXT_CLI=false |
XiaokangQian | fb1a3fe | 2022-06-09 06:37:33 +0000 | [diff] [blame] | 126 | G_NEXT_CLI_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 127 | fi |
| 128 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 129 | TESTS=0 |
| 130 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 131 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 132 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 133 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 134 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 135 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 136 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 137 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 138 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 139 | SHOW_TEST_NUMBER=0 |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 140 | LIST_TESTS=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 141 | RUN_TEST_NUMBER='' |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 142 | RUN_TEST_SUITE='' |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 143 | |
Gilles Peskine | c75048c | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 144 | MIN_TESTS=1 |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 145 | PRESERVE_LOGS=0 |
| 146 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 147 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 148 | # port which is this plus 10000. Each port number may be independently |
| 149 | # overridden by a command line option. |
| 150 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 151 | PXY_PORT=$((SRV_PORT + 10000)) |
| 152 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 153 | print_usage() { |
| 154 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 155 | printf " -h|--help\tPrint this help.\n" |
| 156 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 157 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 158 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 159 | 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] | 160 | 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] | 161 | 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] | 162 | printf " --list-test-cases\tList all potential test cases (No Execution)\n" |
Gilles Peskine | c75048c | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 163 | printf " --min \tMinimum number of non-skipped tests (default 1)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 164 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 165 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 166 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 167 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 168 | printf " --seed \tInteger seed value to use for this test run\n" |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 169 | printf " --test-suite\tOnly matching test suites are executed\n" |
| 170 | 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] | 171 | } |
| 172 | |
| 173 | get_options() { |
| 174 | while [ $# -gt 0 ]; do |
| 175 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 176 | -f|--filter) |
| 177 | shift; FILTER=$1 |
| 178 | ;; |
| 179 | -e|--exclude) |
| 180 | shift; EXCLUDE=$1 |
| 181 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 182 | -m|--memcheck) |
| 183 | MEMCHECK=1 |
| 184 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 185 | -n|--number) |
| 186 | shift; RUN_TEST_NUMBER=$1 |
| 187 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 188 | -s|--show-numbers) |
| 189 | SHOW_TEST_NUMBER=1 |
| 190 | ;; |
Tomás González | 4a86da2 | 2023-09-01 17:41:16 +0100 | [diff] [blame] | 191 | -l|--list-test-cases) |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 192 | LIST_TESTS=1 |
| 193 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 194 | -p|--preserve-logs) |
| 195 | PRESERVE_LOGS=1 |
| 196 | ;; |
Gilles Peskine | c75048c | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 197 | --min) |
| 198 | shift; MIN_TESTS=$1 |
| 199 | ;; |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 200 | --outcome-file) |
| 201 | shift; MBEDTLS_TEST_OUTCOME_FILE=$1 |
| 202 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 203 | --port) |
| 204 | shift; SRV_PORT=$1 |
| 205 | ;; |
| 206 | --proxy-port) |
| 207 | shift; PXY_PORT=$1 |
| 208 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 209 | --seed) |
| 210 | shift; SEED="$1" |
| 211 | ;; |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 212 | --test-suite) |
| 213 | shift; RUN_TEST_SUITE="$1" |
| 214 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 215 | -h|--help) |
| 216 | print_usage |
| 217 | exit 0 |
| 218 | ;; |
| 219 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 220 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 221 | print_usage |
| 222 | exit 1 |
| 223 | ;; |
| 224 | esac |
| 225 | shift |
| 226 | done |
| 227 | } |
| 228 | |
Tomás González | 0e8a08a | 2023-08-23 15:29:57 +0100 | [diff] [blame] | 229 | get_options "$@" |
| 230 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 231 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 232 | # testing. Skip non-boolean options (with something other than spaces |
| 233 | # and a comment after "#define SYMBOL"). The variable contains a |
| 234 | # space-separated list of symbols. |
Tomás González | f162b4f | 2023-08-23 15:31:12 +0100 | [diff] [blame] | 235 | if [ "$LIST_TESTS" -eq 0 ];then |
| 236 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
| 237 | else |
Tomás González | be2c66e | 2023-09-01 10:34:49 +0100 | [diff] [blame] | 238 | P_QUERY=":" |
Tomás González | f162b4f | 2023-08-23 15:31:12 +0100 | [diff] [blame] | 239 | CONFIGS_ENABLED="" |
| 240 | fi |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 241 | # Skip next test; use this macro to skip tests which are legitimate |
| 242 | # in theory and expected to be re-introduced at some point, but |
| 243 | # aren't expected to succeed at the moment due to problems outside |
| 244 | # our control (such as bugs in other TLS implementations). |
| 245 | skip_next_test() { |
| 246 | SKIP_NEXT="YES" |
| 247 | } |
| 248 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 249 | # Check if the required configuration ($1) is enabled |
| 250 | is_config_enabled() |
| 251 | { |
| 252 | case $CONFIGS_ENABLED in |
| 253 | *" $1"[\ =]*) return 0;; |
| 254 | *) return 1;; |
| 255 | esac |
| 256 | } |
| 257 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 258 | # 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] | 259 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 260 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 261 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 262 | *) SKIP_NEXT="YES";; |
| 263 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 264 | } |
| 265 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 266 | # 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] | 267 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 268 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 269 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 270 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 271 | } |
| 272 | |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 273 | requires_all_configs_enabled() { |
Jerry Yu | 9dd0cc0 | 2023-10-18 11:25:30 +0800 | [diff] [blame] | 274 | if ! $P_QUERY -all $* 2>&1 > /dev/null |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 275 | then |
| 276 | SKIP_NEXT="YES" |
| 277 | fi |
| 278 | } |
| 279 | |
| 280 | requires_all_configs_disabled() { |
Jerry Yu | 9dd0cc0 | 2023-10-18 11:25:30 +0800 | [diff] [blame] | 281 | if $P_QUERY -any $* 2>&1 > /dev/null |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 282 | then |
| 283 | SKIP_NEXT="YES" |
| 284 | fi |
| 285 | } |
| 286 | |
| 287 | requires_any_configs_enabled() { |
Jerry Yu | 9dd0cc0 | 2023-10-18 11:25:30 +0800 | [diff] [blame] | 288 | if ! $P_QUERY -any $* 2>&1 > /dev/null |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 289 | then |
| 290 | SKIP_NEXT="YES" |
| 291 | fi |
| 292 | } |
| 293 | |
| 294 | requires_any_configs_disabled() { |
Jerry Yu | 9dd0cc0 | 2023-10-18 11:25:30 +0800 | [diff] [blame] | 295 | if $P_QUERY -all $* 2>&1 > /dev/null |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 296 | then |
| 297 | SKIP_NEXT="YES" |
| 298 | fi |
| 299 | } |
| 300 | |
Ronald Cron | 454eb91 | 2022-10-21 08:56:04 +0200 | [diff] [blame] | 301 | TLS1_2_KEY_EXCHANGES_WITH_CERT="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 302 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 303 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 304 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 305 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED \ |
| 306 | MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED \ |
| 307 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 308 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 309 | TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT="MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 310 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 311 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 312 | TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
| 313 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 314 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 315 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 316 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED" |
| 317 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 318 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled() { |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 319 | if $P_QUERY -all MBEDTLS_SSL_PROTO_TLS1_2 |
| 320 | then |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 321 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 322 | elif ! $P_QUERY -all MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 323 | then |
| 324 | SKIP_NEXT="YES" |
| 325 | fi |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 326 | } |
| 327 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 328 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 329 | # This function uses the query_config command line option to query the |
| 330 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 331 | # program. The command will always return a success value if the |
| 332 | # configuration is defined and the value will be printed to stdout. |
| 333 | # |
| 334 | # Note that if the configuration is not defined or is defined to nothing, |
| 335 | # the output of this function will be an empty string. |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 336 | if [ "$LIST_TESTS" -eq 0 ];then |
| 337 | ${P_SRV} "query_config=${1}" |
| 338 | else |
| 339 | echo "1" |
| 340 | fi |
| 341 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 342 | } |
| 343 | |
| 344 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 345 | VAL="$( get_config_value_or_default "$1" )" |
| 346 | if [ -z "$VAL" ]; then |
| 347 | # Should never happen |
| 348 | echo "Mbed TLS configuration $1 is not defined" |
| 349 | exit 1 |
| 350 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 351 | SKIP_NEXT="YES" |
| 352 | fi |
| 353 | } |
| 354 | |
| 355 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 356 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 357 | if [ -z "$VAL" ]; then |
| 358 | # Should never happen |
| 359 | echo "Mbed TLS configuration $1 is not defined" |
| 360 | exit 1 |
| 361 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 362 | SKIP_NEXT="YES" |
| 363 | fi |
| 364 | } |
| 365 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 366 | requires_config_value_equals() { |
| 367 | VAL=$( get_config_value_or_default "$1" ) |
| 368 | if [ -z "$VAL" ]; then |
| 369 | # Should never happen |
| 370 | echo "Mbed TLS configuration $1 is not defined" |
| 371 | exit 1 |
| 372 | elif [ "$VAL" -ne "$2" ]; then |
| 373 | SKIP_NEXT="YES" |
| 374 | fi |
| 375 | } |
| 376 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 377 | # Require Mbed TLS to support the given protocol version. |
| 378 | # |
| 379 | # Inputs: |
| 380 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 381 | requires_protocol_version() { |
| 382 | # Support for DTLS is detected separately in detect_dtls(). |
| 383 | case "$1" in |
| 384 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 385 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; |
| 386 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 387 | esac |
| 388 | } |
| 389 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 390 | # Space-separated list of ciphersuites supported by this build of |
| 391 | # Mbed TLS. |
Ronald Cron | 5b73de8 | 2023-11-28 15:49:25 +0100 | [diff] [blame] | 392 | P_CIPHERSUITES="" |
| 393 | if [ "$LIST_TESTS" -eq 0 ]; then |
| 394 | P_CIPHERSUITES=" $($P_CLI help_ciphersuites 2>/dev/null | |
| 395 | grep 'TLS-\|TLS1-3' | |
| 396 | tr -s ' \n' ' ')" |
| 397 | |
| 398 | if [ -z "${P_CIPHERSUITES# }" ]; then |
| 399 | echo >&2 "$0: fatal error: no cipher suites found!" |
| 400 | exit 125 |
| 401 | fi |
| 402 | fi |
| 403 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 404 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 405 | case $P_CIPHERSUITES in |
| 406 | *" $1 "*) :;; |
| 407 | *) SKIP_NEXT="YES";; |
| 408 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 409 | } |
| 410 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 411 | requires_cipher_enabled() { |
| 412 | KEY_TYPE=$1 |
| 413 | MODE=${2:-} |
| 414 | if is_config_enabled MBEDTLS_USE_PSA_CRYPTO; then |
| 415 | case "$KEY_TYPE" in |
| 416 | CHACHA20) |
| 417 | requires_config_enabled PSA_WANT_ALG_CHACHA20_POLY1305 |
| 418 | requires_config_enabled PSA_WANT_KEY_TYPE_CHACHA20 |
| 419 | ;; |
| 420 | *) |
| 421 | requires_config_enabled PSA_WANT_ALG_${MODE} |
| 422 | requires_config_enabled PSA_WANT_KEY_TYPE_${KEY_TYPE} |
| 423 | ;; |
| 424 | esac |
| 425 | else |
| 426 | case "$KEY_TYPE" in |
| 427 | CHACHA20) |
| 428 | requires_config_enabled MBEDTLS_CHACHA20_C |
| 429 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 430 | ;; |
| 431 | *) |
| 432 | requires_config_enabled MBEDTLS_${MODE}_C |
| 433 | requires_config_enabled MBEDTLS_${KEY_TYPE}_C |
| 434 | ;; |
| 435 | esac |
| 436 | fi |
| 437 | } |
| 438 | |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 439 | # Automatically detect required features based on command line parameters. |
| 440 | # Parameters are: |
| 441 | # - $1 = command line (call to a TLS client or server program) |
| 442 | # - $2 = client/server |
| 443 | # - $3 = TLS version (TLS12 or TLS13) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 444 | # - $4 = Use an external tool without ECDH support |
| 445 | # - $5 = run test options |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 446 | detect_required_features() { |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 447 | CMD_LINE=$1 |
| 448 | ROLE=$2 |
| 449 | TLS_VERSION=$3 |
| 450 | EXT_WO_ECDH=$4 |
| 451 | TEST_OPTIONS=${5:-} |
| 452 | |
| 453 | case "$CMD_LINE" in |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 454 | *\ force_version=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 455 | tmp="${CMD_LINE##*\ force_version=}" |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 456 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 457 | requires_protocol_version "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 458 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 459 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 460 | case "$CMD_LINE" in |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 461 | *\ force_ciphersuite=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 462 | tmp="${CMD_LINE##*\ force_ciphersuite=}" |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 463 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 464 | requires_ciphersuite_enabled "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 465 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 466 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 467 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 468 | *[-_\ =]tickets=[^0]*) |
| 469 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 470 | esac |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 471 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 472 | *[-_\ =]alpn=*) |
| 473 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 474 | esac |
| 475 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 476 | case "$CMD_LINE" in |
Gilles Peskine | 1bc28fe | 2024-04-26 21:28:49 +0200 | [diff] [blame] | 477 | */server5*|\ |
| 478 | */server7*|\ |
| 479 | */dir-maxpath*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 480 | if [ "$TLS_VERSION" = "TLS13" ]; then |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 481 | # In case of TLS13 the support for ECDSA is enough |
| 482 | requires_pk_alg "ECDSA" |
| 483 | else |
| 484 | # For TLS12 requirements are different between server and client |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 485 | if [ "$ROLE" = "server" ]; then |
Valerio Setti | 194e2bd | 2023-03-02 17:18:10 +0100 | [diff] [blame] | 486 | # If the server uses "server5*" certificates, then an ECDSA based |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 487 | # key exchange is required. However gnutls also does not |
| 488 | # support ECDH, so this limit the choice to ECDHE-ECDSA |
| 489 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 490 | requires_any_configs_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
| 491 | else |
| 492 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT |
| 493 | fi |
| 494 | elif [ "$ROLE" = "client" ]; then |
| 495 | # On the client side it is enough to have any certificate |
| 496 | # based authentication together with support for ECDSA. |
| 497 | # Of course the GnuTLS limitation mentioned above applies |
| 498 | # also here. |
| 499 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 500 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH |
| 501 | else |
| 502 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 503 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 504 | requires_pk_alg "ECDSA" |
| 505 | fi |
| 506 | fi |
| 507 | ;; |
| 508 | esac |
| 509 | |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 510 | case "$CMD_LINE" in |
Gilles Peskine | 121a7bf | 2024-04-29 16:03:02 +0200 | [diff] [blame] | 511 | */server1*|\ |
Gilles Peskine | 1bc28fe | 2024-04-26 21:28:49 +0200 | [diff] [blame] | 512 | */server2*|\ |
| 513 | */server7*) |
Gilles Peskine | 121a7bf | 2024-04-29 16:03:02 +0200 | [diff] [blame] | 514 | # Certificates with an RSA key. The algorithm requirement is |
| 515 | # some subset of {PKCS#1v1.5 encryption, PKCS#1v1.5 signature, |
| 516 | # PSS signature}. We can't easily tell which subset works, and |
| 517 | # we aren't currently running ssl-opt.sh in configurations |
| 518 | # where partial RSA support is a problem, so generically, we |
| 519 | # just require RSA and it works out for our tests so far. |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 520 | requires_config_enabled "MBEDTLS_RSA_C" |
| 521 | esac |
| 522 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 523 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 524 | } |
| 525 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 526 | requires_certificate_authentication () { |
| 527 | if [ "$PSK_ONLY" = "YES" ]; then |
| 528 | SKIP_NEXT="YES" |
| 529 | fi |
| 530 | } |
| 531 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 532 | adapt_cmd_for_psk () { |
| 533 | case "$2" in |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 534 | *openssl*s_server*) s='-psk 73776f726466697368 -nocert';; |
| 535 | *openssl*) s='-psk 73776f726466697368';; |
| 536 | *gnutls-*) s='--pskusername=Client_identity --pskkey=73776f726466697368';; |
| 537 | *) s='psk=73776f726466697368';; |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 538 | esac |
| 539 | eval $1='"$2 $s"' |
| 540 | unset s |
| 541 | } |
| 542 | |
| 543 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 544 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 545 | # |
| 546 | # If not running in a PSK-only build, do nothing. |
| 547 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 548 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 549 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 550 | # a pre-shared key, do nothing. |
| 551 | # |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 552 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 553 | # |
| 554 | # Inputs: |
| 555 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 556 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 557 | # * "$@": options passed to run_test. |
| 558 | # |
| 559 | # Outputs: |
| 560 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 561 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 562 | maybe_adapt_for_psk() { |
| 563 | if [ "$PSK_ONLY" != "YES" ]; then |
| 564 | return |
| 565 | fi |
| 566 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 567 | return |
| 568 | fi |
| 569 | case "$CLI_CMD $SRV_CMD" in |
| 570 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 571 | return;; |
| 572 | *force_ciphersuite*) |
| 573 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 574 | # PSK cipher suite could be substituted, but we're not ready for |
| 575 | # that yet. |
| 576 | SKIP_NEXT="YES" |
| 577 | return;; |
| 578 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 579 | # The test case involves certificates. PSK won't do. |
| 580 | SKIP_NEXT="YES" |
| 581 | return;; |
| 582 | esac |
| 583 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 584 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 585 | } |
| 586 | |
| 587 | case " $CONFIGS_ENABLED " in |
| 588 | *\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";; |
| 589 | *\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";; |
| 590 | *\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";; |
| 591 | *\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";; |
| 592 | *\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";; |
| 593 | *) PSK_ONLY="NO";; |
| 594 | esac |
| 595 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 596 | HAS_ALG_SHA_1="NO" |
| 597 | HAS_ALG_SHA_224="NO" |
| 598 | HAS_ALG_SHA_256="NO" |
| 599 | HAS_ALG_SHA_384="NO" |
| 600 | HAS_ALG_SHA_512="NO" |
| 601 | |
| 602 | check_for_hash_alg() |
| 603 | { |
| 604 | CURR_ALG="INVALID"; |
| 605 | USE_PSA="NO" |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 606 | if is_config_enabled "MBEDTLS_USE_PSA_CRYPTO"; then |
| 607 | USE_PSA="YES"; |
| 608 | fi |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 609 | if [ $USE_PSA = "YES" ]; then |
| 610 | CURR_ALG=PSA_WANT_ALG_${1} |
| 611 | else |
| 612 | CURR_ALG=MBEDTLS_${1}_C |
| 613 | # Remove the second underscore to match MBEDTLS_* naming convention |
| 614 | CURR_ALG=$(echo "$CURR_ALG" | sed 's/_//2') |
| 615 | fi |
| 616 | |
| 617 | case $CONFIGS_ENABLED in |
| 618 | *" $CURR_ALG"[\ =]*) |
| 619 | return 0 |
| 620 | ;; |
| 621 | *) :;; |
| 622 | esac |
| 623 | return 1 |
| 624 | } |
| 625 | |
| 626 | populate_enabled_hash_algs() |
| 627 | { |
| 628 | for hash_alg in SHA_1 SHA_224 SHA_256 SHA_384 SHA_512; do |
| 629 | if check_for_hash_alg "$hash_alg"; then |
| 630 | hash_alg_variable=HAS_ALG_${hash_alg} |
| 631 | eval ${hash_alg_variable}=YES |
| 632 | fi |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 633 | done |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 634 | } |
| 635 | |
| 636 | # skip next test if the given hash alg is not supported |
| 637 | requires_hash_alg() { |
| 638 | HASH_DEFINE="Invalid" |
| 639 | HAS_HASH_ALG="NO" |
| 640 | case $1 in |
| 641 | SHA_1):;; |
| 642 | SHA_224):;; |
| 643 | SHA_256):;; |
| 644 | SHA_384):;; |
| 645 | SHA_512):;; |
| 646 | *) |
| 647 | echo "Unsupported hash alg - $1" |
| 648 | exit 1 |
| 649 | ;; |
| 650 | esac |
| 651 | |
| 652 | HASH_DEFINE=HAS_ALG_${1} |
| 653 | eval "HAS_HASH_ALG=\${${HASH_DEFINE}}" |
| 654 | if [ "$HAS_HASH_ALG" = "NO" ] |
| 655 | then |
| 656 | SKIP_NEXT="YES" |
| 657 | fi |
| 658 | } |
| 659 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 660 | # Skip next test if the given pk alg is not enabled |
| 661 | requires_pk_alg() { |
| 662 | case $1 in |
| 663 | ECDSA) |
| 664 | if is_config_enabled MBEDTLS_USE_PSA_CRYPTO; then |
| 665 | requires_config_enabled PSA_WANT_ALG_ECDSA |
| 666 | else |
| 667 | requires_config_enabled MBEDTLS_ECDSA_C |
| 668 | fi |
| 669 | ;; |
| 670 | *) |
| 671 | echo "Unknown/unimplemented case $1 in requires_pk_alg" |
| 672 | exit 1 |
| 673 | ;; |
| 674 | esac |
| 675 | } |
| 676 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 677 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 678 | requires_openssl_with_fallback_scsv() { |
| 679 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 680 | 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] | 681 | then |
| 682 | OPENSSL_HAS_FBSCSV="YES" |
| 683 | else |
| 684 | OPENSSL_HAS_FBSCSV="NO" |
| 685 | fi |
| 686 | fi |
| 687 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 688 | SKIP_NEXT="YES" |
| 689 | fi |
| 690 | } |
| 691 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 692 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 693 | requires_max_content_len() { |
| 694 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 695 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 696 | } |
| 697 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 698 | # skip next test if GnuTLS isn't available |
| 699 | requires_gnutls() { |
| 700 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 701 | 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] | 702 | GNUTLS_AVAILABLE="YES" |
| 703 | else |
| 704 | GNUTLS_AVAILABLE="NO" |
| 705 | fi |
| 706 | fi |
| 707 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 708 | SKIP_NEXT="YES" |
| 709 | fi |
| 710 | } |
| 711 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 712 | # skip next test if GnuTLS-next isn't available |
| 713 | requires_gnutls_next() { |
| 714 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 715 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 716 | GNUTLS_NEXT_AVAILABLE="YES" |
| 717 | else |
| 718 | GNUTLS_NEXT_AVAILABLE="NO" |
| 719 | fi |
| 720 | fi |
| 721 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 722 | SKIP_NEXT="YES" |
| 723 | fi |
| 724 | } |
| 725 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 726 | requires_openssl_next() { |
| 727 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 728 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 729 | OPENSSL_NEXT_AVAILABLE="YES" |
| 730 | else |
| 731 | OPENSSL_NEXT_AVAILABLE="NO" |
| 732 | fi |
| 733 | fi |
| 734 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 735 | SKIP_NEXT="YES" |
| 736 | fi |
| 737 | } |
| 738 | |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 739 | # skip next test if openssl version is lower than 3.0 |
| 740 | requires_openssl_3_x() { |
| 741 | requires_openssl_next |
| 742 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 743 | OPENSSL_3_X_AVAILABLE="NO" |
| 744 | fi |
| 745 | if [ -z "${OPENSSL_3_X_AVAILABLE:-}" ]; then |
Przemek Stekiel | a53dca1 | 2023-06-14 20:53:09 +0200 | [diff] [blame] | 746 | if $OPENSSL_NEXT version 2>&1 | grep "OpenSSL 3." >/dev/null |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 747 | then |
| 748 | OPENSSL_3_X_AVAILABLE="YES" |
| 749 | else |
| 750 | OPENSSL_3_X_AVAILABLE="NO" |
| 751 | fi |
| 752 | fi |
| 753 | if [ "$OPENSSL_3_X_AVAILABLE" = "NO" ]; then |
| 754 | SKIP_NEXT="YES" |
| 755 | fi |
| 756 | } |
| 757 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 758 | # skip next test if openssl does not support ffdh keys |
| 759 | requires_openssl_tls1_3_with_ffdh() { |
| 760 | requires_openssl_3_x |
| 761 | } |
| 762 | |
Przemek Stekiel | 7dda271 | 2023-06-27 14:43:33 +0200 | [diff] [blame] | 763 | # skip next test if openssl cannot handle ephemeral key exchange |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 764 | requires_openssl_tls1_3_with_compatible_ephemeral() { |
| 765 | requires_openssl_next |
| 766 | |
| 767 | if !(is_config_enabled "PSA_WANT_ALG_ECDH"); then |
| 768 | requires_openssl_tls1_3_with_ffdh |
| 769 | fi |
| 770 | } |
| 771 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 772 | # skip next test if tls1_3 is not available |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 773 | requires_openssl_tls1_3() { |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 774 | requires_openssl_next |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 775 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 776 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 777 | fi |
| 778 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 779 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 780 | then |
| 781 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 782 | else |
| 783 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 784 | fi |
| 785 | fi |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 786 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 787 | SKIP_NEXT="YES" |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 788 | fi |
| 789 | } |
| 790 | |
| 791 | # skip next test if tls1_3 is not available |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 792 | requires_gnutls_tls1_3() { |
| 793 | requires_gnutls_next |
| 794 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 795 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 796 | fi |
| 797 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 798 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 799 | then |
| 800 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 801 | else |
| 802 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 803 | fi |
| 804 | fi |
| 805 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 806 | SKIP_NEXT="YES" |
| 807 | fi |
| 808 | } |
| 809 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 810 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 811 | requires_gnutls_next_no_ticket() { |
| 812 | requires_gnutls_next |
| 813 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 814 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 815 | fi |
| 816 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 817 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 818 | then |
| 819 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 820 | else |
| 821 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 822 | fi |
| 823 | fi |
| 824 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 825 | SKIP_NEXT="YES" |
| 826 | fi |
| 827 | } |
| 828 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 829 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 830 | requires_gnutls_next_disable_tls13_compat() { |
| 831 | requires_gnutls_next |
| 832 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 833 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 834 | fi |
| 835 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 836 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 837 | then |
| 838 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 839 | else |
| 840 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 841 | fi |
| 842 | fi |
| 843 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 844 | SKIP_NEXT="YES" |
| 845 | fi |
| 846 | } |
| 847 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 848 | # skip next test if GnuTLS does not support the record size limit extension |
| 849 | requires_gnutls_record_size_limit() { |
| 850 | requires_gnutls_next |
| 851 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 852 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="NO" |
| 853 | else |
| 854 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="YES" |
| 855 | fi |
| 856 | if [ "$GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE" = "NO" ]; then |
| 857 | SKIP_NEXT="YES" |
| 858 | fi |
| 859 | } |
| 860 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 861 | # skip next test if IPv6 isn't available on this host |
| 862 | requires_ipv6() { |
| 863 | if [ -z "${HAS_IPV6:-}" ]; then |
| 864 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 865 | SRV_PID=$! |
| 866 | sleep 1 |
| 867 | kill $SRV_PID >/dev/null 2>&1 |
| 868 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 869 | HAS_IPV6="NO" |
| 870 | else |
| 871 | HAS_IPV6="YES" |
| 872 | fi |
| 873 | rm -r $SRV_OUT |
| 874 | fi |
| 875 | |
| 876 | if [ "$HAS_IPV6" = "NO" ]; then |
| 877 | SKIP_NEXT="YES" |
| 878 | fi |
| 879 | } |
| 880 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 881 | # skip next test if it's i686 or uname is not available |
| 882 | requires_not_i686() { |
| 883 | if [ -z "${IS_I686:-}" ]; then |
| 884 | IS_I686="YES" |
| 885 | if which "uname" >/dev/null 2>&1; then |
| 886 | if [ -z "$(uname -a | grep i686)" ]; then |
| 887 | IS_I686="NO" |
| 888 | fi |
| 889 | fi |
| 890 | fi |
| 891 | if [ "$IS_I686" = "YES" ]; then |
| 892 | SKIP_NEXT="YES" |
| 893 | fi |
| 894 | } |
| 895 | |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 896 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 897 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 898 | 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] | 899 | if [ "$LIST_TESTS" -eq 0 ];then |
| 900 | # Calculate the input & output maximum content lengths set in the config |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 901 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 902 | # Calculate the maximum content length that fits both |
| 903 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 904 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 905 | fi |
| 906 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 907 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 908 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 909 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 910 | # skip the next test if the SSL output buffer is less than 16KB |
| 911 | requires_full_size_output_buffer() { |
| 912 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 913 | SKIP_NEXT="YES" |
| 914 | fi |
| 915 | } |
| 916 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 917 | # skip the next test if valgrind is in use |
| 918 | not_with_valgrind() { |
| 919 | if [ "$MEMCHECK" -gt 0 ]; then |
| 920 | SKIP_NEXT="YES" |
| 921 | fi |
| 922 | } |
| 923 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 924 | # skip the next test if valgrind is NOT in use |
| 925 | only_with_valgrind() { |
| 926 | if [ "$MEMCHECK" -eq 0 ]; then |
| 927 | SKIP_NEXT="YES" |
| 928 | fi |
| 929 | } |
| 930 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 931 | # 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] | 932 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 933 | CLI_DELAY_FACTOR=$1 |
| 934 | } |
| 935 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 936 | # wait for the given seconds after the client finished in the next test |
| 937 | server_needs_more_time() { |
| 938 | SRV_DELAY_SECONDS=$1 |
| 939 | } |
| 940 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 941 | # print_name <name> |
| 942 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 943 | TESTS=$(( $TESTS + 1 )) |
| 944 | LINE="" |
| 945 | |
| 946 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 947 | LINE="$TESTS " |
| 948 | fi |
| 949 | |
| 950 | LINE="$LINE$1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 951 | |
Tomás González | 378e364 | 2023-09-04 10:41:37 +0100 | [diff] [blame] | 952 | printf "%s " "$LINE" |
| 953 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
| 954 | for i in `seq 1 $LEN`; do printf '.'; done |
| 955 | printf ' ' |
| 956 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 957 | } |
| 958 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 959 | # record_outcome <outcome> [<failure-reason>] |
| 960 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 961 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 962 | record_outcome() { |
| 963 | echo "$1" |
| 964 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 965 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 966 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Jerry Yu | 9e47b26 | 2023-11-06 10:52:01 +0800 | [diff] [blame] | 967 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 968 | "$1" "${2-}" \ |
| 969 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 970 | fi |
| 971 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 972 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 973 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 974 | # True if the presence of the given pattern in a log definitely indicates |
| 975 | # that the test has failed. False if the presence is inconclusive. |
| 976 | # |
| 977 | # Inputs: |
| 978 | # * $1: pattern found in the logs |
| 979 | # * $TIMES_LEFT: >0 if retrying is an option |
| 980 | # |
| 981 | # Outputs: |
| 982 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 983 | # unchanged otherwise. |
| 984 | # * Return value: 1 if the pattern is inconclusive, |
| 985 | # 0 if the failure is definitive. |
| 986 | log_pattern_presence_is_conclusive() { |
| 987 | # If we've run out of attempts, then don't retry no matter what. |
| 988 | if [ $TIMES_LEFT -eq 0 ]; then |
| 989 | return 0 |
| 990 | fi |
| 991 | case $1 in |
| 992 | "resend") |
| 993 | # An undesired resend may have been caused by the OS dropping or |
| 994 | # delaying a packet at an inopportune time. |
| 995 | outcome="RETRY(resend)" |
| 996 | return 1;; |
| 997 | esac |
| 998 | } |
| 999 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1000 | # fail <message> |
| 1001 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1002 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 1003 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1004 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 1005 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1006 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1007 | if [ -n "$PXY_CMD" ]; then |
| 1008 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1009 | fi |
| 1010 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1011 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 1012 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1013 | echo " ! server output:" |
| 1014 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1015 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1016 | echo " ! client output:" |
| 1017 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1018 | if [ -n "$PXY_CMD" ]; then |
| 1019 | echo " ! ========================================================" |
| 1020 | echo " ! proxy output:" |
| 1021 | cat o-pxy-${TESTS}.log |
| 1022 | fi |
| 1023 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1024 | fi |
| 1025 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 1026 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1027 | } |
| 1028 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1029 | # is_polar <cmd_line> |
| 1030 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1031 | case "$1" in |
| 1032 | *ssl_client2*) true;; |
| 1033 | *ssl_server2*) true;; |
| 1034 | *) false;; |
| 1035 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1036 | } |
| 1037 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 1038 | # openssl s_server doesn't have -www with DTLS |
| 1039 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1040 | case "$SRV_CMD" in |
| 1041 | *s_server*-dtls*) |
| 1042 | NEEDS_INPUT=1 |
| 1043 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 1044 | *) NEEDS_INPUT=0;; |
| 1045 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 1046 | } |
| 1047 | |
| 1048 | # provide input to commands that need it |
| 1049 | provide_input() { |
| 1050 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 1051 | return |
| 1052 | fi |
| 1053 | |
| 1054 | while true; do |
| 1055 | echo "HTTP/1.0 200 OK" |
| 1056 | sleep 1 |
| 1057 | done |
| 1058 | } |
| 1059 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1060 | # has_mem_err <log_file_name> |
| 1061 | has_mem_err() { |
| 1062 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 1063 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 1064 | then |
| 1065 | return 1 # false: does not have errors |
| 1066 | else |
| 1067 | return 0 # true: has errors |
| 1068 | fi |
| 1069 | } |
| 1070 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1071 | # 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] | 1072 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1073 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1074 | newline=' |
| 1075 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1076 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1077 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1078 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1079 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1080 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1081 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1082 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 1083 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1084 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1085 | # When we use a proxy, it will be listening on the same port we |
| 1086 | # 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] | 1087 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1088 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1089 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1090 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1091 | echo "$3 START TIMEOUT" |
| 1092 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1093 | break |
| 1094 | fi |
| 1095 | # Linux and *BSD support decimal arguments to sleep. On other |
| 1096 | # OSes this may be a tight loop. |
| 1097 | sleep 0.1 2>/dev/null || true |
| 1098 | done |
| 1099 | } |
| 1100 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1101 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 1102 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1103 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1104 | } |
| 1105 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1106 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1107 | # Wait for server process $2 to be listening on port $1. |
| 1108 | wait_server_start() { |
| 1109 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 1110 | } |
| 1111 | |
| 1112 | # Wait for proxy process $2 to be listening on port $1. |
| 1113 | wait_proxy_start() { |
| 1114 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 1115 | } |
| 1116 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1117 | # 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] | 1118 | # 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] | 1119 | # acceptable bounds |
| 1120 | check_server_hello_time() { |
| 1121 | # 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] | 1122 | 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] | 1123 | # Get the Unix timestamp for now |
| 1124 | CUR_TIME=$(date +'%s') |
| 1125 | THRESHOLD_IN_SECS=300 |
| 1126 | |
| 1127 | # Check if the ServerHello time was printed |
| 1128 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 1129 | return 1 |
| 1130 | fi |
| 1131 | |
| 1132 | # Check the time in ServerHello is within acceptable bounds |
| 1133 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 1134 | # The time in ServerHello is at least 5 minutes before now |
| 1135 | return 1 |
| 1136 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 1137 | # 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] | 1138 | return 1 |
| 1139 | else |
| 1140 | return 0 |
| 1141 | fi |
| 1142 | } |
| 1143 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1144 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 1145 | handshake_memory_get() { |
| 1146 | OUTPUT_VARIABLE="$1" |
| 1147 | OUTPUT_FILE="$2" |
| 1148 | |
| 1149 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 1150 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 1151 | |
| 1152 | # Check if memory usage was read |
| 1153 | if [ -z "$MEM_USAGE" ]; then |
| 1154 | echo "Error: Can not read the value of handshake memory usage" |
| 1155 | return 1 |
| 1156 | else |
| 1157 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 1158 | return 0 |
| 1159 | fi |
| 1160 | } |
| 1161 | |
| 1162 | # Get handshake memory usage from server or client output and check if this value |
| 1163 | # is not higher than the maximum given by the first argument |
| 1164 | handshake_memory_check() { |
| 1165 | MAX_MEMORY="$1" |
| 1166 | OUTPUT_FILE="$2" |
| 1167 | |
| 1168 | # Get memory usage |
| 1169 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 1170 | return 1 |
| 1171 | fi |
| 1172 | |
| 1173 | # Check if memory usage is below max value |
| 1174 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 1175 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 1176 | "but should be below $MAX_MEMORY bytes" |
| 1177 | return 1 |
| 1178 | else |
| 1179 | return 0 |
| 1180 | fi |
| 1181 | } |
| 1182 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1183 | # wait for client to terminate and set CLI_EXIT |
| 1184 | # must be called right after starting the client |
| 1185 | wait_client_done() { |
| 1186 | CLI_PID=$! |
| 1187 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1188 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 1189 | CLI_DELAY_FACTOR=1 |
| 1190 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1191 | ( 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] | 1192 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1193 | |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1194 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
| 1195 | # To remove it from stdout, redirect stdout/stderr to CLI_OUT |
| 1196 | wait $CLI_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1197 | CLI_EXIT=$? |
| 1198 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1199 | kill $DOG_PID >/dev/null 2>&1 |
Jerry Yu | fe52e55 | 2022-07-09 04:23:43 +0000 | [diff] [blame] | 1200 | wait $DOG_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1201 | |
| 1202 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1203 | |
| 1204 | sleep $SRV_DELAY_SECONDS |
| 1205 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1206 | } |
| 1207 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1208 | # check if the given command uses dtls and sets global variable DTLS |
| 1209 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1210 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 1211 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1212 | *) DTLS=0;; |
| 1213 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1214 | } |
| 1215 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1216 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 1217 | is_gnutls() { |
| 1218 | case "$1" in |
| 1219 | *gnutls-cli*) |
| 1220 | CMD_IS_GNUTLS=1 |
| 1221 | ;; |
| 1222 | *gnutls-serv*) |
| 1223 | CMD_IS_GNUTLS=1 |
| 1224 | ;; |
| 1225 | *) |
| 1226 | CMD_IS_GNUTLS=0 |
| 1227 | ;; |
| 1228 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1229 | } |
| 1230 | |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 1231 | # Some external tools (gnutls or openssl) might not have support for static ECDH |
| 1232 | # 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] | 1233 | # and client command lines, given as input, to verify if the current test |
| 1234 | # is using one of these tools. |
| 1235 | use_ext_tool_without_ecdh_support() { |
| 1236 | case "$1" in |
| 1237 | *$GNUTLS_SERV*|\ |
| 1238 | *${GNUTLS_NEXT_SERV:-"gnutls-serv-dummy"}*|\ |
| 1239 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1240 | echo "yes" |
| 1241 | return;; |
| 1242 | esac |
| 1243 | case "$2" in |
| 1244 | *$GNUTLS_CLI*|\ |
| 1245 | *${GNUTLS_NEXT_CLI:-"gnutls-cli-dummy"}*|\ |
| 1246 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1247 | echo "yes" |
| 1248 | return;; |
| 1249 | esac |
| 1250 | echo "no" |
| 1251 | } |
| 1252 | |
Jerry Yu | f467d46 | 2022-11-07 13:12:44 +0800 | [diff] [blame] | 1253 | # Generate random psk_list argument for ssl_server2 |
| 1254 | get_srv_psk_list () |
| 1255 | { |
| 1256 | case $(( TESTS % 3 )) in |
| 1257 | 0) echo "psk_list=abc,dead,def,beef,Client_identity,6162636465666768696a6b6c6d6e6f70";; |
| 1258 | 1) echo "psk_list=abc,dead,Client_identity,6162636465666768696a6b6c6d6e6f70,def,beef";; |
| 1259 | 2) echo "psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70,abc,dead,def,beef";; |
| 1260 | esac |
| 1261 | } |
| 1262 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1263 | # Determine what calc_verify trace is to be expected, if any. |
| 1264 | # |
| 1265 | # calc_verify is only called for two things: to calculate the |
| 1266 | # extended master secret, and to process client authentication. |
| 1267 | # |
| 1268 | # Warning: the current implementation assumes that extended_ms is not |
| 1269 | # disabled on the client or on the server. |
| 1270 | # |
| 1271 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1272 | # * $1: the value of the server auth_mode parameter. |
| 1273 | # 'required' if client authentication is expected, |
| 1274 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1275 | # * $CONFIGS_ENABLED |
| 1276 | # |
| 1277 | # Outputs: |
| 1278 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 1279 | set_maybe_calc_verify() { |
| 1280 | maybe_calc_verify= |
| 1281 | case $CONFIGS_ENABLED in |
| 1282 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 1283 | *) |
| 1284 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1285 | ''|none) return;; |
| 1286 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1287 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 1288 | esac |
| 1289 | esac |
| 1290 | case $CONFIGS_ENABLED in |
| 1291 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 1292 | *) maybe_calc_verify="<= calc verify";; |
| 1293 | esac |
| 1294 | } |
| 1295 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1296 | # Compare file content |
| 1297 | # Usage: find_in_both pattern file1 file2 |
| 1298 | # extract from file1 the first line matching the pattern |
| 1299 | # check in file2 that the same line can be found |
| 1300 | find_in_both() { |
| 1301 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 1302 | if [ -z "$srv_pattern" ]; then |
| 1303 | return 1; |
| 1304 | fi |
| 1305 | |
| 1306 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 1307 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1308 | else |
| 1309 | return 1; |
| 1310 | fi |
| 1311 | } |
| 1312 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1313 | SKIP_HANDSHAKE_CHECK="NO" |
| 1314 | skip_handshake_stage_check() { |
| 1315 | SKIP_HANDSHAKE_CHECK="YES" |
| 1316 | } |
| 1317 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1318 | # Analyze the commands that will be used in a test. |
| 1319 | # |
| 1320 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 1321 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 1322 | # |
| 1323 | # Inputs: |
| 1324 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 1325 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 1326 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 1327 | # |
| 1328 | # Outputs: |
| 1329 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1330 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1331 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 1332 | # 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] | 1333 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1334 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 1335 | case " $SRV_CMD " in |
| 1336 | *' server_addr=::1 '*) |
| 1337 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 1338 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1339 | fi |
| 1340 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1341 | # update CMD_IS_GNUTLS variable |
| 1342 | is_gnutls "$SRV_CMD" |
| 1343 | |
| 1344 | # if the server uses gnutls but doesn't set priority, explicitly |
| 1345 | # set the default priority |
| 1346 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1347 | case "$SRV_CMD" in |
| 1348 | *--priority*) :;; |
| 1349 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 1350 | esac |
| 1351 | fi |
| 1352 | |
| 1353 | # update CMD_IS_GNUTLS variable |
| 1354 | is_gnutls "$CLI_CMD" |
| 1355 | |
| 1356 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1357 | # set the default priority |
| 1358 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1359 | case "$CLI_CMD" in |
| 1360 | *--priority*) :;; |
| 1361 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1362 | esac |
| 1363 | fi |
| 1364 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1365 | # fix client port |
| 1366 | if [ -n "$PXY_CMD" ]; then |
| 1367 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1368 | else |
| 1369 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 1370 | fi |
| 1371 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1372 | # prepend valgrind to our commands if active |
| 1373 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1374 | if is_polar "$SRV_CMD"; then |
| 1375 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1376 | fi |
| 1377 | if is_polar "$CLI_CMD"; then |
| 1378 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1379 | fi |
| 1380 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1381 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1382 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1383 | # Check for failure conditions after a test case. |
| 1384 | # |
| 1385 | # Inputs from run_test: |
| 1386 | # * positional parameters: test options (see run_test documentation) |
| 1387 | # * $CLI_EXIT: client return code |
| 1388 | # * $CLI_EXPECT: expected client return code |
| 1389 | # * $SRV_RET: server return code |
| 1390 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1391 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1392 | # |
| 1393 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1394 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1395 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1396 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1397 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1398 | if [ $TIMES_LEFT -gt 0 ] && |
| 1399 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1400 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1401 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1402 | return |
| 1403 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1404 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1405 | # 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] | 1406 | # (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] | 1407 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1408 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1409 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1410 | then |
| 1411 | if is_polar "$SRV_CMD"; then |
| 1412 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1413 | else |
| 1414 | fail "server or client failed to reach handshake stage" |
| 1415 | return |
| 1416 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1417 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1418 | if is_polar "$CLI_CMD"; then |
| 1419 | if grep "Performing the SSL/TLS handshake" $CLI_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 |
| 1425 | fi |
| 1426 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1427 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1428 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1429 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1430 | # care anyway), in case e.g. the server reports a memory leak. |
| 1431 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1432 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1433 | return |
| 1434 | fi |
| 1435 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1436 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1437 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1438 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1439 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1440 | 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] | 1441 | return |
| 1442 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1443 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1444 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1445 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1446 | # 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] | 1447 | while [ $# -gt 0 ] |
| 1448 | do |
| 1449 | case $1 in |
| 1450 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1451 | 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] | 1452 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1453 | return |
| 1454 | fi |
| 1455 | ;; |
| 1456 | |
| 1457 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1458 | 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] | 1459 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1460 | return |
| 1461 | fi |
| 1462 | ;; |
| 1463 | |
| 1464 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1465 | 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] | 1466 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1467 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1468 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1469 | return |
| 1470 | fi |
| 1471 | ;; |
| 1472 | |
| 1473 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1474 | 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] | 1475 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1476 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1477 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1478 | return |
| 1479 | fi |
| 1480 | ;; |
| 1481 | |
| 1482 | # The filtering in the following two options (-u and -U) do the following |
| 1483 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1484 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1485 | # - keep one of each non-unique line |
| 1486 | # - count how many lines remain |
| 1487 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1488 | # if there were no duplicates. |
| 1489 | "-U") |
| 1490 | 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 |
| 1491 | fail "lines following pattern '$2' must be unique in Server output" |
| 1492 | return |
| 1493 | fi |
| 1494 | ;; |
| 1495 | |
| 1496 | "-u") |
| 1497 | 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 |
| 1498 | 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] | 1499 | return |
| 1500 | fi |
| 1501 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1502 | "-F") |
| 1503 | if ! $2 "$SRV_OUT"; then |
| 1504 | fail "function call to '$2' failed on Server output" |
| 1505 | return |
| 1506 | fi |
| 1507 | ;; |
| 1508 | "-f") |
| 1509 | if ! $2 "$CLI_OUT"; then |
| 1510 | fail "function call to '$2' failed on Client output" |
| 1511 | return |
| 1512 | fi |
| 1513 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1514 | "-g") |
| 1515 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1516 | fail "function call to '$2' failed on Server and Client output" |
| 1517 | return |
| 1518 | fi |
| 1519 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1520 | |
| 1521 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1522 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1523 | exit 1 |
| 1524 | esac |
| 1525 | shift 2 |
| 1526 | done |
| 1527 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1528 | # check valgrind's results |
| 1529 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1530 | 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] | 1531 | fail "Server has memory errors" |
| 1532 | return |
| 1533 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1534 | 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] | 1535 | fail "Client has memory errors" |
| 1536 | return |
| 1537 | fi |
| 1538 | fi |
| 1539 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1540 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1541 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1542 | } |
| 1543 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1544 | # Run the current test case: start the server and if applicable the proxy, run |
| 1545 | # the client, wait for all processes to finish or time out. |
| 1546 | # |
| 1547 | # Inputs: |
| 1548 | # * $NAME: test case name |
| 1549 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1550 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1551 | # |
| 1552 | # Outputs: |
| 1553 | # * $CLI_EXIT: client return code |
| 1554 | # * $SRV_RET: server return code |
| 1555 | do_run_test_once() { |
| 1556 | # run the commands |
| 1557 | if [ -n "$PXY_CMD" ]; then |
| 1558 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1559 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1560 | PXY_PID=$! |
| 1561 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1562 | fi |
| 1563 | |
| 1564 | check_osrv_dtls |
| 1565 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1566 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1567 | SRV_PID=$! |
| 1568 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1569 | |
| 1570 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1571 | # The client must be a subprocess of the script in order for killing it to |
| 1572 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1573 | # not at the end of the line: the latter approach will spawn eval as a |
| 1574 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1575 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1576 | wait_client_done |
| 1577 | |
| 1578 | sleep 0.05 |
| 1579 | |
| 1580 | # terminate the server (and the proxy) |
| 1581 | kill $SRV_PID |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1582 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
Jerry Yu | 27d8092 | 2022-08-02 21:28:55 +0800 | [diff] [blame] | 1583 | # To remove it from stdout, redirect stdout/stderr to SRV_OUT |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1584 | wait $SRV_PID >> $SRV_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1585 | SRV_RET=$? |
| 1586 | |
| 1587 | if [ -n "$PXY_CMD" ]; then |
| 1588 | kill $PXY_PID >/dev/null 2>&1 |
Jerry Yu | 6969eee | 2022-10-10 10:25:26 +0800 | [diff] [blame] | 1589 | wait $PXY_PID >> $PXY_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1590 | fi |
| 1591 | } |
| 1592 | |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1593 | # 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] | 1594 | # $1 and $2 contain the server and client command lines, respectively. |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1595 | # |
| 1596 | # Note: this function only provides some guess about TLS version by simply |
Yanray Wang | 7b320fa | 2023-11-08 10:33:30 +0800 | [diff] [blame] | 1597 | # looking at the server/client command lines. Even though this works |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1598 | # for the sake of tests' filtering (especially in conjunction with the |
| 1599 | # detect_required_features() function), it does NOT guarantee that the |
| 1600 | # result is accurate. It does not check other conditions, such as: |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1601 | # - we can force a ciphersuite which contains "WITH" in its name, meaning |
| 1602 | # that we are going to use TLS 1.2 |
| 1603 | # - etc etc |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1604 | get_tls_version() { |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1605 | # First check if the version is forced on an Mbed TLS peer |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1606 | case $1 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1607 | *tls12*) |
| 1608 | echo "TLS12" |
| 1609 | return;; |
| 1610 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1611 | echo "TLS13" |
| 1612 | return;; |
| 1613 | esac |
| 1614 | case $2 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1615 | *tls12*) |
| 1616 | echo "TLS12" |
| 1617 | return;; |
| 1618 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1619 | echo "TLS13" |
| 1620 | return;; |
| 1621 | esac |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1622 | # Second check if the version is forced on an OpenSSL or GnuTLS peer |
| 1623 | case $1 in |
| 1624 | tls1_2*) |
| 1625 | echo "TLS12" |
| 1626 | return;; |
| 1627 | *tls1_3) |
| 1628 | echo "TLS13" |
| 1629 | return;; |
| 1630 | esac |
| 1631 | case $2 in |
| 1632 | *tls1_2) |
| 1633 | echo "TLS12" |
| 1634 | return;; |
| 1635 | *tls1_3) |
| 1636 | echo "TLS13" |
| 1637 | return;; |
| 1638 | esac |
| 1639 | # Third if the version is not forced, if TLS 1.3 is enabled then the test |
| 1640 | # is aimed to run a TLS 1.3 handshake. |
| 1641 | if $P_QUERY -all MBEDTLS_SSL_PROTO_TLS1_3 |
| 1642 | then |
| 1643 | echo "TLS13" |
| 1644 | else |
| 1645 | echo "TLS12" |
| 1646 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1647 | } |
| 1648 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1649 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1650 | # Options: -s pattern pattern that must be present in server output |
| 1651 | # -c pattern pattern that must be present in client output |
| 1652 | # -u pattern lines after pattern must be unique in client output |
| 1653 | # -f call shell function on client output |
| 1654 | # -S pattern pattern that must be absent in server output |
| 1655 | # -C pattern pattern that must be absent in client output |
| 1656 | # -U pattern lines after pattern must be unique in server output |
| 1657 | # -F call shell function on server output |
| 1658 | # -g call shell function on server and client output |
| 1659 | run_test() { |
| 1660 | NAME="$1" |
| 1661 | shift 1 |
| 1662 | |
Tomás González | 787428a | 2023-08-23 15:27:19 +0100 | [diff] [blame] | 1663 | if is_excluded "$NAME"; then |
| 1664 | SKIP_NEXT="NO" |
| 1665 | # There was no request to run the test, so don't record its outcome. |
| 1666 | return |
| 1667 | fi |
| 1668 | |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1669 | if [ "$LIST_TESTS" -gt 0 ]; then |
Pengyu Lv | 3c170d3 | 2023-11-29 13:53:34 +0800 | [diff] [blame] | 1670 | printf "%s\n" "${TEST_SUITE_NAME:-ssl-opt};$NAME" |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1671 | return |
| 1672 | fi |
| 1673 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 1674 | # Use ssl-opt as default test suite name. Also see record_outcome function |
| 1675 | if is_excluded_test_suite "${TEST_SUITE_NAME:-ssl-opt}"; then |
| 1676 | # Do not skip next test and skip current test. |
| 1677 | SKIP_NEXT="NO" |
| 1678 | return |
| 1679 | fi |
| 1680 | |
Tomás González | 51cb704 | 2023-09-07 10:21:19 +0100 | [diff] [blame] | 1681 | print_name "$NAME" |
| 1682 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1683 | # Do we only run numbered tests? |
| 1684 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1685 | case ",$RUN_TEST_NUMBER," in |
| 1686 | *",$TESTS,"*) :;; |
| 1687 | *) SKIP_NEXT="YES";; |
| 1688 | esac |
| 1689 | fi |
| 1690 | |
| 1691 | # does this test use a proxy? |
| 1692 | if [ "X$1" = "X-p" ]; then |
| 1693 | PXY_CMD="$2" |
| 1694 | shift 2 |
| 1695 | else |
| 1696 | PXY_CMD="" |
| 1697 | fi |
| 1698 | |
| 1699 | # get commands and client output |
| 1700 | SRV_CMD="$1" |
| 1701 | CLI_CMD="$2" |
| 1702 | CLI_EXPECT="$3" |
| 1703 | shift 3 |
| 1704 | |
| 1705 | # Check if test uses files |
| 1706 | case "$SRV_CMD $CLI_CMD" in |
| 1707 | *data_files/*) |
| 1708 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1709 | esac |
| 1710 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1711 | # Check if the test uses DTLS. |
| 1712 | detect_dtls "$SRV_CMD" |
| 1713 | if [ "$DTLS" -eq 1 ]; then |
| 1714 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1715 | fi |
| 1716 | |
Yanray Wang | 7b320fa | 2023-11-08 10:33:30 +0800 | [diff] [blame] | 1717 | # 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] | 1718 | EXT_WO_ECDH=$(use_ext_tool_without_ecdh_support "$SRV_CMD" "$CLI_CMD") |
| 1719 | |
Valerio Setti | 726ffbf | 2023-08-02 20:02:44 +0200 | [diff] [blame] | 1720 | # Guess the TLS version which is going to be used |
| 1721 | if [ "$EXT_WO_ECDH" = "no" ]; then |
| 1722 | TLS_VERSION=$(get_tls_version "$SRV_CMD" "$CLI_CMD") |
| 1723 | else |
| 1724 | TLS_VERSION="TLS12" |
| 1725 | fi |
| 1726 | |
| 1727 | # 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] | 1728 | # from their command-line arguments, check whether they're enabled. |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1729 | detect_required_features "$SRV_CMD" "server" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
| 1730 | detect_required_features "$CLI_CMD" "client" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1731 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 1732 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1733 | maybe_adapt_for_psk "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1734 | |
| 1735 | # should we skip? |
| 1736 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1737 | SKIP_NEXT="NO" |
| 1738 | record_outcome "SKIP" |
| 1739 | SKIPS=$(( $SKIPS + 1 )) |
| 1740 | return |
| 1741 | fi |
| 1742 | |
| 1743 | analyze_test_commands "$@" |
| 1744 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1745 | # One regular run and two retries |
| 1746 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1747 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1748 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1749 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1750 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1751 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1752 | check_test_failure "$@" |
| 1753 | case $outcome in |
| 1754 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1755 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1756 | FAIL) return;; |
| 1757 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1758 | done |
| 1759 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1760 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1761 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1762 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1763 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1764 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1765 | if [ -n "$PXY_CMD" ]; then |
| 1766 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1767 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1768 | fi |
| 1769 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1770 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1771 | } |
| 1772 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1773 | run_test_psa() { |
| 1774 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1775 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1776 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1777 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1778 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1779 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1780 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1781 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1782 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1783 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1784 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1785 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1786 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1787 | -S "error" \ |
| 1788 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1789 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1790 | } |
| 1791 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1792 | run_test_psa_force_curve() { |
| 1793 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1794 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1795 | run_test "PSA - ECDH with $1" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 1796 | "$P_SRV debug_level=4 force_version=tls12 groups=$1" \ |
| 1797 | "$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] | 1798 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1799 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1800 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1801 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1802 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1803 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1804 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1805 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1806 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1807 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1808 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1809 | } |
| 1810 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1811 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1812 | # a maximum fragment length. |
| 1813 | # first argument ($1) is MFL for SSL client |
| 1814 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1815 | run_test_memory_after_hanshake_with_mfl() |
| 1816 | { |
| 1817 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1818 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1819 | |
| 1820 | # Leave some margin for robustness |
| 1821 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1822 | |
| 1823 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1824 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1825 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1826 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1827 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1828 | 0 \ |
| 1829 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1830 | } |
| 1831 | |
| 1832 | |
| 1833 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1834 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1835 | run_tests_memory_after_hanshake() |
| 1836 | { |
| 1837 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1838 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1839 | |
| 1840 | # first test with default MFU is to get reference memory usage |
| 1841 | MEMORY_USAGE_MFL_16K=0 |
| 1842 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1843 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1844 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1845 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1846 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1847 | 0 \ |
| 1848 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1849 | |
| 1850 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1851 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1852 | |
| 1853 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1854 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1855 | |
| 1856 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1857 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1858 | |
| 1859 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1860 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1861 | } |
| 1862 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1863 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1864 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1865 | rm -f context_srv.txt |
| 1866 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1867 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1868 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1869 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1870 | 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] | 1871 | exit 1 |
| 1872 | } |
| 1873 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1874 | # |
| 1875 | # MAIN |
| 1876 | # |
| 1877 | |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 1878 | # Make the outcome file path relative to the original directory, not |
| 1879 | # to .../tests |
| 1880 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 1881 | [!/]*) |
| 1882 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 1883 | ;; |
| 1884 | esac |
| 1885 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 1886 | populate_enabled_hash_algs |
| 1887 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1888 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1889 | # patterns rather than regular expressions, use a case statement instead |
| 1890 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1891 | # detects simple cases: plain substring, everything, nothing. |
| 1892 | # |
| 1893 | # As an exception, the character '.' is treated as an ordinary character |
| 1894 | # if it is the only special character in the string. This is because it's |
| 1895 | # rare to need "any one character", but needing a literal '.' is common |
| 1896 | # (e.g. '-f "DTLS 1.2"'). |
| 1897 | need_grep= |
| 1898 | case "$FILTER" in |
| 1899 | '^$') simple_filter=;; |
| 1900 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1901 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1902 | need_grep=1;; |
| 1903 | *) # No regexp or shell-pattern special character |
| 1904 | simple_filter="*$FILTER*";; |
| 1905 | esac |
| 1906 | case "$EXCLUDE" in |
| 1907 | '^$') simple_exclude=;; |
| 1908 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1909 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1910 | need_grep=1;; |
| 1911 | *) # No regexp or shell-pattern special character |
| 1912 | simple_exclude="*$EXCLUDE*";; |
| 1913 | esac |
| 1914 | if [ -n "$need_grep" ]; then |
| 1915 | is_excluded () { |
| 1916 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1917 | } |
| 1918 | else |
| 1919 | is_excluded () { |
| 1920 | case "$1" in |
| 1921 | $simple_exclude) true;; |
| 1922 | $simple_filter) false;; |
| 1923 | *) true;; |
| 1924 | esac |
| 1925 | } |
| 1926 | fi |
| 1927 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 1928 | # Filter tests according to TEST_SUITE_NAME |
| 1929 | is_excluded_test_suite () { |
| 1930 | if [ -n "$RUN_TEST_SUITE" ] |
| 1931 | then |
| 1932 | case ",$RUN_TEST_SUITE," in |
| 1933 | *",$1,"*) false;; |
| 1934 | *) true;; |
| 1935 | esac |
| 1936 | else |
| 1937 | false |
| 1938 | fi |
| 1939 | |
| 1940 | } |
| 1941 | |
| 1942 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 1943 | if [ "$LIST_TESTS" -eq 0 ];then |
| 1944 | |
| 1945 | # sanity checks, avoid an avalanche of errors |
| 1946 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1947 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1948 | P_PXY_BIN="${P_PXY%%[ ]*}" |
| 1949 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1950 | echo "Command '$P_SRV_BIN' is not an executable file" |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1951 | exit 1 |
| 1952 | fi |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 1953 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1954 | echo "Command '$P_CLI_BIN' is not an executable file" |
| 1955 | exit 1 |
| 1956 | fi |
| 1957 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1958 | echo "Command '$P_PXY_BIN' is not an executable file" |
| 1959 | exit 1 |
| 1960 | fi |
| 1961 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1962 | if which valgrind >/dev/null 2>&1; then :; else |
| 1963 | echo "Memcheck not possible. Valgrind not found" |
| 1964 | exit 1 |
| 1965 | fi |
| 1966 | fi |
| 1967 | if which $OPENSSL >/dev/null 2>&1; then :; else |
| 1968 | echo "Command '$OPENSSL' not found" |
| 1969 | exit 1 |
| 1970 | fi |
| 1971 | |
| 1972 | # used by watchdog |
| 1973 | MAIN_PID="$$" |
| 1974 | |
| 1975 | # We use somewhat arbitrary delays for tests: |
| 1976 | # - how long do we wait for the server to start (when lsof not available)? |
| 1977 | # - how long do we allow for the client to finish? |
| 1978 | # (not to check performance, just to avoid waiting indefinitely) |
| 1979 | # Things are slower with valgrind, so give extra time here. |
| 1980 | # |
| 1981 | # Note: without lsof, there is a trade-off between the running time of this |
| 1982 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1983 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1984 | # the script, only the case where a client or server gets stuck. |
| 1985 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1986 | START_DELAY=6 |
| 1987 | DOG_DELAY=60 |
| 1988 | else |
| 1989 | START_DELAY=2 |
| 1990 | DOG_DELAY=20 |
| 1991 | fi |
| 1992 | |
| 1993 | # some particular tests need more time: |
| 1994 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1995 | # - for the server, we sleep for a number of seconds after the client exits |
| 1996 | # see client_need_more_time() and server_needs_more_time() |
| 1997 | CLI_DELAY_FACTOR=1 |
| 1998 | SRV_DELAY_SECONDS=0 |
| 1999 | |
| 2000 | # fix commands to use this port, force IPv4 while at it |
| 2001 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
| 2002 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 2003 | # machines that will resolve to ::1, and we don't want ipv6 here. |
| 2004 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 2005 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
| 2006 | 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"}" |
| 2007 | O_SRV="$O_SRV -accept $SRV_PORT" |
| 2008 | O_CLI="$O_CLI -connect 127.0.0.1:+SRV_PORT" |
| 2009 | G_SRV="$G_SRV -p $SRV_PORT" |
| 2010 | G_CLI="$G_CLI -p +SRV_PORT" |
| 2011 | |
| 2012 | # Newer versions of OpenSSL have a syntax to enable all "ciphers", even |
| 2013 | # low-security ones. This covers not just cipher suites but also protocol |
| 2014 | # versions. It is necessary, for example, to use (D)TLS 1.0/1.1 on |
| 2015 | # OpenSSL 1.1.1f from Ubuntu 20.04. The syntax was only introduced in |
| 2016 | # OpenSSL 1.1.0 (21e0c1d23afff48601eb93135defddae51f7e2e3) and I can't find |
| 2017 | # a way to discover it from -help, so check the openssl version. |
| 2018 | case $($OPENSSL version) in |
| 2019 | "OpenSSL 0"*|"OpenSSL 1.0"*) :;; |
| 2020 | *) |
| 2021 | O_CLI="$O_CLI -cipher ALL@SECLEVEL=0" |
| 2022 | O_SRV="$O_SRV -cipher ALL@SECLEVEL=0" |
| 2023 | ;; |
| 2024 | esac |
| 2025 | |
| 2026 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 2027 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
| 2028 | O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT" |
| 2029 | O_NEXT_SRV_EARLY_DATA="$O_NEXT_SRV_EARLY_DATA -accept $SRV_PORT" |
| 2030 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
| 2031 | O_NEXT_CLI_NO_CERT="$O_NEXT_CLI_NO_CERT -connect 127.0.0.1:+SRV_PORT" |
| 2032 | fi |
| 2033 | |
| 2034 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
| 2035 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 2036 | G_NEXT_SRV_NO_CERT="$G_NEXT_SRV_NO_CERT -p $SRV_PORT" |
| 2037 | fi |
| 2038 | |
| 2039 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
| 2040 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
| 2041 | G_NEXT_CLI_NO_CERT="$G_NEXT_CLI_NO_CERT -p +SRV_PORT localhost" |
| 2042 | fi |
| 2043 | |
| 2044 | # Allow SHA-1, because many of our test certificates use it |
| 2045 | P_SRV="$P_SRV allow_sha1=1" |
| 2046 | P_CLI="$P_CLI allow_sha1=1" |
| 2047 | |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 2048 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2049 | # Also pick a unique name for intermediate files |
| 2050 | SRV_OUT="srv_out.$$" |
| 2051 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 2052 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2053 | SESSION="session.$$" |
| 2054 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 2055 | SKIP_NEXT="NO" |
| 2056 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 2057 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 2058 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2059 | # Basic test |
| 2060 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2061 | # Checks that: |
| 2062 | # - 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] | 2063 | # - the expected parameters are selected |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2064 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2065 | requires_hash_alg SHA_512 # "signature_algorithm ext: 6" |
Valerio Setti | 482a0b9 | 2023-08-18 15:55:10 +0200 | [diff] [blame] | 2066 | requires_any_configs_enabled "MBEDTLS_ECP_DP_CURVE25519_ENABLED \ |
| 2067 | PSA_WANT_ECC_MONTGOMERY_255" |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2068 | run_test "Default, TLS 1.2" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2069 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2070 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2071 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2072 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 2073 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2074 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 2075 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2076 | -S "error" \ |
| 2077 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2078 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2079 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2080 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2081 | run_test "Default, DTLS" \ |
| 2082 | "$P_SRV dtls=1" \ |
| 2083 | "$P_CLI dtls=1" \ |
| 2084 | 0 \ |
| 2085 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 2086 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2087 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 2088 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 2089 | run_test "TLS client auth: required" \ |
| 2090 | "$P_SRV auth_mode=required" \ |
| 2091 | "$P_CLI" \ |
| 2092 | 0 \ |
| 2093 | -s "Verifying peer X.509 certificate... ok" |
| 2094 | |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 2095 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2096 | "$P_SRV" \ |
| 2097 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2098 | 0 \ |
| 2099 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2100 | -c "Key size is 256" |
| 2101 | |
| 2102 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2103 | "$P_SRV" \ |
| 2104 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2105 | 0 \ |
| 2106 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2107 | -c "Key size is 128" |
| 2108 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2109 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2110 | requires_config_enabled MBEDTLS_MD_CAN_MD5 |
| 2111 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2112 | # module does not support PSA dispatching so we need builtin support. |
| 2113 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2114 | requires_config_enabled MBEDTLS_AES_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2115 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2116 | run_test "TLS: password protected client key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2117 | "$P_SRV force_version=tls12 auth_mode=required" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2118 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 2119 | 0 |
| 2120 | |
| 2121 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2122 | requires_config_enabled MBEDTLS_MD_CAN_MD5 |
| 2123 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2124 | # module does not support PSA dispatching so we need builtin support. |
| 2125 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2126 | requires_config_enabled MBEDTLS_AES_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2127 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2128 | run_test "TLS: password protected server key" \ |
| 2129 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2130 | "$P_CLI force_version=tls12" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2131 | 0 |
| 2132 | |
| 2133 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2134 | requires_config_enabled MBEDTLS_RSA_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2135 | requires_config_enabled MBEDTLS_MD_CAN_MD5 |
| 2136 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2137 | # module does not support PSA dispatching so we need builtin support. |
| 2138 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2139 | requires_config_enabled MBEDTLS_AES_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2140 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2141 | run_test "TLS: password protected server key, two certificates" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2142 | "$P_SRV force_version=tls12\ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2143 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 2144 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 2145 | "$P_CLI" \ |
| 2146 | 0 |
| 2147 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2148 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2149 | run_test "CA callback on client" \ |
| 2150 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2151 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 " \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2152 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2153 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2154 | -S "error" \ |
| 2155 | -C "error" |
| 2156 | |
| 2157 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2158 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2159 | requires_hash_alg SHA_256 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2160 | run_test "CA callback on server" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2161 | "$P_SRV force_version=tls12 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2162 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 2163 | key_file=data_files/server5.key" \ |
| 2164 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2165 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2166 | -s "Verifying peer X.509 certificate... ok" \ |
| 2167 | -S "error" \ |
| 2168 | -C "error" |
| 2169 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2170 | # Test using an EC opaque private key for client authentication |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2171 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2172 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2173 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2174 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2175 | run_test "Opaque key for client authentication: ECDHE-ECDSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2176 | "$P_SRV force_version=tls12 auth_mode=required crt_file=data_files/server5.crt \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2177 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2178 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2179 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2180 | 0 \ |
| 2181 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2182 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2183 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2184 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2185 | -S "error" \ |
| 2186 | -C "error" |
| 2187 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2188 | # Test using a RSA opaque private key for client authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2189 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2190 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2191 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2192 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2193 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2194 | run_test "Opaque key for client authentication: ECDHE-RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2195 | "$P_SRV force_version=tls12 auth_mode=required crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2196 | key_file=data_files/server2.key" \ |
| 2197 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2198 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2199 | 0 \ |
| 2200 | -c "key type: Opaque" \ |
| 2201 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2202 | -s "Verifying peer X.509 certificate... ok" \ |
| 2203 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2204 | -S "error" \ |
| 2205 | -C "error" |
| 2206 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2207 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2208 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2209 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2210 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2211 | run_test "Opaque key for client authentication: DHE-RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2212 | "$P_SRV force_version=tls12 auth_mode=required crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2213 | key_file=data_files/server2.key" \ |
| 2214 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2215 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2216 | key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2217 | 0 \ |
| 2218 | -c "key type: Opaque" \ |
| 2219 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2220 | -s "Verifying peer X.509 certificate... ok" \ |
| 2221 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2222 | -S "error" \ |
| 2223 | -C "error" |
| 2224 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2225 | # Test using an EC opaque private key for server authentication |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2226 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2227 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2228 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2229 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2230 | run_test "Opaque key for server authentication: ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2231 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2232 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2233 | "$P_CLI force_version=tls12" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2234 | 0 \ |
| 2235 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2236 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2237 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2238 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2239 | -S "error" \ |
| 2240 | -C "error" |
| 2241 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2242 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2243 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2244 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2245 | run_test "Opaque key for server authentication: ECDH-" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2246 | "$P_SRV auth_mode=required key_opaque=1\ |
Neil Armstrong | b7b549a | 2022-03-25 15:13:02 +0100 | [diff] [blame] | 2247 | crt_file=data_files/server5.ku-ka.crt\ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2248 | key_file=data_files/server5.key key_opaque_algs=ecdh,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2249 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2250 | 0 \ |
| 2251 | -c "Verifying peer X.509 certificate... ok" \ |
| 2252 | -c "Ciphersuite is TLS-ECDH-" \ |
| 2253 | -s "key types: Opaque, none" \ |
| 2254 | -s "Ciphersuite is TLS-ECDH-" \ |
| 2255 | -S "error" \ |
| 2256 | -C "error" |
| 2257 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2258 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2259 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2260 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2261 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2262 | run_test "Opaque key for server authentication: invalid key: decrypt with ECC key, no async" \ |
| 2263 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
| 2264 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ |
| 2265 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2266 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2267 | 1 \ |
| 2268 | -s "key types: Opaque, none" \ |
| 2269 | -s "error" \ |
| 2270 | -c "error" \ |
| 2271 | -c "Public key type mismatch" |
| 2272 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2273 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2274 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2275 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2276 | requires_config_enabled MBEDTLS_RSA_C |
| 2277 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2278 | requires_hash_alg SHA_256 |
| 2279 | run_test "Opaque key for server authentication: invalid key: ecdh with RSA key, no async" \ |
| 2280 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2281 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ |
| 2282 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2283 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2284 | 1 \ |
| 2285 | -s "key types: Opaque, none" \ |
| 2286 | -s "error" \ |
| 2287 | -c "error" \ |
| 2288 | -c "Public key type mismatch" |
| 2289 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2290 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2291 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2292 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2293 | requires_hash_alg SHA_256 |
| 2294 | run_test "Opaque key for server authentication: invalid alg: decrypt with ECC key, async" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2295 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2296 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ |
| 2297 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2298 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2299 | 1 \ |
| 2300 | -s "key types: Opaque, none" \ |
| 2301 | -s "got ciphersuites in common, but none of them usable" \ |
| 2302 | -s "error" \ |
| 2303 | -c "error" |
| 2304 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2305 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2306 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2307 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2308 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2309 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2310 | run_test "Opaque key for server authentication: invalid alg: ecdh with RSA key, async" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2311 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2312 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ |
| 2313 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2314 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2315 | 1 \ |
| 2316 | -s "key types: Opaque, none" \ |
| 2317 | -s "got ciphersuites in common, but none of them usable" \ |
| 2318 | -s "error" \ |
| 2319 | -c "error" |
| 2320 | |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2321 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2322 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2323 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2324 | run_test "Opaque key for server authentication: invalid alg: ECDHE-ECDSA with ecdh" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2325 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2326 | key_file=data_files/server5.key key_opaque_algs=ecdh,none \ |
| 2327 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2328 | "$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] | 2329 | 1 \ |
| 2330 | -s "key types: Opaque, none" \ |
| 2331 | -s "got ciphersuites in common, but none of them usable" \ |
| 2332 | -s "error" \ |
| 2333 | -c "error" |
| 2334 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2335 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2336 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2337 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2338 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2339 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2340 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDHE-ECDSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2341 | "$P_SRV force_version=tls12 key_opaque=1 crt_file=data_files/server7.crt \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2342 | key_file=data_files/server7.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2343 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ |
| 2344 | key_opaque_algs2=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2345 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2346 | 0 \ |
| 2347 | -c "Verifying peer X.509 certificate... ok" \ |
| 2348 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2349 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2350 | -s "key types: Opaque, Opaque" \ |
| 2351 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2352 | -S "error" \ |
| 2353 | -C "error" |
| 2354 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2355 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2356 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2357 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2358 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2359 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDH-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2360 | "$P_SRV key_opaque=1 crt_file=data_files/server7.crt \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2361 | key_file=data_files/server7.key key_opaque_algs=ecdsa-sign,none \ |
| 2362 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ |
| 2363 | key_opaque_algs2=ecdh,none debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2364 | "$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] | 2365 | 0 \ |
| 2366 | -c "Verifying peer X.509 certificate... ok" \ |
| 2367 | -c "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2368 | -c "CN=Polarssl Test EC CA" \ |
| 2369 | -s "key types: Opaque, Opaque" \ |
| 2370 | -s "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2371 | -S "error" \ |
| 2372 | -C "error" |
| 2373 | |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2374 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2375 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2376 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2377 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2378 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2379 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2380 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2381 | crt_file2=data_files/server2-sha256.crt \ |
| 2382 | key_file2=data_files/server2.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2383 | "$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] | 2384 | 0 \ |
| 2385 | -c "Verifying peer X.509 certificate... ok" \ |
| 2386 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2387 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2388 | -s "key types: Opaque, Opaque" \ |
| 2389 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2390 | -S "error" \ |
| 2391 | -C "error" |
| 2392 | |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2393 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2394 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2395 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2396 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2397 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2398 | run_test "TLS 1.3 opaque key: no suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2399 | "$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] | 2400 | "$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] | 2401 | 1 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2402 | -c "key type: Opaque" \ |
| 2403 | -s "key types: Opaque, Opaque" \ |
| 2404 | -c "error" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 2405 | -s "no suitable signature algorithm" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2406 | |
| 2407 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2408 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2409 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2410 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2411 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2412 | run_test "TLS 1.3 opaque key: suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2413 | "$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] | 2414 | "$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] | 2415 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2416 | -c "key type: Opaque" \ |
| 2417 | -s "key types: Opaque, Opaque" \ |
| 2418 | -C "error" \ |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2419 | -S "error" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2420 | |
| 2421 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2422 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2423 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2424 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2425 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2426 | 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] | 2427 | "$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] | 2428 | "$P_CLI debug_level=4 sig_algs=rsa_pss_rsae_sha256,rsa_pss_rsae_sha512" \ |
| 2429 | 0 \ |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2430 | -s "key types: Opaque, Opaque" \ |
| 2431 | -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \ |
| 2432 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 2433 | -C "error" \ |
| 2434 | -S "error" \ |
| 2435 | |
| 2436 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2437 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2438 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2439 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2440 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2441 | 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] | 2442 | "$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] | 2443 | "$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] | 2444 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2445 | -c "key type: Opaque" \ |
| 2446 | -s "key types: Opaque, Opaque" \ |
| 2447 | -C "error" \ |
| 2448 | -S "error" \ |
| 2449 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2450 | # Test using a RSA opaque private key for server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2451 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2452 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2453 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2454 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2455 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2456 | run_test "Opaque key for server authentication: ECDHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2457 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2458 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2459 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2460 | 0 \ |
| 2461 | -c "Verifying peer X.509 certificate... ok" \ |
| 2462 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2463 | -s "key types: Opaque, none" \ |
| 2464 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2465 | -S "error" \ |
| 2466 | -C "error" |
| 2467 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2468 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2469 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2470 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2471 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2472 | run_test "Opaque key for server authentication: DHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2473 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2474 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2475 | "$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] | 2476 | 0 \ |
| 2477 | -c "Verifying peer X.509 certificate... ok" \ |
| 2478 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2479 | -s "key types: Opaque, none" \ |
| 2480 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2481 | -S "error" \ |
| 2482 | -C "error" |
| 2483 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2484 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2485 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2486 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2487 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2488 | run_test "Opaque key for server authentication: RSA-PSK" \ |
| 2489 | "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 2490 | psk=73776f726466697368 psk_identity=foo" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2491 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 2492 | psk=73776f726466697368 psk_identity=foo" \ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2493 | 0 \ |
| 2494 | -c "Verifying peer X.509 certificate... ok" \ |
| 2495 | -c "Ciphersuite is TLS-RSA-PSK-" \ |
| 2496 | -s "key types: Opaque, Opaque" \ |
| 2497 | -s "Ciphersuite is TLS-RSA-PSK-" \ |
| 2498 | -S "error" \ |
| 2499 | -C "error" |
| 2500 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2501 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2502 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2503 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2504 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2505 | run_test "Opaque key for server authentication: RSA-" \ |
| 2506 | "$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] | 2507 | "$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] | 2508 | 0 \ |
| 2509 | -c "Verifying peer X.509 certificate... ok" \ |
| 2510 | -c "Ciphersuite is TLS-RSA-" \ |
| 2511 | -s "key types: Opaque, Opaque" \ |
| 2512 | -s "Ciphersuite is TLS-RSA-" \ |
| 2513 | -S "error" \ |
| 2514 | -C "error" |
| 2515 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2516 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2517 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2518 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2519 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2520 | run_test "Opaque key for server authentication: DHE-RSA, PSS instead of PKCS1" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2521 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2522 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ |
| 2523 | "$P_CLI crt_file=data_files/server2-sha256.crt \ |
| 2524 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2525 | 1 \ |
| 2526 | -s "key types: Opaque, none" \ |
| 2527 | -s "got ciphersuites in common, but none of them usable" \ |
| 2528 | -s "error" \ |
| 2529 | -c "error" |
| 2530 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2531 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2532 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2533 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2534 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2535 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2536 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2537 | run_test "Opaque keys for server authentication: RSA keys with different algs" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2538 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2539 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pss,none \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2540 | crt_file2=data_files/server4.crt \ |
| 2541 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2542 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2543 | 0 \ |
| 2544 | -c "Verifying peer X.509 certificate... ok" \ |
| 2545 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2546 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2547 | -s "key types: Opaque, Opaque" \ |
| 2548 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2549 | -S "error" \ |
| 2550 | -C "error" |
| 2551 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2552 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2553 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2554 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2555 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2556 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2557 | run_test "Opaque keys for server authentication: EC + RSA, force DHE-RSA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2558 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 2559 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2560 | crt_file2=data_files/server4.crt \ |
| 2561 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
| 2562 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2563 | 0 \ |
| 2564 | -c "Verifying peer X.509 certificate... ok" \ |
| 2565 | -c "Ciphersuite is TLS-DHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2566 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2567 | -s "key types: Opaque, Opaque" \ |
| 2568 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2569 | -S "error" \ |
| 2570 | -C "error" |
| 2571 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2572 | # Test using an EC opaque private key for client/server authentication |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2573 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2574 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2575 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2576 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2577 | run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2578 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2579 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2580 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2581 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2582 | 0 \ |
| 2583 | -c "key type: Opaque" \ |
| 2584 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2585 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2586 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2587 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2588 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2589 | -S "error" \ |
| 2590 | -C "error" |
| 2591 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2592 | # Test using a RSA opaque private key for client/server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2593 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2594 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2595 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2596 | requires_hash_alg SHA_256 |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2597 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2598 | run_test "Opaque key for client/server authentication: ECDHE-RSA" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2599 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2600 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2601 | "$P_CLI force_version=tls12 key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2602 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2603 | 0 \ |
| 2604 | -c "key type: Opaque" \ |
| 2605 | -c "Verifying peer X.509 certificate... ok" \ |
| 2606 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2607 | -s "key types: Opaque, none" \ |
| 2608 | -s "Verifying peer X.509 certificate... ok" \ |
| 2609 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2610 | -S "error" \ |
| 2611 | -C "error" |
| 2612 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2613 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2614 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2615 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2616 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2617 | run_test "Opaque key for client/server authentication: DHE-RSA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2618 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2619 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2620 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2621 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none \ |
| 2622 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2623 | 0 \ |
| 2624 | -c "key type: Opaque" \ |
| 2625 | -c "Verifying peer X.509 certificate... ok" \ |
| 2626 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2627 | -s "key types: Opaque, none" \ |
| 2628 | -s "Verifying peer X.509 certificate... ok" \ |
| 2629 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2630 | -S "error" \ |
| 2631 | -C "error" |
| 2632 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2633 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2634 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 2635 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 2636 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 2637 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 2638 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 2639 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 2640 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 2641 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 2642 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 2643 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 2644 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 2645 | |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2646 | requires_config_enabled PSA_WANT_ECC_SECP_R1_521 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2647 | run_test_psa_force_curve "secp521r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2648 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_512 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2649 | run_test_psa_force_curve "brainpoolP512r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2650 | requires_config_enabled PSA_WANT_ECC_SECP_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2651 | run_test_psa_force_curve "secp384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2652 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2653 | run_test_psa_force_curve "brainpoolP384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2654 | requires_config_enabled PSA_WANT_ECC_SECP_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2655 | run_test_psa_force_curve "secp256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2656 | requires_config_enabled PSA_WANT_ECC_SECP_K1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2657 | run_test_psa_force_curve "secp256k1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2658 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2659 | run_test_psa_force_curve "brainpoolP256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2660 | requires_config_enabled PSA_WANT_ECC_SECP_R1_224 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2661 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2662 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 2663 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2664 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 2665 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 2666 | ## 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] | 2667 | #requires_config_enabled PSA_WANT_ECC_SECP_K1_224 |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2668 | #run_test_psa_force_curve "secp224k1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2669 | requires_config_enabled PSA_WANT_ECC_SECP_R1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2670 | run_test_psa_force_curve "secp192r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2671 | requires_config_enabled PSA_WANT_ECC_SECP_K1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2672 | run_test_psa_force_curve "secp192k1" |
| 2673 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2674 | # Test current time in ServerHello |
| 2675 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 2676 | run_test "ServerHello contains gmt_unix_time" \ |
| 2677 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2678 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2679 | 0 \ |
| 2680 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2681 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2682 | |
| 2683 | # Test for uniqueness of IVs in AEAD ciphersuites |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2684 | run_test "Unique IV in GCM" \ |
| 2685 | "$P_SRV exchanges=20 debug_level=4" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 2686 | "$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] | 2687 | 0 \ |
| 2688 | -u "IV used" \ |
| 2689 | -U "IV used" |
| 2690 | |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2691 | # Test for correctness of sent single supported algorithm |
Valerio Setti | 482a0b9 | 2023-08-18 15:55:10 +0200 | [diff] [blame] | 2692 | requires_any_configs_enabled "MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2693 | PSA_WANT_ECC_SECP_R1_256" |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2694 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2695 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Paul Elliott | 3b4ceda | 2022-11-17 12:47:10 +0000 | [diff] [blame] | 2696 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2697 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 2698 | requires_pk_alg "ECDSA" |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2699 | requires_hash_alg SHA_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2700 | run_test "Single supported algorithm sending: mbedtls client" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2701 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2702 | "$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] | 2703 | 0 \ |
| 2704 | -c "Supported Signature Algorithm found: 04 03" |
| 2705 | |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2706 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2707 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Valerio Setti | 482a0b9 | 2023-08-18 15:55:10 +0200 | [diff] [blame] | 2708 | requires_any_configs_enabled "MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2709 | PSA_WANT_ECC_SECP_R1_256" |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2710 | requires_hash_alg SHA_256 |
| 2711 | run_test "Single supported algorithm sending: openssl client" \ |
| 2712 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
| 2713 | "$O_CLI -cert data_files/server6.crt \ |
| 2714 | -key data_files/server6.key" \ |
| 2715 | 0 |
| 2716 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2717 | # Tests for certificate verification callback |
| 2718 | run_test "Configuration-specific CRT verification callback" \ |
| 2719 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2720 | "$P_CLI force_version=tls12 context_crt_cb=0 debug_level=3" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2721 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2722 | -S "error" \ |
| 2723 | -c "Verify requested for " \ |
| 2724 | -c "Use configuration-specific verification callback" \ |
| 2725 | -C "Use context-specific verification callback" \ |
| 2726 | -C "error" |
| 2727 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2728 | run_test "Context-specific CRT verification callback" \ |
| 2729 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2730 | "$P_CLI force_version=tls12 context_crt_cb=1 debug_level=3" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2731 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2732 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2733 | -c "Verify requested for " \ |
| 2734 | -c "Use context-specific verification callback" \ |
| 2735 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2736 | -C "error" |
| 2737 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2738 | # Tests for SHA-1 support |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2739 | requires_hash_alg SHA_1 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2740 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 2741 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2742 | "$P_CLI debug_level=2 force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2743 | 1 \ |
| 2744 | -c "The certificate is signed with an unacceptable hash" |
| 2745 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2746 | requires_hash_alg SHA_1 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2747 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 2748 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2749 | "$P_CLI force_version=tls12 allow_sha1=1" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2750 | 0 |
| 2751 | |
| 2752 | run_test "SHA-256 allowed by default in server certificate" \ |
| 2753 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2754 | "$P_CLI force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2755 | 0 |
| 2756 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2757 | requires_hash_alg SHA_1 |
| 2758 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2759 | run_test "SHA-1 forbidden by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2760 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2761 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2762 | 1 \ |
| 2763 | -s "The certificate is signed with an unacceptable hash" |
| 2764 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2765 | requires_hash_alg SHA_1 |
| 2766 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2767 | run_test "SHA-1 explicitly allowed in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2768 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=1" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2769 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2770 | 0 |
| 2771 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2772 | requires_config_enabled MBEDTLS_RSA_C |
| 2773 | requires_hash_alg SHA_256 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2774 | run_test "SHA-256 allowed by default 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=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2776 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 2777 | 0 |
| 2778 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2779 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2780 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2781 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2782 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2783 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2784 | 0 \ |
| 2785 | -c "next record in same datagram" \ |
| 2786 | -s "next record in same datagram" |
| 2787 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2788 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2789 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2790 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2791 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2792 | 0 \ |
| 2793 | -s "next record in same datagram" \ |
| 2794 | -C "next record in same datagram" |
| 2795 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2796 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2797 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2798 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2799 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2800 | 0 \ |
| 2801 | -S "next record in same datagram" \ |
| 2802 | -c "next record in same datagram" |
| 2803 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2804 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2805 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2806 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2807 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2808 | 0 \ |
| 2809 | -S "next record in same datagram" \ |
| 2810 | -C "next record in same datagram" |
| 2811 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2812 | # Tests for Context serialization |
| 2813 | |
| 2814 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2815 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2816 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2817 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2818 | 0 \ |
| 2819 | -c "Deserializing connection..." \ |
| 2820 | -S "Deserializing connection..." |
| 2821 | |
| 2822 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2823 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2824 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2825 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2826 | 0 \ |
| 2827 | -c "Deserializing connection..." \ |
| 2828 | -S "Deserializing connection..." |
| 2829 | |
| 2830 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2831 | run_test "Context serialization, client serializes, GCM" \ |
| 2832 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2833 | "$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] | 2834 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2835 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2836 | -S "Deserializing connection..." |
| 2837 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2838 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2839 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2840 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2841 | run_test "Context serialization, client serializes, with CID" \ |
| 2842 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2843 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2844 | 0 \ |
| 2845 | -c "Deserializing connection..." \ |
| 2846 | -S "Deserializing connection..." |
| 2847 | |
| 2848 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2849 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2850 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2851 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2852 | 0 \ |
| 2853 | -C "Deserializing connection..." \ |
| 2854 | -s "Deserializing connection..." |
| 2855 | |
| 2856 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2857 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2858 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2859 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2860 | 0 \ |
| 2861 | -C "Deserializing connection..." \ |
| 2862 | -s "Deserializing connection..." |
| 2863 | |
| 2864 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2865 | run_test "Context serialization, server serializes, GCM" \ |
| 2866 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2867 | "$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] | 2868 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2869 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2870 | -s "Deserializing connection..." |
| 2871 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2872 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2873 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2874 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2875 | run_test "Context serialization, server serializes, with CID" \ |
| 2876 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2877 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2878 | 0 \ |
| 2879 | -C "Deserializing connection..." \ |
| 2880 | -s "Deserializing connection..." |
| 2881 | |
| 2882 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2883 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2884 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2885 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2886 | 0 \ |
| 2887 | -c "Deserializing connection..." \ |
| 2888 | -s "Deserializing connection..." |
| 2889 | |
| 2890 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2891 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2892 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2893 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2894 | 0 \ |
| 2895 | -c "Deserializing connection..." \ |
| 2896 | -s "Deserializing connection..." |
| 2897 | |
| 2898 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2899 | run_test "Context serialization, both serialize, GCM" \ |
| 2900 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2901 | "$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] | 2902 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2903 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2904 | -s "Deserializing connection..." |
| 2905 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2906 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2907 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2908 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2909 | run_test "Context serialization, both serialize, with CID" \ |
| 2910 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2911 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2912 | 0 \ |
| 2913 | -c "Deserializing connection..." \ |
| 2914 | -s "Deserializing connection..." |
| 2915 | |
| 2916 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2917 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2918 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2919 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2920 | 0 \ |
| 2921 | -c "Deserializing connection..." \ |
| 2922 | -S "Deserializing connection..." |
| 2923 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2924 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2925 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2926 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2927 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2928 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2929 | 0 \ |
| 2930 | -c "Deserializing connection..." \ |
| 2931 | -S "Deserializing connection..." |
| 2932 | |
| 2933 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2934 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2935 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2936 | "$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] | 2937 | 0 \ |
| 2938 | -c "Deserializing connection..." \ |
| 2939 | -S "Deserializing connection..." |
| 2940 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2941 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2942 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2943 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2944 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2945 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2946 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2947 | 0 \ |
| 2948 | -c "Deserializing connection..." \ |
| 2949 | -S "Deserializing connection..." |
| 2950 | |
| 2951 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2952 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2953 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2954 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2955 | 0 \ |
| 2956 | -C "Deserializing connection..." \ |
| 2957 | -s "Deserializing connection..." |
| 2958 | |
| 2959 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2960 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2961 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2962 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2963 | 0 \ |
| 2964 | -C "Deserializing connection..." \ |
| 2965 | -s "Deserializing connection..." |
| 2966 | |
| 2967 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2968 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2969 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2970 | "$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] | 2971 | 0 \ |
| 2972 | -C "Deserializing connection..." \ |
| 2973 | -s "Deserializing connection..." |
| 2974 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2975 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2976 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2977 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2978 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2979 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2980 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2981 | 0 \ |
| 2982 | -C "Deserializing connection..." \ |
| 2983 | -s "Deserializing connection..." |
| 2984 | |
| 2985 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2986 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2987 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2988 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2989 | 0 \ |
| 2990 | -c "Deserializing connection..." \ |
| 2991 | -s "Deserializing connection..." |
| 2992 | |
| 2993 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2994 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 2995 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2996 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2997 | 0 \ |
| 2998 | -c "Deserializing connection..." \ |
| 2999 | -s "Deserializing connection..." |
| 3000 | |
| 3001 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3002 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 3003 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3004 | "$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] | 3005 | 0 \ |
| 3006 | -c "Deserializing connection..." \ |
| 3007 | -s "Deserializing connection..." |
| 3008 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 3010 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3011 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3012 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 3013 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 3014 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 3015 | 0 \ |
| 3016 | -c "Deserializing connection..." \ |
| 3017 | -s "Deserializing connection..." |
| 3018 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3019 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 3020 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3021 | run_test "Saving the serialized context to a file" \ |
| 3022 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 3023 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 3024 | 0 \ |
| 3025 | -s "Save serialized context to a file... ok" \ |
| 3026 | -c "Save serialized context to a file... ok" |
| 3027 | rm -f context_srv.txt |
| 3028 | rm -f context_cli.txt |
| 3029 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3030 | # Tests for DTLS Connection ID extension |
| 3031 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3032 | # So far, the CID API isn't implemented, so we can't |
| 3033 | # grep for output witnessing its use. This needs to be |
| 3034 | # changed once the CID extension is implemented. |
| 3035 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3037 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3038 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3039 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 3040 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3041 | 0 \ |
| 3042 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3043 | -s "found CID extension" \ |
| 3044 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3045 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3046 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3047 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3048 | -C "found CID extension" \ |
| 3049 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3050 | -C "Copy CIDs into SSL transform" \ |
| 3051 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3052 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3053 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3054 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3055 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3056 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3057 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 3058 | 0 \ |
| 3059 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3060 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3061 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3062 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3063 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3064 | -C "found CID extension" \ |
| 3065 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3066 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 3067 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3068 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3069 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3070 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3071 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3072 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3073 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 3074 | 0 \ |
| 3075 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3076 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3077 | -c "client hello, adding CID extension" \ |
| 3078 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3079 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3080 | -s "server hello, adding CID extension" \ |
| 3081 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3082 | -c "Use of CID extension negotiated" \ |
| 3083 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3084 | -c "Copy CIDs into SSL transform" \ |
| 3085 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3086 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3087 | -s "Use of Connection ID has been negotiated" \ |
| 3088 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3089 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3090 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3091 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3092 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3093 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3094 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 3095 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 3096 | 0 \ |
| 3097 | -c "Enable use of CID extension." \ |
| 3098 | -s "Enable use of CID extension." \ |
| 3099 | -c "client hello, adding CID extension" \ |
| 3100 | -s "found CID extension" \ |
| 3101 | -s "Use of CID extension negotiated" \ |
| 3102 | -s "server hello, adding CID extension" \ |
| 3103 | -c "found CID extension" \ |
| 3104 | -c "Use of CID extension negotiated" \ |
| 3105 | -s "Copy CIDs into SSL transform" \ |
| 3106 | -c "Copy CIDs into SSL transform" \ |
| 3107 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3108 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3109 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3110 | -c "Use of Connection ID has been negotiated" \ |
| 3111 | -c "ignoring unexpected CID" \ |
| 3112 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3113 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3115 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3116 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 3117 | -p "$P_PXY mtu=800" \ |
| 3118 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3119 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3120 | 0 \ |
| 3121 | -c "Enable use of CID extension." \ |
| 3122 | -s "Enable use of CID extension." \ |
| 3123 | -c "client hello, adding CID extension" \ |
| 3124 | -s "found CID extension" \ |
| 3125 | -s "Use of CID extension negotiated" \ |
| 3126 | -s "server hello, adding CID extension" \ |
| 3127 | -c "found CID extension" \ |
| 3128 | -c "Use of CID extension negotiated" \ |
| 3129 | -s "Copy CIDs into SSL transform" \ |
| 3130 | -c "Copy CIDs into SSL transform" \ |
| 3131 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3132 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3133 | -s "Use of Connection ID has been negotiated" \ |
| 3134 | -c "Use of Connection ID has been negotiated" |
| 3135 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3136 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3137 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3138 | 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] | 3139 | -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] | 3140 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3141 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3142 | 0 \ |
| 3143 | -c "Enable use of CID extension." \ |
| 3144 | -s "Enable use of CID extension." \ |
| 3145 | -c "client hello, adding CID extension" \ |
| 3146 | -s "found CID extension" \ |
| 3147 | -s "Use of CID extension negotiated" \ |
| 3148 | -s "server hello, adding CID extension" \ |
| 3149 | -c "found CID extension" \ |
| 3150 | -c "Use of CID extension negotiated" \ |
| 3151 | -s "Copy CIDs into SSL transform" \ |
| 3152 | -c "Copy CIDs into SSL transform" \ |
| 3153 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3154 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3155 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3156 | -c "Use of Connection ID has been negotiated" \ |
| 3157 | -c "ignoring unexpected CID" \ |
| 3158 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3159 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3161 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3162 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3163 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3164 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3165 | 0 \ |
| 3166 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3167 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3168 | -c "client hello, adding CID extension" \ |
| 3169 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3170 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3171 | -s "server hello, adding CID extension" \ |
| 3172 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3173 | -c "Use of CID extension negotiated" \ |
| 3174 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3175 | -c "Copy CIDs into SSL transform" \ |
| 3176 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3177 | -s "Peer CID (length 0 Bytes):" \ |
| 3178 | -s "Use of Connection ID has been negotiated" \ |
| 3179 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3180 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3181 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3182 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3183 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3184 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3185 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3186 | 0 \ |
| 3187 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3188 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3189 | -c "client hello, adding CID extension" \ |
| 3190 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3191 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3192 | -s "server hello, adding CID extension" \ |
| 3193 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3194 | -c "Use of CID extension negotiated" \ |
| 3195 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3196 | -c "Copy CIDs into SSL transform" \ |
| 3197 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3198 | -c "Peer CID (length 0 Bytes):" \ |
| 3199 | -s "Use of Connection ID has been negotiated" \ |
| 3200 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3201 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3202 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3203 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3204 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3205 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3206 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3207 | 0 \ |
| 3208 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3209 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3210 | -c "client hello, adding CID extension" \ |
| 3211 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3212 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3213 | -s "server hello, adding CID extension" \ |
| 3214 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3215 | -c "Use of CID extension negotiated" \ |
| 3216 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3217 | -c "Copy CIDs into SSL transform" \ |
| 3218 | -S "Use of Connection ID has been negotiated" \ |
| 3219 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3220 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3221 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3222 | 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] | 3223 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3224 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3225 | 0 \ |
| 3226 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3227 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3228 | -c "client hello, adding CID extension" \ |
| 3229 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3230 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3231 | -s "server hello, adding CID extension" \ |
| 3232 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3233 | -c "Use of CID extension negotiated" \ |
| 3234 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3235 | -c "Copy CIDs into SSL transform" \ |
| 3236 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3237 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3238 | -s "Use of Connection ID has been negotiated" \ |
| 3239 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3240 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3241 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3242 | 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] | 3243 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3244 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3245 | 0 \ |
| 3246 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3247 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3248 | -c "client hello, adding CID extension" \ |
| 3249 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3250 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3251 | -s "server hello, adding CID extension" \ |
| 3252 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3253 | -c "Use of CID extension negotiated" \ |
| 3254 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3255 | -c "Copy CIDs into SSL transform" \ |
| 3256 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3257 | -s "Peer CID (length 0 Bytes):" \ |
| 3258 | -s "Use of Connection ID has been negotiated" \ |
| 3259 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3260 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3261 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3262 | 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] | 3263 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3264 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3265 | 0 \ |
| 3266 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3267 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3268 | -c "client hello, adding CID extension" \ |
| 3269 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3270 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3271 | -s "server hello, adding CID extension" \ |
| 3272 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3273 | -c "Use of CID extension negotiated" \ |
| 3274 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3275 | -c "Copy CIDs into SSL transform" \ |
| 3276 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3277 | -c "Peer CID (length 0 Bytes):" \ |
| 3278 | -s "Use of Connection ID has been negotiated" \ |
| 3279 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3280 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3281 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3282 | 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] | 3283 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3284 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3285 | 0 \ |
| 3286 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3287 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3288 | -c "client hello, adding CID extension" \ |
| 3289 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3290 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3291 | -s "server hello, adding CID extension" \ |
| 3292 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3293 | -c "Use of CID extension negotiated" \ |
| 3294 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3295 | -c "Copy CIDs into SSL transform" \ |
| 3296 | -S "Use of Connection ID has been negotiated" \ |
| 3297 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3298 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3299 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3300 | 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] | 3301 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3302 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3303 | 0 \ |
| 3304 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3305 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3306 | -c "client hello, adding CID extension" \ |
| 3307 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3308 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3309 | -s "server hello, adding CID extension" \ |
| 3310 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3311 | -c "Use of CID extension negotiated" \ |
| 3312 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3313 | -c "Copy CIDs into SSL transform" \ |
| 3314 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3315 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3316 | -s "Use of Connection ID has been negotiated" \ |
| 3317 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3318 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3319 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3320 | 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] | 3321 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3322 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3323 | 0 \ |
| 3324 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3325 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3326 | -c "client hello, adding CID extension" \ |
| 3327 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3328 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3329 | -s "server hello, adding CID extension" \ |
| 3330 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3331 | -c "Use of CID extension negotiated" \ |
| 3332 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3333 | -c "Copy CIDs into SSL transform" \ |
| 3334 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3335 | -s "Peer CID (length 0 Bytes):" \ |
| 3336 | -s "Use of Connection ID has been negotiated" \ |
| 3337 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3338 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3339 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3340 | 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] | 3341 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3342 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3343 | 0 \ |
| 3344 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3345 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3346 | -c "client hello, adding CID extension" \ |
| 3347 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3348 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3349 | -s "server hello, adding CID extension" \ |
| 3350 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3351 | -c "Use of CID extension negotiated" \ |
| 3352 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3353 | -c "Copy CIDs into SSL transform" \ |
| 3354 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3355 | -c "Peer CID (length 0 Bytes):" \ |
| 3356 | -s "Use of Connection ID has been negotiated" \ |
| 3357 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3358 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3359 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3360 | 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] | 3361 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3362 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3363 | 0 \ |
| 3364 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3365 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3366 | -c "client hello, adding CID extension" \ |
| 3367 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3368 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3369 | -s "server hello, adding CID extension" \ |
| 3370 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3371 | -c "Use of CID extension negotiated" \ |
| 3372 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3373 | -c "Copy CIDs into SSL transform" \ |
| 3374 | -S "Use of Connection ID has been negotiated" \ |
| 3375 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3376 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3377 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3378 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3379 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3380 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3381 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3382 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3383 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3384 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3385 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3386 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3387 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3388 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3389 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3390 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3391 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3392 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3393 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3394 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3395 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3396 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3397 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3398 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3399 | 0 \ |
| 3400 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3401 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3402 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3403 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3404 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3405 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3406 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3407 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3408 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3409 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3410 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3411 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3412 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 3413 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3414 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3415 | 0 \ |
| 3416 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3417 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3418 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3419 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3420 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3421 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3422 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3423 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3424 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3425 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3426 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3427 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3428 | 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] | 3429 | -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] | 3430 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3431 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3432 | 0 \ |
| 3433 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3434 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3435 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3436 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3437 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3438 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3439 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3440 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3441 | -c "ignoring unexpected CID" \ |
| 3442 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3443 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3444 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3445 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3446 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3447 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3448 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3449 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3450 | 0 \ |
| 3451 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3452 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3453 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3454 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3455 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3456 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3457 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3458 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3459 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3460 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3461 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3462 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3463 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 3464 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3465 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3466 | 0 \ |
| 3467 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3468 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3469 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3470 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3471 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3472 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3473 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3474 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3475 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3476 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3477 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3478 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3479 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3480 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3481 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3482 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3483 | 0 \ |
| 3484 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3485 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3486 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3487 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3488 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3489 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3490 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3491 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3492 | -c "ignoring unexpected CID" \ |
| 3493 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3494 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3496 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3497 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3498 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3499 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3500 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3501 | 0 \ |
| 3502 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3503 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3504 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3505 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3506 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3507 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3508 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3509 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3510 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3511 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3512 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 3513 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3514 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3515 | 0 \ |
| 3516 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3517 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3518 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3519 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3520 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3521 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3522 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3524 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3525 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3526 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3527 | -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] | 3528 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3529 | "$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" \ |
| 3530 | 0 \ |
| 3531 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3532 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3533 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3534 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3535 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3536 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3537 | -c "ignoring unexpected CID" \ |
| 3538 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3539 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3540 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3541 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3542 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3543 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3544 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3545 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3546 | 0 \ |
| 3547 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3548 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3549 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3550 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3551 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3552 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3553 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3554 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3555 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 3556 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3557 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3558 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3559 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3560 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3561 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3562 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3563 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3564 | 0 \ |
| 3565 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3566 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3567 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3568 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3569 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3570 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3571 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3572 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3573 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 3574 | -c "ignoring unexpected CID" \ |
| 3575 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3576 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3577 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3578 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3579 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3580 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 3581 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3582 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3583 | 0 \ |
| 3584 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3585 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3586 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3587 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3588 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3589 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3590 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3591 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3592 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 3593 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3594 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3595 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3596 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3597 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3598 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3599 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3600 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3601 | 0 \ |
| 3602 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3603 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3604 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3605 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3606 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3607 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3608 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3609 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3610 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 3611 | -c "ignoring unexpected CID" \ |
| 3612 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3613 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3614 | # 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] | 3615 | # tests check that the buffer contents are reallocated when the message is |
| 3616 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3617 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3618 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3619 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3620 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 3621 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3622 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 3623 | 0 \ |
| 3624 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3625 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3626 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3627 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3628 | -s "Reallocating in_buf" \ |
| 3629 | -s "Reallocating out_buf" |
| 3630 | |
| 3631 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3632 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3633 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3634 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 3635 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3636 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 3637 | 0 \ |
| 3638 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3639 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3640 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3641 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3642 | -s "Reallocating in_buf" \ |
| 3643 | -s "Reallocating out_buf" |
| 3644 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3645 | # Tests for Encrypt-then-MAC extension |
| 3646 | |
| 3647 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3648 | "$P_SRV debug_level=3 \ |
| 3649 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3650 | "$P_CLI debug_level=3" \ |
| 3651 | 0 \ |
| 3652 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3653 | -s "found encrypt then mac extension" \ |
| 3654 | -s "server hello, adding encrypt then mac extension" \ |
| 3655 | -c "found encrypt_then_mac extension" \ |
| 3656 | -c "using encrypt then mac" \ |
| 3657 | -s "using encrypt then mac" |
| 3658 | |
| 3659 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3660 | "$P_SRV debug_level=3 etm=0 \ |
| 3661 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3662 | "$P_CLI debug_level=3 etm=1" \ |
| 3663 | 0 \ |
| 3664 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3665 | -s "found encrypt then mac extension" \ |
| 3666 | -S "server hello, adding encrypt then mac extension" \ |
| 3667 | -C "found encrypt_then_mac extension" \ |
| 3668 | -C "using encrypt then mac" \ |
| 3669 | -S "using encrypt then mac" |
| 3670 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3671 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3672 | "$P_SRV debug_level=3 etm=1 \ |
| 3673 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3674 | "$P_CLI debug_level=3 etm=1" \ |
| 3675 | 0 \ |
| 3676 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3677 | -s "found encrypt then mac extension" \ |
| 3678 | -S "server hello, adding encrypt then mac extension" \ |
| 3679 | -C "found encrypt_then_mac extension" \ |
| 3680 | -C "using encrypt then mac" \ |
| 3681 | -S "using encrypt then mac" |
| 3682 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3683 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3684 | "$P_SRV debug_level=3 etm=1 \ |
| 3685 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3686 | "$P_CLI debug_level=3 etm=0" \ |
| 3687 | 0 \ |
| 3688 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3689 | -S "found encrypt then mac extension" \ |
| 3690 | -S "server hello, adding encrypt then mac extension" \ |
| 3691 | -C "found encrypt_then_mac extension" \ |
| 3692 | -C "using encrypt then mac" \ |
| 3693 | -S "using encrypt then mac" |
| 3694 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3695 | # Tests for Extended Master Secret extension |
| 3696 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3697 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3698 | run_test "Extended Master Secret: default" \ |
| 3699 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3700 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3701 | 0 \ |
| 3702 | -c "client hello, adding extended_master_secret extension" \ |
| 3703 | -s "found extended master secret extension" \ |
| 3704 | -s "server hello, adding extended master secret extension" \ |
| 3705 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3706 | -c "session hash for extended master secret" \ |
| 3707 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3708 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3709 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3710 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3711 | "$P_SRV debug_level=3 extended_ms=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3712 | "$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] | 3713 | 0 \ |
| 3714 | -c "client hello, adding extended_master_secret extension" \ |
| 3715 | -s "found extended master secret extension" \ |
| 3716 | -S "server hello, adding extended master secret extension" \ |
| 3717 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3718 | -C "session hash for extended master secret" \ |
| 3719 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3720 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3721 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3722 | run_test "Extended Master Secret: client disabled, server enabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3723 | "$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] | 3724 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3725 | 0 \ |
| 3726 | -C "client hello, adding extended_master_secret extension" \ |
| 3727 | -S "found extended master secret extension" \ |
| 3728 | -S "server hello, adding extended master secret extension" \ |
| 3729 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3730 | -C "session hash for extended master secret" \ |
| 3731 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3732 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3733 | # Test sending and receiving empty application data records |
| 3734 | |
| 3735 | run_test "Encrypt then MAC: empty application data record" \ |
| 3736 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3737 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3738 | 0 \ |
| 3739 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3740 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3741 | -c "0 bytes written in 1 fragments" |
| 3742 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3743 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3744 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3745 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3746 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3747 | 0 \ |
| 3748 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3749 | -c "0 bytes written in 1 fragments" |
| 3750 | |
| 3751 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3752 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3753 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3754 | 0 \ |
| 3755 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3756 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3757 | -c "0 bytes written in 1 fragments" |
| 3758 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3759 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3760 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3761 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3762 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3763 | 0 \ |
| 3764 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3765 | -c "0 bytes written in 1 fragments" |
| 3766 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3767 | # Tests for CBC 1/n-1 record splitting |
| 3768 | |
| 3769 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3770 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3771 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3772 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3773 | 0 \ |
| 3774 | -s "Read from client: 123 bytes read" \ |
| 3775 | -S "Read from client: 1 bytes read" \ |
| 3776 | -S "122 bytes read" |
| 3777 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3778 | # Tests for Session Tickets |
| 3779 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3780 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3781 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3782 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3783 | "$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] | 3784 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3785 | -c "client hello, adding session ticket extension" \ |
| 3786 | -s "found session ticket extension" \ |
| 3787 | -s "server hello, adding session ticket extension" \ |
| 3788 | -c "found session_ticket extension" \ |
| 3789 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3790 | -S "session successfully restored from cache" \ |
| 3791 | -s "session successfully restored from ticket" \ |
| 3792 | -s "a session has been resumed" \ |
| 3793 | -c "a session has been resumed" |
| 3794 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3795 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3796 | run_test "Session resume using tickets: manual rotation" \ |
| 3797 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3798 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3799 | 0 \ |
| 3800 | -c "client hello, adding session ticket extension" \ |
| 3801 | -s "found session ticket extension" \ |
| 3802 | -s "server hello, adding session ticket extension" \ |
| 3803 | -c "found session_ticket extension" \ |
| 3804 | -c "parse new session ticket" \ |
| 3805 | -S "session successfully restored from cache" \ |
| 3806 | -s "session successfully restored from ticket" \ |
| 3807 | -s "a session has been resumed" \ |
| 3808 | -c "a session has been resumed" |
| 3809 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3810 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3811 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3812 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3813 | "$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] | 3814 | 0 \ |
| 3815 | -c "client hello, adding session ticket extension" \ |
| 3816 | -s "found session ticket extension" \ |
| 3817 | -s "server hello, adding session ticket extension" \ |
| 3818 | -c "found session_ticket extension" \ |
| 3819 | -c "parse new session ticket" \ |
| 3820 | -S "session successfully restored from cache" \ |
| 3821 | -s "session successfully restored from ticket" \ |
| 3822 | -s "a session has been resumed" \ |
| 3823 | -c "a session has been resumed" |
| 3824 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3825 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3826 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3827 | "$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] | 3828 | "$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] | 3829 | 0 \ |
| 3830 | -c "client hello, adding session ticket extension" \ |
| 3831 | -s "found session ticket extension" \ |
| 3832 | -s "server hello, adding session ticket extension" \ |
| 3833 | -c "found session_ticket extension" \ |
| 3834 | -c "parse new session ticket" \ |
| 3835 | -S "session successfully restored from cache" \ |
| 3836 | -S "session successfully restored from ticket" \ |
| 3837 | -S "a session has been resumed" \ |
| 3838 | -C "a session has been resumed" |
| 3839 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3840 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3841 | run_test "Session resume using tickets: session copy" \ |
| 3842 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3843 | "$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] | 3844 | 0 \ |
| 3845 | -c "client hello, adding session ticket extension" \ |
| 3846 | -s "found session ticket extension" \ |
| 3847 | -s "server hello, adding session ticket extension" \ |
| 3848 | -c "found session_ticket extension" \ |
| 3849 | -c "parse new session ticket" \ |
| 3850 | -S "session successfully restored from cache" \ |
| 3851 | -s "session successfully restored from ticket" \ |
| 3852 | -s "a session has been resumed" \ |
| 3853 | -c "a session has been resumed" |
| 3854 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3855 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3856 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3857 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3858 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3859 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3860 | 0 \ |
| 3861 | -c "client hello, adding session ticket extension" \ |
| 3862 | -c "found session_ticket extension" \ |
| 3863 | -c "parse new session ticket" \ |
| 3864 | -c "a session has been resumed" |
| 3865 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3866 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3867 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3868 | run_test "Session resume using tickets: openssl client" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 3869 | "$P_SRV force_version=tls12 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3870 | "( $O_CLI -sess_out $SESSION; \ |
| 3871 | $O_CLI -sess_in $SESSION; \ |
| 3872 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3873 | 0 \ |
| 3874 | -s "found session ticket extension" \ |
| 3875 | -s "server hello, adding session ticket extension" \ |
| 3876 | -S "session successfully restored from cache" \ |
| 3877 | -s "session successfully restored from ticket" \ |
| 3878 | -s "a session has been resumed" |
| 3879 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3880 | requires_cipher_enabled "AES" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3881 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3882 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3883 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3884 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3885 | 0 \ |
| 3886 | -c "client hello, adding session ticket extension" \ |
| 3887 | -s "found session ticket extension" \ |
| 3888 | -s "server hello, adding session ticket extension" \ |
| 3889 | -c "found session_ticket extension" \ |
| 3890 | -c "parse new session ticket" \ |
| 3891 | -S "session successfully restored from cache" \ |
| 3892 | -s "session successfully restored from ticket" \ |
| 3893 | -s "a session has been resumed" \ |
| 3894 | -c "a session has been resumed" |
| 3895 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3896 | requires_cipher_enabled "AES" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3897 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3898 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3899 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3900 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3901 | 0 \ |
| 3902 | -c "client hello, adding session ticket extension" \ |
| 3903 | -s "found session ticket extension" \ |
| 3904 | -s "server hello, adding session ticket extension" \ |
| 3905 | -c "found session_ticket extension" \ |
| 3906 | -c "parse new session ticket" \ |
| 3907 | -S "session successfully restored from cache" \ |
| 3908 | -s "session successfully restored from ticket" \ |
| 3909 | -s "a session has been resumed" \ |
| 3910 | -c "a session has been resumed" |
| 3911 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3912 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3913 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3914 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3915 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3916 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3917 | 0 \ |
| 3918 | -c "client hello, adding session ticket extension" \ |
| 3919 | -s "found session ticket extension" \ |
| 3920 | -s "server hello, adding session ticket extension" \ |
| 3921 | -c "found session_ticket extension" \ |
| 3922 | -c "parse new session ticket" \ |
| 3923 | -S "session successfully restored from cache" \ |
| 3924 | -s "session successfully restored from ticket" \ |
| 3925 | -s "a session has been resumed" \ |
| 3926 | -c "a session has been resumed" |
| 3927 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3928 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3929 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3930 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 3931 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3932 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3933 | 0 \ |
| 3934 | -c "client hello, adding session ticket extension" \ |
| 3935 | -s "found session ticket extension" \ |
| 3936 | -s "server hello, adding session ticket extension" \ |
| 3937 | -c "found session_ticket extension" \ |
| 3938 | -c "parse new session ticket" \ |
| 3939 | -S "session successfully restored from cache" \ |
| 3940 | -s "session successfully restored from ticket" \ |
| 3941 | -s "a session has been resumed" \ |
| 3942 | -c "a session has been resumed" |
| 3943 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3944 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3945 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3946 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 3947 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3948 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3949 | 0 \ |
| 3950 | -c "client hello, adding session ticket extension" \ |
| 3951 | -s "found session ticket extension" \ |
| 3952 | -s "server hello, adding session ticket extension" \ |
| 3953 | -c "found session_ticket extension" \ |
| 3954 | -c "parse new session ticket" \ |
| 3955 | -S "session successfully restored from cache" \ |
| 3956 | -s "session successfully restored from ticket" \ |
| 3957 | -s "a session has been resumed" \ |
| 3958 | -c "a session has been resumed" |
| 3959 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3960 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3961 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3962 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 3963 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3964 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3965 | 0 \ |
| 3966 | -c "client hello, adding session ticket extension" \ |
| 3967 | -s "found session ticket extension" \ |
| 3968 | -s "server hello, adding session ticket extension" \ |
| 3969 | -c "found session_ticket extension" \ |
| 3970 | -c "parse new session ticket" \ |
| 3971 | -S "session successfully restored from cache" \ |
| 3972 | -s "session successfully restored from ticket" \ |
| 3973 | -s "a session has been resumed" \ |
| 3974 | -c "a session has been resumed" |
| 3975 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3976 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3977 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3978 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 3979 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3980 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3981 | 0 \ |
| 3982 | -c "client hello, adding session ticket extension" \ |
| 3983 | -s "found session ticket extension" \ |
| 3984 | -s "server hello, adding session ticket extension" \ |
| 3985 | -c "found session_ticket extension" \ |
| 3986 | -c "parse new session ticket" \ |
| 3987 | -S "session successfully restored from cache" \ |
| 3988 | -s "session successfully restored from ticket" \ |
| 3989 | -s "a session has been resumed" \ |
| 3990 | -c "a session has been resumed" |
| 3991 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3992 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3993 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3994 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 3995 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3996 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3997 | 0 \ |
| 3998 | -c "client hello, adding session ticket extension" \ |
| 3999 | -s "found session ticket extension" \ |
| 4000 | -s "server hello, adding session ticket extension" \ |
| 4001 | -c "found session_ticket extension" \ |
| 4002 | -c "parse new session ticket" \ |
| 4003 | -S "session successfully restored from cache" \ |
| 4004 | -s "session successfully restored from ticket" \ |
| 4005 | -s "a session has been resumed" \ |
| 4006 | -c "a session has been resumed" |
| 4007 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4008 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4009 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4010 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 4011 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4012 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4013 | 0 \ |
| 4014 | -c "client hello, adding session ticket extension" \ |
| 4015 | -s "found session ticket extension" \ |
| 4016 | -s "server hello, adding session ticket extension" \ |
| 4017 | -c "found session_ticket extension" \ |
| 4018 | -c "parse new session ticket" \ |
| 4019 | -S "session successfully restored from cache" \ |
| 4020 | -s "session successfully restored from ticket" \ |
| 4021 | -s "a session has been resumed" \ |
| 4022 | -c "a session has been resumed" |
| 4023 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4024 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4025 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4026 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 4027 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4028 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4029 | 0 \ |
| 4030 | -c "client hello, adding session ticket extension" \ |
| 4031 | -s "found session ticket extension" \ |
| 4032 | -s "server hello, adding session ticket extension" \ |
| 4033 | -c "found session_ticket extension" \ |
| 4034 | -c "parse new session ticket" \ |
| 4035 | -S "session successfully restored from cache" \ |
| 4036 | -s "session successfully restored from ticket" \ |
| 4037 | -s "a session has been resumed" \ |
| 4038 | -c "a session has been resumed" |
| 4039 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4040 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4041 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4042 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 4043 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4044 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4045 | 0 \ |
| 4046 | -c "client hello, adding session ticket extension" \ |
| 4047 | -s "found session ticket extension" \ |
| 4048 | -s "server hello, adding session ticket extension" \ |
| 4049 | -c "found session_ticket extension" \ |
| 4050 | -c "parse new session ticket" \ |
| 4051 | -S "session successfully restored from cache" \ |
| 4052 | -s "session successfully restored from ticket" \ |
| 4053 | -s "a session has been resumed" \ |
| 4054 | -c "a session has been resumed" |
| 4055 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4056 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4057 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4058 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 4059 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4060 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4061 | 0 \ |
| 4062 | -c "client hello, adding session ticket extension" \ |
| 4063 | -s "found session ticket extension" \ |
| 4064 | -s "server hello, adding session ticket extension" \ |
| 4065 | -c "found session_ticket extension" \ |
| 4066 | -c "parse new session ticket" \ |
| 4067 | -S "session successfully restored from cache" \ |
| 4068 | -s "session successfully restored from ticket" \ |
| 4069 | -s "a session has been resumed" \ |
| 4070 | -c "a session has been resumed" |
| 4071 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4072 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4073 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4074 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 4075 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4076 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4077 | 0 \ |
| 4078 | -c "client hello, adding session ticket extension" \ |
| 4079 | -s "found session ticket extension" \ |
| 4080 | -s "server hello, adding session ticket extension" \ |
| 4081 | -c "found session_ticket extension" \ |
| 4082 | -c "parse new session ticket" \ |
| 4083 | -S "session successfully restored from cache" \ |
| 4084 | -s "session successfully restored from ticket" \ |
| 4085 | -s "a session has been resumed" \ |
| 4086 | -c "a session has been resumed" |
| 4087 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4088 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4089 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4090 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 4091 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4092 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4093 | 0 \ |
| 4094 | -c "client hello, adding session ticket extension" \ |
| 4095 | -s "found session ticket extension" \ |
| 4096 | -s "server hello, adding session ticket extension" \ |
| 4097 | -c "found session_ticket extension" \ |
| 4098 | -c "parse new session ticket" \ |
| 4099 | -S "session successfully restored from cache" \ |
| 4100 | -s "session successfully restored from ticket" \ |
| 4101 | -s "a session has been resumed" \ |
| 4102 | -c "a session has been resumed" |
| 4103 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4104 | requires_cipher_enabled "CHACHA20" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4105 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4106 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 4107 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4108 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4109 | 0 \ |
| 4110 | -c "client hello, adding session ticket extension" \ |
| 4111 | -s "found session ticket extension" \ |
| 4112 | -s "server hello, adding session ticket extension" \ |
| 4113 | -c "found session_ticket extension" \ |
| 4114 | -c "parse new session ticket" \ |
| 4115 | -S "session successfully restored from cache" \ |
| 4116 | -s "session successfully restored from ticket" \ |
| 4117 | -s "a session has been resumed" \ |
| 4118 | -c "a session has been resumed" |
| 4119 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4120 | # Tests for Session Tickets with DTLS |
| 4121 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4122 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4123 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4124 | run_test "Session resume using tickets, DTLS: basic" \ |
| 4125 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4126 | "$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] | 4127 | 0 \ |
| 4128 | -c "client hello, adding session ticket extension" \ |
| 4129 | -s "found session ticket extension" \ |
| 4130 | -s "server hello, adding session ticket extension" \ |
| 4131 | -c "found session_ticket extension" \ |
| 4132 | -c "parse new session ticket" \ |
| 4133 | -S "session successfully restored from cache" \ |
| 4134 | -s "session successfully restored from ticket" \ |
| 4135 | -s "a session has been resumed" \ |
| 4136 | -c "a session has been resumed" |
| 4137 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4138 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4139 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4140 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 4141 | "$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] | 4142 | "$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] | 4143 | 0 \ |
| 4144 | -c "client hello, adding session ticket extension" \ |
| 4145 | -s "found session ticket extension" \ |
| 4146 | -s "server hello, adding session ticket extension" \ |
| 4147 | -c "found session_ticket extension" \ |
| 4148 | -c "parse new session ticket" \ |
| 4149 | -S "session successfully restored from cache" \ |
| 4150 | -s "session successfully restored from ticket" \ |
| 4151 | -s "a session has been resumed" \ |
| 4152 | -c "a session has been resumed" |
| 4153 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4154 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4155 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4156 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 4157 | "$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] | 4158 | "$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] | 4159 | 0 \ |
| 4160 | -c "client hello, adding session ticket extension" \ |
| 4161 | -s "found session ticket extension" \ |
| 4162 | -s "server hello, adding session ticket extension" \ |
| 4163 | -c "found session_ticket extension" \ |
| 4164 | -c "parse new session ticket" \ |
| 4165 | -S "session successfully restored from cache" \ |
| 4166 | -S "session successfully restored from ticket" \ |
| 4167 | -S "a session has been resumed" \ |
| 4168 | -C "a session has been resumed" |
| 4169 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4170 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4171 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4172 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 4173 | "$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] | 4174 | "$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] | 4175 | 0 \ |
| 4176 | -c "client hello, adding session ticket extension" \ |
| 4177 | -s "found session ticket extension" \ |
| 4178 | -s "server hello, adding session ticket extension" \ |
| 4179 | -c "found session_ticket extension" \ |
| 4180 | -c "parse new session ticket" \ |
| 4181 | -S "session successfully restored from cache" \ |
| 4182 | -s "session successfully restored from ticket" \ |
| 4183 | -s "a session has been resumed" \ |
| 4184 | -c "a session has been resumed" |
| 4185 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4186 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4187 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4188 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 4189 | "$O_SRV -dtls" \ |
| 4190 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 4191 | 0 \ |
| 4192 | -c "client hello, adding session ticket extension" \ |
| 4193 | -c "found session_ticket extension" \ |
| 4194 | -c "parse new session ticket" \ |
| 4195 | -c "a session has been resumed" |
| 4196 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4197 | # 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] | 4198 | # 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] | 4199 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4201 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4202 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 4203 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4204 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4205 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4206 | rm -f $SESSION )" \ |
| 4207 | 0 \ |
| 4208 | -s "found session ticket extension" \ |
| 4209 | -s "server hello, adding session ticket extension" \ |
| 4210 | -S "session successfully restored from cache" \ |
| 4211 | -s "session successfully restored from ticket" \ |
| 4212 | -s "a session has been resumed" |
| 4213 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4214 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4215 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4216 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4217 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4218 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4219 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4220 | "$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] | 4221 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4222 | -c "client hello, adding session ticket extension" \ |
| 4223 | -s "found session ticket extension" \ |
| 4224 | -S "server hello, adding session ticket extension" \ |
| 4225 | -C "found session_ticket extension" \ |
| 4226 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4227 | -s "session successfully restored from cache" \ |
| 4228 | -S "session successfully restored from ticket" \ |
| 4229 | -s "a session has been resumed" \ |
| 4230 | -c "a session has been resumed" |
| 4231 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4232 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4233 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4234 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4235 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4236 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4237 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4238 | -C "client hello, adding session ticket extension" \ |
| 4239 | -S "found session ticket extension" \ |
| 4240 | -S "server hello, adding session ticket extension" \ |
| 4241 | -C "found session_ticket extension" \ |
| 4242 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4243 | -s "session successfully restored from cache" \ |
| 4244 | -S "session successfully restored from ticket" \ |
| 4245 | -s "a session has been resumed" \ |
| 4246 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4247 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4248 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4249 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4250 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4251 | "$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] | 4252 | 0 \ |
| 4253 | -S "session successfully restored from cache" \ |
| 4254 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4255 | -S "a session has been resumed" \ |
| 4256 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4257 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4258 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4259 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4260 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4261 | "$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] | 4262 | 0 \ |
| 4263 | -s "session successfully restored from cache" \ |
| 4264 | -S "session successfully restored from ticket" \ |
| 4265 | -s "a session has been resumed" \ |
| 4266 | -c "a session has been resumed" |
| 4267 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4268 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4269 | run_test "Session resume using cache: cache removed" \ |
| 4270 | "$P_SRV debug_level=3 tickets=0 cache_remove=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4271 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4272 | 0 \ |
| 4273 | -C "client hello, adding session ticket extension" \ |
| 4274 | -S "found session ticket extension" \ |
| 4275 | -S "server hello, adding session ticket extension" \ |
| 4276 | -C "found session_ticket extension" \ |
| 4277 | -C "parse new session ticket" \ |
| 4278 | -S "session successfully restored from cache" \ |
| 4279 | -S "session successfully restored from ticket" \ |
| 4280 | -S "a session has been resumed" \ |
| 4281 | -C "a session has been resumed" |
| 4282 | |
| 4283 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4284 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 4285 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4286 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4287 | "$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] | 4288 | 0 \ |
| 4289 | -s "session successfully restored from cache" \ |
| 4290 | -S "session successfully restored from ticket" \ |
| 4291 | -s "a session has been resumed" \ |
| 4292 | -c "a session has been resumed" |
| 4293 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4294 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4295 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4296 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4297 | "$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] | 4298 | 0 \ |
| 4299 | -S "session successfully restored from cache" \ |
| 4300 | -S "session successfully restored from ticket" \ |
| 4301 | -S "a session has been resumed" \ |
| 4302 | -C "a session has been resumed" |
| 4303 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4304 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4305 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4306 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4307 | "$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] | 4308 | 0 \ |
| 4309 | -s "session successfully restored from cache" \ |
| 4310 | -S "session successfully restored from ticket" \ |
| 4311 | -s "a session has been resumed" \ |
| 4312 | -c "a session has been resumed" |
| 4313 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4314 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4315 | run_test "Session resume using cache: session copy" \ |
| 4316 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4317 | "$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] | 4318 | 0 \ |
| 4319 | -s "session successfully restored from cache" \ |
| 4320 | -S "session successfully restored from ticket" \ |
| 4321 | -s "a session has been resumed" \ |
| 4322 | -c "a session has been resumed" |
| 4323 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4324 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4325 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4326 | run_test "Session resume using cache: openssl client" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4327 | "$P_SRV force_version=tls12 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 4328 | "( $O_CLI -sess_out $SESSION; \ |
| 4329 | $O_CLI -sess_in $SESSION; \ |
| 4330 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4331 | 0 \ |
| 4332 | -s "found session ticket extension" \ |
| 4333 | -S "server hello, adding session ticket extension" \ |
| 4334 | -s "session successfully restored from cache" \ |
| 4335 | -S "session successfully restored from ticket" \ |
| 4336 | -s "a session has been resumed" |
| 4337 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4338 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4339 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4340 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4341 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4342 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4343 | 0 \ |
| 4344 | -C "found session_ticket extension" \ |
| 4345 | -C "parse new session ticket" \ |
| 4346 | -c "a session has been resumed" |
| 4347 | |
Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 4348 | # Tests for Session resume and extensions |
| 4349 | |
| 4350 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4351 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 4352 | run_test "Session resume and connection ID" \ |
| 4353 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 4354 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 4355 | 0 \ |
| 4356 | -c "Enable use of CID extension." \ |
| 4357 | -s "Enable use of CID extension." \ |
| 4358 | -c "client hello, adding CID extension" \ |
| 4359 | -s "found CID extension" \ |
| 4360 | -s "Use of CID extension negotiated" \ |
| 4361 | -s "server hello, adding CID extension" \ |
| 4362 | -c "found CID extension" \ |
| 4363 | -c "Use of CID extension negotiated" \ |
| 4364 | -s "Copy CIDs into SSL transform" \ |
| 4365 | -c "Copy CIDs into SSL transform" \ |
| 4366 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 4367 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 4368 | -s "Use of Connection ID has been negotiated" \ |
| 4369 | -c "Use of Connection ID has been negotiated" |
| 4370 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4371 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 4372 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4373 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4374 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4375 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4376 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 4377 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4378 | "$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] | 4379 | 0 \ |
| 4380 | -c "client hello, adding session ticket extension" \ |
| 4381 | -s "found session ticket extension" \ |
| 4382 | -S "server hello, adding session ticket extension" \ |
| 4383 | -C "found session_ticket extension" \ |
| 4384 | -C "parse new session ticket" \ |
| 4385 | -s "session successfully restored from cache" \ |
| 4386 | -S "session successfully restored from ticket" \ |
| 4387 | -s "a session has been resumed" \ |
| 4388 | -c "a session has been resumed" |
| 4389 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4390 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4391 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4392 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4393 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 4394 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4395 | "$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] | 4396 | 0 \ |
| 4397 | -C "client hello, adding session ticket extension" \ |
| 4398 | -S "found session ticket extension" \ |
| 4399 | -S "server hello, adding session ticket extension" \ |
| 4400 | -C "found session_ticket extension" \ |
| 4401 | -C "parse new session ticket" \ |
| 4402 | -s "session successfully restored from cache" \ |
| 4403 | -S "session successfully restored from ticket" \ |
| 4404 | -s "a session has been resumed" \ |
| 4405 | -c "a session has been resumed" |
| 4406 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4407 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4408 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4409 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 4410 | "$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] | 4411 | "$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] | 4412 | 0 \ |
| 4413 | -S "session successfully restored from cache" \ |
| 4414 | -S "session successfully restored from ticket" \ |
| 4415 | -S "a session has been resumed" \ |
| 4416 | -C "a session has been resumed" |
| 4417 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4418 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4419 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4420 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 4421 | "$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] | 4422 | "$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] | 4423 | 0 \ |
| 4424 | -s "session successfully restored from cache" \ |
| 4425 | -S "session successfully restored from ticket" \ |
| 4426 | -s "a session has been resumed" \ |
| 4427 | -c "a session has been resumed" |
| 4428 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4429 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4430 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4431 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 4432 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4433 | "$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] | 4434 | 0 \ |
| 4435 | -s "session successfully restored from cache" \ |
| 4436 | -S "session successfully restored from ticket" \ |
| 4437 | -s "a session has been resumed" \ |
| 4438 | -c "a session has been resumed" |
| 4439 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4440 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4441 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4442 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 4443 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4444 | "$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] | 4445 | 0 \ |
| 4446 | -S "session successfully restored from cache" \ |
| 4447 | -S "session successfully restored from ticket" \ |
| 4448 | -S "a session has been resumed" \ |
| 4449 | -C "a session has been resumed" |
| 4450 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4451 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4452 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4453 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 4454 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4455 | "$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] | 4456 | 0 \ |
| 4457 | -s "session successfully restored from cache" \ |
| 4458 | -S "session successfully restored from ticket" \ |
| 4459 | -s "a session has been resumed" \ |
| 4460 | -c "a session has been resumed" |
| 4461 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4462 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4463 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4464 | run_test "Session resume using cache, DTLS: session copy" \ |
| 4465 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4466 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_mode=0" \ |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4467 | 0 \ |
| 4468 | -s "session successfully restored from cache" \ |
| 4469 | -S "session successfully restored from ticket" \ |
| 4470 | -s "a session has been resumed" \ |
| 4471 | -c "a session has been resumed" |
| 4472 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4473 | # 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] | 4474 | # 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] | 4475 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4476 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4477 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4478 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4479 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 4480 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4481 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4482 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4483 | rm -f $SESSION )" \ |
| 4484 | 0 \ |
| 4485 | -s "found session ticket extension" \ |
| 4486 | -S "server hello, adding session ticket extension" \ |
| 4487 | -s "session successfully restored from cache" \ |
| 4488 | -S "session successfully restored from ticket" \ |
| 4489 | -s "a session has been resumed" |
| 4490 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4492 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4493 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 4494 | "$O_SRV -dtls" \ |
| 4495 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 4496 | 0 \ |
| 4497 | -C "found session_ticket extension" \ |
| 4498 | -C "parse new session ticket" \ |
| 4499 | -c "a session has been resumed" |
| 4500 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4501 | # Tests for Max Fragment Length extension |
| 4502 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4503 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4504 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4505 | run_test "Max fragment length: enabled, default" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4506 | "$P_SRV debug_level=3 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4507 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4508 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4509 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4510 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4511 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4512 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4513 | -C "client hello, adding max_fragment_length extension" \ |
| 4514 | -S "found max fragment length extension" \ |
| 4515 | -S "server hello, max_fragment_length extension" \ |
| 4516 | -C "found max_fragment_length extension" |
| 4517 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4518 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4519 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4520 | run_test "Max fragment length: enabled, default, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4521 | "$P_SRV debug_level=3 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4522 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4523 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4524 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4525 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4526 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4527 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4528 | -C "client hello, adding max_fragment_length extension" \ |
| 4529 | -S "found max fragment length extension" \ |
| 4530 | -S "server hello, max_fragment_length extension" \ |
| 4531 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4532 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4533 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4534 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4535 | |
| 4536 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4537 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4538 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 4539 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4540 | "$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] | 4541 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4542 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4543 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4544 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4545 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4546 | -C "client hello, adding max_fragment_length extension" \ |
| 4547 | -S "found max fragment length extension" \ |
| 4548 | -S "server hello, max_fragment_length extension" \ |
| 4549 | -C "found max_fragment_length extension" \ |
| 4550 | -c "fragment larger than.*maximum " |
| 4551 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4552 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 4553 | # (session fragment length will be 16384 regardless of mbedtls |
| 4554 | # content length configuration.) |
| 4555 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4556 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4557 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4558 | run_test "Max fragment length: disabled, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4559 | "$P_SRV debug_level=3 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4560 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4561 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4562 | -C "Maximum incoming record payload length is 16384" \ |
| 4563 | -C "Maximum outgoing record payload length is 16384" \ |
| 4564 | -S "Maximum incoming record payload length is 16384" \ |
| 4565 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4566 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4567 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4568 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4569 | |
| 4570 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4571 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4572 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4573 | "$P_SRV debug_level=3 dtls=1 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4574 | "$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] | 4575 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4576 | -C "Maximum incoming record payload length is 16384" \ |
| 4577 | -C "Maximum outgoing record payload length is 16384" \ |
| 4578 | -S "Maximum incoming record payload length is 16384" \ |
| 4579 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4580 | -c "fragment larger than.*maximum " |
| 4581 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4582 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4583 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4584 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4585 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4586 | "$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] | 4587 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4588 | -c "Maximum incoming record payload length is 4096" \ |
| 4589 | -c "Maximum outgoing record payload length is 4096" \ |
| 4590 | -s "Maximum incoming record payload length is 4096" \ |
| 4591 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4592 | -c "client hello, adding max_fragment_length extension" \ |
| 4593 | -s "found max fragment length extension" \ |
| 4594 | -s "server hello, max_fragment_length extension" \ |
| 4595 | -c "found max_fragment_length extension" |
| 4596 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4597 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4598 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4599 | run_test "Max fragment length: client 512, server 1024" \ |
| 4600 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4601 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4602 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4603 | -c "Maximum incoming record payload length is 512" \ |
| 4604 | -c "Maximum outgoing record payload length is 512" \ |
| 4605 | -s "Maximum incoming record payload length is 512" \ |
| 4606 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4607 | -c "client hello, adding max_fragment_length extension" \ |
| 4608 | -s "found max fragment length extension" \ |
| 4609 | -s "server hello, max_fragment_length extension" \ |
| 4610 | -c "found max_fragment_length extension" |
| 4611 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4612 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4613 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4614 | run_test "Max fragment length: client 512, server 2048" \ |
| 4615 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4616 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4617 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4618 | -c "Maximum incoming record payload length is 512" \ |
| 4619 | -c "Maximum outgoing record payload length is 512" \ |
| 4620 | -s "Maximum incoming record payload length is 512" \ |
| 4621 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4622 | -c "client hello, adding max_fragment_length extension" \ |
| 4623 | -s "found max fragment length extension" \ |
| 4624 | -s "server hello, max_fragment_length extension" \ |
| 4625 | -c "found max_fragment_length extension" |
| 4626 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4627 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4628 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4629 | run_test "Max fragment length: client 512, server 4096" \ |
| 4630 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4631 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4632 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4633 | -c "Maximum incoming record payload length is 512" \ |
| 4634 | -c "Maximum outgoing record payload length is 512" \ |
| 4635 | -s "Maximum incoming record payload length is 512" \ |
| 4636 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4637 | -c "client hello, adding max_fragment_length extension" \ |
| 4638 | -s "found max fragment length extension" \ |
| 4639 | -s "server hello, max_fragment_length extension" \ |
| 4640 | -c "found max_fragment_length extension" |
| 4641 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4642 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4643 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4644 | run_test "Max fragment length: client 1024, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4645 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4646 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4647 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4648 | -c "Maximum incoming record payload length is 1024" \ |
| 4649 | -c "Maximum outgoing record payload length is 1024" \ |
| 4650 | -s "Maximum incoming record payload length is 1024" \ |
| 4651 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4652 | -c "client hello, adding max_fragment_length extension" \ |
| 4653 | -s "found max fragment length extension" \ |
| 4654 | -s "server hello, max_fragment_length extension" \ |
| 4655 | -c "found max_fragment_length extension" |
| 4656 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4657 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4658 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4659 | run_test "Max fragment length: client 1024, server 2048" \ |
| 4660 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4661 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4662 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4663 | -c "Maximum incoming record payload length is 1024" \ |
| 4664 | -c "Maximum outgoing record payload length is 1024" \ |
| 4665 | -s "Maximum incoming record payload length is 1024" \ |
| 4666 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4667 | -c "client hello, adding max_fragment_length extension" \ |
| 4668 | -s "found max fragment length extension" \ |
| 4669 | -s "server hello, max_fragment_length extension" \ |
| 4670 | -c "found max_fragment_length extension" |
| 4671 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4672 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4673 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4674 | run_test "Max fragment length: client 1024, server 4096" \ |
| 4675 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4676 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4677 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4678 | -c "Maximum incoming record payload length is 1024" \ |
| 4679 | -c "Maximum outgoing record payload length is 1024" \ |
| 4680 | -s "Maximum incoming record payload length is 1024" \ |
| 4681 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4682 | -c "client hello, adding max_fragment_length extension" \ |
| 4683 | -s "found max fragment length extension" \ |
| 4684 | -s "server hello, max_fragment_length extension" \ |
| 4685 | -c "found max_fragment_length extension" |
| 4686 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4687 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4688 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4689 | run_test "Max fragment length: client 2048, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4690 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4691 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4692 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4693 | -c "Maximum incoming record payload length is 2048" \ |
| 4694 | -c "Maximum outgoing record payload length is 2048" \ |
| 4695 | -s "Maximum incoming record payload length is 2048" \ |
| 4696 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4697 | -c "client hello, adding max_fragment_length extension" \ |
| 4698 | -s "found max fragment length extension" \ |
| 4699 | -s "server hello, max_fragment_length extension" \ |
| 4700 | -c "found max_fragment_length extension" |
| 4701 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4702 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4703 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4704 | run_test "Max fragment length: client 2048, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4705 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4706 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4707 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4708 | -c "Maximum incoming record payload length is 2048" \ |
| 4709 | -c "Maximum outgoing record payload length is 2048" \ |
| 4710 | -s "Maximum incoming record payload length is 2048" \ |
| 4711 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4712 | -c "client hello, adding max_fragment_length extension" \ |
| 4713 | -s "found max fragment length extension" \ |
| 4714 | -s "server hello, max_fragment_length extension" \ |
| 4715 | -c "found max_fragment_length extension" |
| 4716 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4717 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4718 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4719 | run_test "Max fragment length: client 2048, server 4096" \ |
| 4720 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4721 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4722 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4723 | -c "Maximum incoming record payload length is 2048" \ |
| 4724 | -c "Maximum outgoing record payload length is 2048" \ |
| 4725 | -s "Maximum incoming record payload length is 2048" \ |
| 4726 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4727 | -c "client hello, adding max_fragment_length extension" \ |
| 4728 | -s "found max fragment length extension" \ |
| 4729 | -s "server hello, max_fragment_length extension" \ |
| 4730 | -c "found max_fragment_length extension" |
| 4731 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4732 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4733 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4734 | run_test "Max fragment length: client 4096, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4735 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4736 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4737 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4738 | -c "Maximum incoming record payload length is 4096" \ |
| 4739 | -c "Maximum outgoing record payload length is 4096" \ |
| 4740 | -s "Maximum incoming record payload length is 4096" \ |
| 4741 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4742 | -c "client hello, adding max_fragment_length extension" \ |
| 4743 | -s "found max fragment length extension" \ |
| 4744 | -s "server hello, max_fragment_length extension" \ |
| 4745 | -c "found max_fragment_length extension" |
| 4746 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4747 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4748 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4749 | run_test "Max fragment length: client 4096, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4750 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4751 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4752 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4753 | -c "Maximum incoming record payload length is 4096" \ |
| 4754 | -c "Maximum outgoing record payload length is 4096" \ |
| 4755 | -s "Maximum incoming record payload length is 4096" \ |
| 4756 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4757 | -c "client hello, adding max_fragment_length extension" \ |
| 4758 | -s "found max fragment length extension" \ |
| 4759 | -s "server hello, max_fragment_length extension" \ |
| 4760 | -c "found max_fragment_length extension" |
| 4761 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4762 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4763 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4764 | run_test "Max fragment length: client 4096, server 2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4765 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4766 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4767 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4768 | -c "Maximum incoming record payload length is 4096" \ |
| 4769 | -c "Maximum outgoing record payload length is 4096" \ |
| 4770 | -s "Maximum incoming record payload length is 4096" \ |
| 4771 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4772 | -c "client hello, adding max_fragment_length extension" \ |
| 4773 | -s "found max fragment length extension" \ |
| 4774 | -s "server hello, max_fragment_length extension" \ |
| 4775 | -c "found max_fragment_length extension" |
| 4776 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4777 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4778 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4779 | run_test "Max fragment length: used by server" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4780 | "$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] | 4781 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4782 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4783 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4784 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4785 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4786 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4787 | -C "client hello, adding max_fragment_length extension" \ |
| 4788 | -S "found max fragment length extension" \ |
| 4789 | -S "server hello, max_fragment_length extension" \ |
| 4790 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4791 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4792 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4793 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4794 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4795 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4796 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4797 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4798 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4799 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4800 | -c "Maximum incoming record payload length is 4096" \ |
| 4801 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4802 | -c "client hello, adding max_fragment_length extension" \ |
| 4803 | -c "found max_fragment_length extension" |
| 4804 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4805 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4806 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4807 | run_test "Max fragment length: client, message just fits" \ |
| 4808 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4809 | "$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] | 4810 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4811 | -c "Maximum incoming record payload length is 2048" \ |
| 4812 | -c "Maximum outgoing record payload length is 2048" \ |
| 4813 | -s "Maximum incoming record payload length is 2048" \ |
| 4814 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4815 | -c "client hello, adding max_fragment_length extension" \ |
| 4816 | -s "found max fragment length extension" \ |
| 4817 | -s "server hello, max_fragment_length extension" \ |
| 4818 | -c "found max_fragment_length extension" \ |
| 4819 | -c "2048 bytes written in 1 fragments" \ |
| 4820 | -s "2048 bytes read" |
| 4821 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4822 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4823 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4824 | run_test "Max fragment length: client, larger message" \ |
| 4825 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4826 | "$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] | 4827 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4828 | -c "Maximum incoming record payload length is 2048" \ |
| 4829 | -c "Maximum outgoing record payload length is 2048" \ |
| 4830 | -s "Maximum incoming record payload length is 2048" \ |
| 4831 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4832 | -c "client hello, adding max_fragment_length extension" \ |
| 4833 | -s "found max fragment length extension" \ |
| 4834 | -s "server hello, max_fragment_length extension" \ |
| 4835 | -c "found max_fragment_length extension" \ |
| 4836 | -c "2345 bytes written in 2 fragments" \ |
| 4837 | -s "2048 bytes read" \ |
| 4838 | -s "297 bytes read" |
| 4839 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4840 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4841 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4842 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4843 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4844 | "$P_SRV debug_level=3 dtls=1" \ |
| 4845 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4846 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4847 | -c "Maximum incoming record payload length is 2048" \ |
| 4848 | -c "Maximum outgoing record payload length is 2048" \ |
| 4849 | -s "Maximum incoming record payload length is 2048" \ |
| 4850 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4851 | -c "client hello, adding max_fragment_length extension" \ |
| 4852 | -s "found max fragment length extension" \ |
| 4853 | -s "server hello, max_fragment_length extension" \ |
| 4854 | -c "found max_fragment_length extension" \ |
| 4855 | -c "fragment larger than.*maximum" |
| 4856 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4857 | # Tests for Record Size Limit extension |
| 4858 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4859 | requires_gnutls_tls1_3 |
| 4860 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4861 | 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] | 4862 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4863 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4864 | 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] | 4865 | "$P_SRV debug_level=3 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4866 | "$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] | 4867 | 0 \ |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4868 | -s "RecordSizeLimit: 16385 Bytes" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4869 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4870 | -s "Maximum outgoing record payload length is 16383" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4871 | -s "bytes written in 1 fragments" |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4872 | |
| 4873 | requires_gnutls_tls1_3 |
| 4874 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4875 | 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] | 4876 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4877 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4878 | 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] | 4879 | "$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] | 4880 | "$P_CLI debug_level=4 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4881 | 0 \ |
Yanray Wang | 42017cd | 2023-11-08 11:15:23 +0800 | [diff] [blame] | 4882 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 4883 | -c "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 4884 | -c "EncryptedExtensions: record_size_limit(28) extension received." \ |
Yanray Wang | 42017cd | 2023-11-08 11:15:23 +0800 | [diff] [blame] | 4885 | -c "RecordSizeLimit: 16385 Bytes" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4886 | |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 4887 | # In the following tests, --recordsize is the value used by the G_NEXT_CLI (3.7.2) to configure the |
| 4888 | # maximum record size using gnutls_record_set_max_size() |
| 4889 | # (https://gnutls.org/reference/gnutls-gnutls.html#gnutls-record-set-max-size). |
| 4890 | # There is currently a lower limit of 512, caused by gnutls_record_set_max_size() |
| 4891 | # not respecting the "%ALLOW_SMALL_RECORDS" priority string and not using the |
| 4892 | # more recent function gnutls_record_set_max_recv_size() |
| 4893 | # (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] | 4894 | # There is currently an upper limit of 4096, caused by the cli arg parser: |
| 4895 | # 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] | 4896 | # Thus, these tests are currently limited to the value range 512-4096. |
| 4897 | # Also, the value sent in the extension will be one larger than the value |
| 4898 | # set at the command line: |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4899 | # 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] | 4900 | |
| 4901 | # 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] | 4902 | # so for 513 record size limit tests we use preshared key to avoid sending |
| 4903 | # the certificate. |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4904 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4905 | requires_gnutls_tls1_3 |
| 4906 | requires_gnutls_record_size_limit |
| 4907 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
| 4908 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4909 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4910 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 1 fragment" \ |
| 4911 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4912 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4913 | response_size=256" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4914 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4915 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4916 | 0 \ |
| 4917 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4918 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4919 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4920 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4921 | -s "Maximum outgoing record payload length is 511" \ |
| 4922 | -s "256 bytes written in 1 fragments" |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4923 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4924 | requires_gnutls_tls1_3 |
| 4925 | requires_gnutls_record_size_limit |
| 4926 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
| 4927 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4928 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4929 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 2 fragments" \ |
| 4930 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4931 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4932 | response_size=768" \ |
| 4933 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4934 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
| 4935 | 0 \ |
| 4936 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4937 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4938 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4939 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4940 | -s "Maximum outgoing record payload length is 511" \ |
| 4941 | -s "768 bytes written in 2 fragments" |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4942 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4943 | requires_gnutls_tls1_3 |
| 4944 | requires_gnutls_record_size_limit |
| 4945 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
| 4946 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4947 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4948 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 3 fragments" \ |
| 4949 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4950 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4951 | response_size=1280" \ |
| 4952 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4953 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
| 4954 | 0 \ |
| 4955 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4956 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4957 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4958 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4959 | -s "Maximum outgoing record payload length is 511" \ |
| 4960 | -s "1280 bytes written in 3 fragments" |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4961 | |
| 4962 | requires_gnutls_tls1_3 |
| 4963 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4964 | 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] | 4965 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4966 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4967 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 1 fragment" \ |
| 4968 | "$P_SRV debug_level=3 force_version=tls13 response_size=512" \ |
| 4969 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 4970 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4971 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 4972 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 4973 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4974 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4975 | -s "Maximum outgoing record payload length is 1023" \ |
| 4976 | -s "512 bytes written in 1 fragments" |
| 4977 | |
| 4978 | requires_gnutls_tls1_3 |
| 4979 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4980 | 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] | 4981 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4982 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4983 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 2 fragments" \ |
| 4984 | "$P_SRV debug_level=3 force_version=tls13 response_size=1536" \ |
| 4985 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 4986 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4987 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 4988 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 4989 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4990 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4991 | -s "Maximum outgoing record payload length is 1023" \ |
| 4992 | -s "1536 bytes written in 2 fragments" |
| 4993 | |
| 4994 | requires_gnutls_tls1_3 |
| 4995 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4996 | 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] | 4997 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4998 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4999 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 3 fragments" \ |
| 5000 | "$P_SRV debug_level=3 force_version=tls13 response_size=2560" \ |
| 5001 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 5002 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5003 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 5004 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5005 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5006 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5007 | -s "Maximum outgoing record payload length is 1023" \ |
| 5008 | -s "2560 bytes written in 3 fragments" |
| 5009 | |
| 5010 | requires_gnutls_tls1_3 |
| 5011 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5012 | 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] | 5013 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5014 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5015 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 1 fragment" \ |
| 5016 | "$P_SRV debug_level=3 force_version=tls13 response_size=2048" \ |
| 5017 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5018 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5019 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5020 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5021 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5022 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5023 | -s "Maximum outgoing record payload length is 4095" \ |
| 5024 | -s "2048 bytes written in 1 fragments" |
| 5025 | |
| 5026 | requires_gnutls_tls1_3 |
| 5027 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5028 | 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] | 5029 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5030 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5031 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 2 fragments" \ |
| 5032 | "$P_SRV debug_level=3 force_version=tls13 response_size=6144" \ |
| 5033 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5034 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5035 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5036 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5037 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5038 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5039 | -s "Maximum outgoing record payload length is 4095" \ |
| 5040 | -s "6144 bytes written in 2 fragments" |
| 5041 | |
| 5042 | requires_gnutls_tls1_3 |
| 5043 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5044 | 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] | 5045 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5046 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5047 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 3 fragments" \ |
| 5048 | "$P_SRV debug_level=3 force_version=tls13 response_size=10240" \ |
| 5049 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5050 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5051 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5052 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5053 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5054 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5055 | -s "Maximum outgoing record payload length is 4095" \ |
| 5056 | -s "10240 bytes written in 3 fragments" |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 5057 | |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5058 | requires_gnutls_tls1_3 |
| 5059 | requires_gnutls_record_size_limit |
| 5060 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5061 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5062 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5063 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 1 fragment" \ |
| 5064 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5065 | "$P_CLI debug_level=4 force_version=tls13 request_size=256" \ |
| 5066 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5067 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5068 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5069 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5070 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5071 | -c "Maximum outgoing record payload length is 511" \ |
| 5072 | -c "256 bytes written in 1 fragments" |
| 5073 | |
| 5074 | requires_gnutls_tls1_3 |
| 5075 | requires_gnutls_record_size_limit |
| 5076 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5077 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5078 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5079 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 2 fragments" \ |
| 5080 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5081 | "$P_CLI debug_level=4 force_version=tls13 request_size=768" \ |
| 5082 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5083 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5084 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5085 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5086 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5087 | -c "Maximum outgoing record payload length is 511" \ |
| 5088 | -c "768 bytes written in 2 fragments" |
| 5089 | |
| 5090 | requires_gnutls_tls1_3 |
| 5091 | requires_gnutls_record_size_limit |
| 5092 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5093 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5094 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5095 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 3 fragments" \ |
| 5096 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5097 | "$P_CLI debug_level=4 force_version=tls13 request_size=1280" \ |
| 5098 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5099 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5100 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5101 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5102 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5103 | -c "Maximum outgoing record payload length is 511" \ |
| 5104 | -c "1280 bytes written in 3 fragments" |
| 5105 | |
| 5106 | requires_gnutls_tls1_3 |
| 5107 | requires_gnutls_record_size_limit |
| 5108 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5109 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5110 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5111 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 1 fragment" \ |
| 5112 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5113 | "$P_CLI debug_level=4 force_version=tls13 request_size=512" \ |
| 5114 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5115 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5116 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5117 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5118 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5119 | -c "Maximum outgoing record payload length is 1023" \ |
| 5120 | -c "512 bytes written in 1 fragments" |
| 5121 | |
| 5122 | requires_gnutls_tls1_3 |
| 5123 | requires_gnutls_record_size_limit |
| 5124 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5125 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5126 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5127 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 2 fragments" \ |
| 5128 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5129 | "$P_CLI debug_level=4 force_version=tls13 request_size=1536" \ |
| 5130 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5131 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5132 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5133 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5134 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5135 | -c "Maximum outgoing record payload length is 1023" \ |
| 5136 | -c "1536 bytes written in 2 fragments" |
| 5137 | |
| 5138 | requires_gnutls_tls1_3 |
| 5139 | requires_gnutls_record_size_limit |
| 5140 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5141 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5142 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5143 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 3 fragments" \ |
| 5144 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5145 | "$P_CLI debug_level=4 force_version=tls13 request_size=2560" \ |
| 5146 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5147 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5148 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5149 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5150 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5151 | -c "Maximum outgoing record payload length is 1023" \ |
| 5152 | -c "2560 bytes written in 3 fragments" |
| 5153 | |
| 5154 | requires_gnutls_tls1_3 |
| 5155 | requires_gnutls_record_size_limit |
| 5156 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5157 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5158 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5159 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 1 fragment" \ |
| 5160 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5161 | "$P_CLI debug_level=4 force_version=tls13 request_size=2048" \ |
| 5162 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5163 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5164 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5165 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5166 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5167 | -c "Maximum outgoing record payload length is 4095" \ |
| 5168 | -c "2048 bytes written in 1 fragments" |
| 5169 | |
| 5170 | requires_gnutls_tls1_3 |
| 5171 | requires_gnutls_record_size_limit |
| 5172 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5173 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5174 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5175 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 2 fragments" \ |
| 5176 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5177 | "$P_CLI debug_level=4 force_version=tls13 request_size=6144" \ |
| 5178 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5179 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5180 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5181 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5182 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5183 | -c "Maximum outgoing record payload length is 4095" \ |
| 5184 | -c "6144 bytes written in 2 fragments" |
| 5185 | |
| 5186 | requires_gnutls_tls1_3 |
| 5187 | requires_gnutls_record_size_limit |
| 5188 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5189 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5190 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5191 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 3 fragments" \ |
| 5192 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5193 | "$P_CLI debug_level=4 force_version=tls13 request_size=10240" \ |
| 5194 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5195 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5196 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5197 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5198 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5199 | -c "Maximum outgoing record payload length is 4095" \ |
| 5200 | -c "10240 bytes written in 3 fragments" |
| 5201 | |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5202 | # TODO: For time being, we send fixed value of RecordSizeLimit defined by |
| 5203 | # MBEDTLS_SSL_IN_CONTENT_LEN. Once we support variable buffer length of |
| 5204 | # RecordSizeLimit, we need to modify value of RecordSizeLimit in below test. |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5205 | requires_config_value_equals "MBEDTLS_SSL_IN_CONTENT_LEN" 16384 |
| 5206 | 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] | 5207 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5208 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5209 | 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] | 5210 | "$P_SRV debug_level=4 force_version=tls13" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5211 | "$P_CLI debug_level=4" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5212 | 0 \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5213 | -c "Sent RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5214 | -c "RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5215 | -s "RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5216 | -s "Sent RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5217 | -s "Maximum outgoing record payload length is 16383" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5218 | -s "Maximum incoming record payload length is 16384" |
| 5219 | |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 5220 | # End of Record size limit tests |
| 5221 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5222 | # Tests for renegotiation |
| 5223 | |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5224 | # G_NEXT_SRV is used in renegotiation tests becuase of the increased |
| 5225 | # extensions limit since we exceed the limit in G_SRV when we send |
| 5226 | # TLS 1.3 extensions in the initial handshake. |
| 5227 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5228 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5229 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5230 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5231 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5232 | 0 \ |
| 5233 | -C "client hello, adding renegotiation extension" \ |
| 5234 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5235 | -S "found renegotiation extension" \ |
| 5236 | -s "server hello, secure renegotiation extension" \ |
| 5237 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5238 | -C "=> renegotiate" \ |
| 5239 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5240 | -S "write hello request" |
| 5241 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5242 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5243 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5244 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5245 | "$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] | 5246 | 0 \ |
| 5247 | -c "client hello, adding renegotiation extension" \ |
| 5248 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5249 | -s "found renegotiation extension" \ |
| 5250 | -s "server hello, secure renegotiation extension" \ |
| 5251 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5252 | -c "=> renegotiate" \ |
| 5253 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5254 | -S "write hello request" |
| 5255 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5256 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5257 | run_test "Renegotiation: server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5258 | "$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] | 5259 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5260 | 0 \ |
| 5261 | -c "client hello, adding renegotiation extension" \ |
| 5262 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5263 | -s "found renegotiation extension" \ |
| 5264 | -s "server hello, secure renegotiation extension" \ |
| 5265 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5266 | -c "=> renegotiate" \ |
| 5267 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5268 | -s "write hello request" |
| 5269 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5270 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 5271 | # 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] | 5272 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5273 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5274 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 5275 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5276 | "$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] | 5277 | 0 \ |
| 5278 | -c "client hello, adding renegotiation extension" \ |
| 5279 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5280 | -s "found renegotiation extension" \ |
| 5281 | -s "server hello, secure renegotiation extension" \ |
| 5282 | -c "found renegotiation extension" \ |
| 5283 | -c "=> renegotiate" \ |
| 5284 | -s "=> renegotiate" \ |
| 5285 | -S "write hello request" \ |
| 5286 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 5287 | |
| 5288 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 5289 | # 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] | 5290 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5291 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5292 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5293 | "$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] | 5294 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 5295 | 0 \ |
| 5296 | -c "client hello, adding renegotiation extension" \ |
| 5297 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5298 | -s "found renegotiation extension" \ |
| 5299 | -s "server hello, secure renegotiation extension" \ |
| 5300 | -c "found renegotiation extension" \ |
| 5301 | -c "=> renegotiate" \ |
| 5302 | -s "=> renegotiate" \ |
| 5303 | -s "write hello request" \ |
| 5304 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 5305 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5306 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5307 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5308 | "$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] | 5309 | "$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] | 5310 | 0 \ |
| 5311 | -c "client hello, adding renegotiation extension" \ |
| 5312 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5313 | -s "found renegotiation extension" \ |
| 5314 | -s "server hello, secure renegotiation extension" \ |
| 5315 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5316 | -c "=> renegotiate" \ |
| 5317 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5318 | -s "write hello request" |
| 5319 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5320 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5321 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 5322 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5323 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5324 | "$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] | 5325 | "$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" \ |
| 5326 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 5327 | -c "Maximum incoming record payload length is 2048" \ |
| 5328 | -c "Maximum outgoing record payload length is 2048" \ |
| 5329 | -s "Maximum incoming record payload length is 2048" \ |
| 5330 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5331 | -c "client hello, adding max_fragment_length extension" \ |
| 5332 | -s "found max fragment length extension" \ |
| 5333 | -s "server hello, max_fragment_length extension" \ |
| 5334 | -c "found max_fragment_length extension" \ |
| 5335 | -c "client hello, adding renegotiation extension" \ |
| 5336 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5337 | -s "found renegotiation extension" \ |
| 5338 | -s "server hello, secure renegotiation extension" \ |
| 5339 | -c "found renegotiation extension" \ |
| 5340 | -c "=> renegotiate" \ |
| 5341 | -s "=> renegotiate" \ |
| 5342 | -s "write hello request" |
| 5343 | |
| 5344 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5345 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5346 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5347 | "$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] | 5348 | 1 \ |
| 5349 | -c "client hello, adding renegotiation extension" \ |
| 5350 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5351 | -S "found renegotiation extension" \ |
| 5352 | -s "server hello, secure renegotiation extension" \ |
| 5353 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5354 | -c "=> renegotiate" \ |
| 5355 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5356 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 5357 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5358 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5359 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5360 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5361 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5362 | "$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] | 5363 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5364 | 0 \ |
| 5365 | -C "client hello, adding renegotiation extension" \ |
| 5366 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5367 | -S "found renegotiation extension" \ |
| 5368 | -s "server hello, secure renegotiation extension" \ |
| 5369 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5370 | -C "=> renegotiate" \ |
| 5371 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5372 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 5373 | -S "SSL - An unexpected message was received from our peer" \ |
| 5374 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5375 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5376 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5377 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5378 | "$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] | 5379 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5380 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5381 | 0 \ |
| 5382 | -C "client hello, adding renegotiation extension" \ |
| 5383 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5384 | -S "found renegotiation extension" \ |
| 5385 | -s "server hello, secure renegotiation extension" \ |
| 5386 | -c "found renegotiation extension" \ |
| 5387 | -C "=> renegotiate" \ |
| 5388 | -S "=> renegotiate" \ |
| 5389 | -s "write hello request" \ |
| 5390 | -S "SSL - An unexpected message was received from our peer" \ |
| 5391 | -S "failed" |
| 5392 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5393 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5394 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5395 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5396 | "$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] | 5397 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5398 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5399 | 0 \ |
| 5400 | -C "client hello, adding renegotiation extension" \ |
| 5401 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5402 | -S "found renegotiation extension" \ |
| 5403 | -s "server hello, secure renegotiation extension" \ |
| 5404 | -c "found renegotiation extension" \ |
| 5405 | -C "=> renegotiate" \ |
| 5406 | -S "=> renegotiate" \ |
| 5407 | -s "write hello request" \ |
| 5408 | -S "SSL - An unexpected message was received from our peer" \ |
| 5409 | -S "failed" |
| 5410 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5411 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5412 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5413 | "$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] | 5414 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5415 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5416 | 0 \ |
| 5417 | -C "client hello, adding renegotiation extension" \ |
| 5418 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5419 | -S "found renegotiation extension" \ |
| 5420 | -s "server hello, secure renegotiation extension" \ |
| 5421 | -c "found renegotiation extension" \ |
| 5422 | -C "=> renegotiate" \ |
| 5423 | -S "=> renegotiate" \ |
| 5424 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5425 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5426 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5427 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5428 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5429 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5430 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5431 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5432 | 0 \ |
| 5433 | -c "client hello, adding renegotiation extension" \ |
| 5434 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5435 | -s "found renegotiation extension" \ |
| 5436 | -s "server hello, secure renegotiation extension" \ |
| 5437 | -c "found renegotiation extension" \ |
| 5438 | -c "=> renegotiate" \ |
| 5439 | -s "=> renegotiate" \ |
| 5440 | -s "write hello request" \ |
| 5441 | -S "SSL - An unexpected message was received from our peer" \ |
| 5442 | -S "failed" |
| 5443 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5444 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5445 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5446 | "$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] | 5447 | "$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] | 5448 | 0 \ |
| 5449 | -C "client hello, adding renegotiation extension" \ |
| 5450 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5451 | -S "found renegotiation extension" \ |
| 5452 | -s "server hello, secure renegotiation extension" \ |
| 5453 | -c "found renegotiation extension" \ |
| 5454 | -S "record counter limit reached: renegotiate" \ |
| 5455 | -C "=> renegotiate" \ |
| 5456 | -S "=> renegotiate" \ |
| 5457 | -S "write hello request" \ |
| 5458 | -S "SSL - An unexpected message was received from our peer" \ |
| 5459 | -S "failed" |
| 5460 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 5461 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5462 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5463 | run_test "Renegotiation: periodic, just above period" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5464 | "$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] | 5465 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5466 | 0 \ |
| 5467 | -c "client hello, adding renegotiation extension" \ |
| 5468 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5469 | -s "found renegotiation extension" \ |
| 5470 | -s "server hello, secure renegotiation extension" \ |
| 5471 | -c "found renegotiation extension" \ |
| 5472 | -s "record counter limit reached: renegotiate" \ |
| 5473 | -c "=> renegotiate" \ |
| 5474 | -s "=> renegotiate" \ |
| 5475 | -s "write hello request" \ |
| 5476 | -S "SSL - An unexpected message was received from our peer" \ |
| 5477 | -S "failed" |
| 5478 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5479 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5480 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5481 | "$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] | 5482 | "$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] | 5483 | 0 \ |
| 5484 | -c "client hello, adding renegotiation extension" \ |
| 5485 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5486 | -s "found renegotiation extension" \ |
| 5487 | -s "server hello, secure renegotiation extension" \ |
| 5488 | -c "found renegotiation extension" \ |
| 5489 | -s "record counter limit reached: renegotiate" \ |
| 5490 | -c "=> renegotiate" \ |
| 5491 | -s "=> renegotiate" \ |
| 5492 | -s "write hello request" \ |
| 5493 | -S "SSL - An unexpected message was received from our peer" \ |
| 5494 | -S "failed" |
| 5495 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5496 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5497 | run_test "Renegotiation: periodic, above period, disabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5498 | "$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] | 5499 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 5500 | 0 \ |
| 5501 | -C "client hello, adding renegotiation extension" \ |
| 5502 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5503 | -S "found renegotiation extension" \ |
| 5504 | -s "server hello, secure renegotiation extension" \ |
| 5505 | -c "found renegotiation extension" \ |
| 5506 | -S "record counter limit reached: renegotiate" \ |
| 5507 | -C "=> renegotiate" \ |
| 5508 | -S "=> renegotiate" \ |
| 5509 | -S "write hello request" \ |
| 5510 | -S "SSL - An unexpected message was received from our peer" \ |
| 5511 | -S "failed" |
| 5512 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5513 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5514 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5515 | "$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] | 5516 | "$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] | 5517 | 0 \ |
| 5518 | -c "client hello, adding renegotiation extension" \ |
| 5519 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5520 | -s "found renegotiation extension" \ |
| 5521 | -s "server hello, secure renegotiation extension" \ |
| 5522 | -c "found renegotiation extension" \ |
| 5523 | -c "=> renegotiate" \ |
| 5524 | -s "=> renegotiate" \ |
| 5525 | -S "write hello request" |
| 5526 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5527 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5528 | run_test "Renegotiation: nbio, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5529 | "$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] | 5530 | "$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] | 5531 | 0 \ |
| 5532 | -c "client hello, adding renegotiation extension" \ |
| 5533 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5534 | -s "found renegotiation extension" \ |
| 5535 | -s "server hello, secure renegotiation extension" \ |
| 5536 | -c "found renegotiation extension" \ |
| 5537 | -c "=> renegotiate" \ |
| 5538 | -s "=> renegotiate" \ |
| 5539 | -s "write hello request" |
| 5540 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5541 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5542 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5543 | run_test "Renegotiation: openssl server, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5544 | "$O_SRV -www -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5545 | "$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] | 5546 | 0 \ |
| 5547 | -c "client hello, adding renegotiation extension" \ |
| 5548 | -c "found renegotiation extension" \ |
| 5549 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5550 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5551 | -C "error" \ |
| 5552 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5553 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5554 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5555 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5556 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5557 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5558 | "$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] | 5559 | "$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] | 5560 | 0 \ |
| 5561 | -c "client hello, adding renegotiation extension" \ |
| 5562 | -c "found renegotiation extension" \ |
| 5563 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5564 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5565 | -C "error" \ |
| 5566 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5567 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5568 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5569 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5570 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5571 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5572 | "$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] | 5573 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5574 | 1 \ |
| 5575 | -c "client hello, adding renegotiation extension" \ |
| 5576 | -C "found renegotiation extension" \ |
| 5577 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5578 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5579 | -c "error" \ |
| 5580 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5581 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5582 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5583 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5584 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5585 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5586 | "$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] | 5587 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5588 | allow_legacy=0" \ |
| 5589 | 1 \ |
| 5590 | -c "client hello, adding renegotiation extension" \ |
| 5591 | -C "found renegotiation extension" \ |
| 5592 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5593 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5594 | -c "error" \ |
| 5595 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5596 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5597 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5598 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5599 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5600 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5601 | "$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] | 5602 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5603 | allow_legacy=1" \ |
| 5604 | 0 \ |
| 5605 | -c "client hello, adding renegotiation extension" \ |
| 5606 | -C "found renegotiation extension" \ |
| 5607 | -c "=> renegotiate" \ |
| 5608 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5609 | -C "error" \ |
| 5610 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5611 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5612 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5613 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 5614 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 5615 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 5616 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5617 | 0 \ |
| 5618 | -c "client hello, adding renegotiation extension" \ |
| 5619 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5620 | -s "found renegotiation extension" \ |
| 5621 | -s "server hello, secure renegotiation extension" \ |
| 5622 | -c "found renegotiation extension" \ |
| 5623 | -c "=> renegotiate" \ |
| 5624 | -s "=> renegotiate" \ |
| 5625 | -S "write hello request" |
| 5626 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5627 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5629 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 5630 | "$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] | 5631 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 5632 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5633 | 0 \ |
| 5634 | -c "client hello, adding renegotiation extension" \ |
| 5635 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5636 | -s "found renegotiation extension" \ |
| 5637 | -s "server hello, secure renegotiation extension" \ |
| 5638 | -c "found renegotiation extension" \ |
| 5639 | -c "=> renegotiate" \ |
| 5640 | -s "=> renegotiate" \ |
| 5641 | -s "write hello request" |
| 5642 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5643 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5644 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5645 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 5646 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 5647 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 5648 | 0 \ |
| 5649 | -c "client hello, adding renegotiation extension" \ |
| 5650 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5651 | -s "found renegotiation extension" \ |
| 5652 | -s "server hello, secure renegotiation extension" \ |
| 5653 | -s "record counter limit reached: renegotiate" \ |
| 5654 | -c "=> renegotiate" \ |
| 5655 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5656 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5657 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5658 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5659 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5660 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5661 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5662 | "$G_NEXT_SRV -u --mtu 4096" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5663 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5664 | 0 \ |
| 5665 | -c "client hello, adding renegotiation extension" \ |
| 5666 | -c "found renegotiation extension" \ |
| 5667 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5668 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5669 | -C "error" \ |
| 5670 | -s "Extra-header:" |
| 5671 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5672 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5673 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5674 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5675 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5676 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5677 | run_test "Renego ext: gnutls server strict, client default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5678 | "$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] | 5679 | "$P_CLI debug_level=3" \ |
| 5680 | 0 \ |
| 5681 | -c "found renegotiation extension" \ |
| 5682 | -C "error" \ |
| 5683 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5684 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5685 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5686 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5687 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5688 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5689 | "$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] | 5690 | "$P_CLI debug_level=3" \ |
| 5691 | 0 \ |
| 5692 | -C "found renegotiation extension" \ |
| 5693 | -C "error" \ |
| 5694 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5695 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5696 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5697 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5698 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5699 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5700 | "$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] | 5701 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 5702 | 1 \ |
| 5703 | -C "found renegotiation extension" \ |
| 5704 | -c "error" \ |
| 5705 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5706 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5707 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5708 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5710 | run_test "Renego ext: gnutls client strict, server default" \ |
| 5711 | "$P_SRV debug_level=3" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5712 | "$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] | 5713 | 0 \ |
| 5714 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5715 | -s "server hello, secure renegotiation extension" |
| 5716 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5717 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5718 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5719 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5720 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 5721 | "$P_SRV debug_level=3" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5722 | "$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] | 5723 | 0 \ |
| 5724 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5725 | -S "server hello, secure renegotiation extension" |
| 5726 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5727 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5728 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5729 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5730 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 5731 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5732 | "$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] | 5733 | 1 \ |
| 5734 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5735 | -S "server hello, secure renegotiation extension" |
| 5736 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5737 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 5738 | |
| 5739 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5740 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5741 | run_test "DER format: no trailing bytes" \ |
| 5742 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 5743 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5744 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5745 | 0 \ |
| 5746 | -c "Handshake was completed" \ |
| 5747 | |
| 5748 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5749 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5750 | run_test "DER format: with a trailing zero byte" \ |
| 5751 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 5752 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5753 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5754 | 0 \ |
| 5755 | -c "Handshake was completed" \ |
| 5756 | |
| 5757 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5758 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5759 | run_test "DER format: with a trailing random byte" \ |
| 5760 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 5761 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5762 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5763 | 0 \ |
| 5764 | -c "Handshake was completed" \ |
| 5765 | |
| 5766 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5767 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5768 | run_test "DER format: with 2 trailing random bytes" \ |
| 5769 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 5770 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5771 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5772 | 0 \ |
| 5773 | -c "Handshake was completed" \ |
| 5774 | |
| 5775 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5776 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5777 | run_test "DER format: with 4 trailing random bytes" \ |
| 5778 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 5779 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5780 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5781 | 0 \ |
| 5782 | -c "Handshake was completed" \ |
| 5783 | |
| 5784 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5785 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5786 | run_test "DER format: with 8 trailing random bytes" \ |
| 5787 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 5788 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5789 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5790 | 0 \ |
| 5791 | -c "Handshake was completed" \ |
| 5792 | |
| 5793 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5795 | run_test "DER format: with 9 trailing random bytes" \ |
| 5796 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 5797 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5798 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5799 | 0 \ |
| 5800 | -c "Handshake was completed" \ |
| 5801 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5802 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 5803 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5804 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5805 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5806 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5807 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5808 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5809 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5810 | 1 \ |
| 5811 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5812 | -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] | 5813 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5814 | -c "X509 - Certificate verification failed" |
| 5815 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5816 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5817 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5818 | key_file=data_files/server5.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5819 | "$P_CLI force_version=tls12 debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5820 | 0 \ |
| 5821 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5822 | -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] | 5823 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5824 | -C "X509 - Certificate verification failed" |
| 5825 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5826 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5827 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 5828 | "$P_SRV" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5829 | "$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] | 5830 | 0 \ |
| 5831 | -c "x509_verify_cert() returned" \ |
| 5832 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5833 | -c "! Certificate verification flags"\ |
| 5834 | -C "! mbedtls_ssl_handshake returned" \ |
| 5835 | -C "X509 - Certificate verification failed" \ |
| 5836 | -C "SSL - No CA Chain is set, but required to operate" |
| 5837 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5838 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5839 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 5840 | "$P_SRV" \ |
| 5841 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5842 | 1 \ |
| 5843 | -c "x509_verify_cert() returned" \ |
| 5844 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5845 | -c "! Certificate verification flags"\ |
| 5846 | -c "! mbedtls_ssl_handshake returned" \ |
| 5847 | -c "SSL - No CA Chain is set, but required to operate" |
| 5848 | |
| 5849 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5850 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5851 | # the client informs the server about the supported curves - it does, though, in the |
| 5852 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5853 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5854 | # different means to have the server ignoring the client's supported curve list. |
| 5855 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5856 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5857 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5858 | crt_file=data_files/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 5859 | "$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] | 5860 | 1 \ |
| 5861 | -c "bad certificate (EC key curve)"\ |
| 5862 | -c "! Certificate verification flags"\ |
| 5863 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5864 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5865 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5866 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5867 | crt_file=data_files/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 5868 | "$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] | 5869 | 1 \ |
| 5870 | -c "bad certificate (EC key curve)"\ |
| 5871 | -c "! Certificate verification flags"\ |
| 5872 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5873 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5874 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 5875 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5876 | key_file=data_files/server5.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5877 | "$P_CLI force_version=tls12 debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5878 | 0 \ |
| 5879 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5880 | -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] | 5881 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5882 | -C "X509 - Certificate verification failed" |
| 5883 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5884 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5885 | run_test "Authentication: client SHA256, server required" \ |
| 5886 | "$P_SRV auth_mode=required" \ |
| 5887 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5888 | key_file=data_files/server6.key \ |
| 5889 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5890 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5891 | -c "Supported Signature Algorithm found: 04 " \ |
| 5892 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5893 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5894 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5895 | run_test "Authentication: client SHA384, server required" \ |
| 5896 | "$P_SRV auth_mode=required" \ |
| 5897 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5898 | key_file=data_files/server6.key \ |
| 5899 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5900 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5901 | -c "Supported Signature Algorithm found: 04 " \ |
| 5902 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5903 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5904 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5905 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 5906 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5907 | "$P_CLI debug_level=3 crt_file=none \ |
| 5908 | key_file=data_files/server5.key" \ |
| 5909 | 1 \ |
| 5910 | -S "skip write certificate request" \ |
| 5911 | -C "skip parse certificate request" \ |
| 5912 | -c "got a certificate request" \ |
| 5913 | -c "= write certificate$" \ |
| 5914 | -C "skip write certificate$" \ |
| 5915 | -S "x509_verify_cert() returned" \ |
Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 5916 | -s "peer has no certificate" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5917 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5918 | -s "No client certification received from the client, but required by the authentication mode" |
| 5919 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5920 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5921 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5922 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5923 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5924 | key_file=data_files/server5.key" \ |
| 5925 | 1 \ |
| 5926 | -S "skip write certificate request" \ |
| 5927 | -C "skip parse certificate request" \ |
| 5928 | -c "got a certificate request" \ |
| 5929 | -C "skip write certificate" \ |
| 5930 | -C "skip write certificate verify" \ |
| 5931 | -S "skip parse certificate verify" \ |
| 5932 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5933 | -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] | 5934 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5935 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5936 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5937 | # We don't check that the client receives the alert because it might |
| 5938 | # detect that its write end of the connection is closed and abort |
| 5939 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5940 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5941 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 5942 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 5943 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 5944 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5945 | key_file=data_files/server5.key" \ |
| 5946 | 0 \ |
| 5947 | -S "skip write certificate request" \ |
| 5948 | -C "skip parse certificate request" \ |
| 5949 | -c "got a certificate request" \ |
| 5950 | -C "skip write certificate" \ |
| 5951 | -C "skip write certificate verify" \ |
| 5952 | -S "skip parse certificate verify" \ |
| 5953 | -S "x509_verify_cert() returned" \ |
| 5954 | -S "! The certificate is not correctly signed" \ |
| 5955 | -S "X509 - Certificate verification failed" |
| 5956 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5957 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5958 | run_test "Authentication: client cert not trusted, server required" \ |
| 5959 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5960 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5961 | key_file=data_files/server5.key" \ |
| 5962 | 1 \ |
| 5963 | -S "skip write certificate request" \ |
| 5964 | -C "skip parse certificate request" \ |
| 5965 | -c "got a certificate request" \ |
| 5966 | -C "skip write certificate" \ |
| 5967 | -C "skip write certificate verify" \ |
| 5968 | -S "skip parse certificate verify" \ |
| 5969 | -s "x509_verify_cert() returned" \ |
| 5970 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5971 | -s "! mbedtls_ssl_handshake returned" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5972 | -s "X509 - Certificate verification failed" |
| 5973 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5974 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5975 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5976 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5977 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5978 | key_file=data_files/server5.key" \ |
| 5979 | 0 \ |
| 5980 | -S "skip write certificate request" \ |
| 5981 | -C "skip parse certificate request" \ |
| 5982 | -c "got a certificate request" \ |
| 5983 | -C "skip write certificate" \ |
| 5984 | -C "skip write certificate verify" \ |
| 5985 | -S "skip parse certificate verify" \ |
| 5986 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5987 | -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] | 5988 | -S "! mbedtls_ssl_handshake returned" \ |
| 5989 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5990 | -S "X509 - Certificate verification failed" |
| 5991 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5992 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5993 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5994 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 5995 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5996 | key_file=data_files/server5.key" \ |
| 5997 | 0 \ |
| 5998 | -s "skip write certificate request" \ |
| 5999 | -C "skip parse certificate request" \ |
| 6000 | -c "got no certificate request" \ |
| 6001 | -c "skip write certificate" \ |
| 6002 | -c "skip write certificate verify" \ |
| 6003 | -s "skip parse certificate verify" \ |
| 6004 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6005 | -S "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6006 | -S "! mbedtls_ssl_handshake returned" \ |
| 6007 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6008 | -S "X509 - Certificate verification failed" |
| 6009 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6010 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6011 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6012 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 6013 | "$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] | 6014 | 0 \ |
| 6015 | -S "skip write certificate request" \ |
| 6016 | -C "skip parse certificate request" \ |
| 6017 | -c "got a certificate request" \ |
| 6018 | -C "skip write certificate$" \ |
| 6019 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6020 | -c "skip write certificate verify" \ |
| 6021 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6022 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6023 | -S "! mbedtls_ssl_handshake returned" \ |
| 6024 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6025 | -S "X509 - Certificate verification failed" |
| 6026 | |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 6027 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6028 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6029 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6030 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6031 | "$O_NEXT_CLI_NO_CERT -no_middlebox" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6032 | 0 \ |
| 6033 | -S "skip write certificate request" \ |
| 6034 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6035 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6036 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6037 | -S "X509 - Certificate verification failed" |
| 6038 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6039 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6040 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6041 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6042 | "$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] | 6043 | 0 \ |
| 6044 | -C "skip parse certificate request" \ |
| 6045 | -c "got a certificate request" \ |
| 6046 | -C "skip write certificate$" \ |
| 6047 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6048 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6049 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6050 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6051 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6052 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6053 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 6054 | 1 \ |
| 6055 | -C "skip parse certificate request" \ |
| 6056 | -c "got a certificate request" \ |
| 6057 | -C "skip write certificate$" \ |
| 6058 | -c "skip write certificate verify" \ |
| 6059 | -c "! mbedtls_ssl_handshake returned" |
| 6060 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 6061 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 6062 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 6063 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 6064 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 6065 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 6066 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 6067 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 6068 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 6069 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 6070 | # 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] | 6071 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6072 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6073 | run_test "Authentication: server max_int chain, client default" \ |
| 6074 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 6075 | key_file=data_files/dir-maxpath/09.key" \ |
| 6076 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 6077 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6078 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6079 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6080 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6081 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6082 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 6083 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 6084 | key_file=data_files/dir-maxpath/10.key" \ |
| 6085 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 6086 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6087 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6088 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6089 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6090 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6091 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 6092 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 6093 | key_file=data_files/dir-maxpath/10.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6094 | "$P_CLI force_version=tls12 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6095 | auth_mode=optional" \ |
| 6096 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6097 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6098 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6099 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6100 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6101 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 6102 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 6103 | key_file=data_files/dir-maxpath/10.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6104 | "$P_CLI force_version=tls12 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6105 | auth_mode=none" \ |
| 6106 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6107 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6108 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6109 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6110 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6111 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 6112 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 6113 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 6114 | key_file=data_files/dir-maxpath/10.key" \ |
| 6115 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6116 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6117 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6118 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6119 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6120 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 6121 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 6122 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 6123 | key_file=data_files/dir-maxpath/10.key" \ |
| 6124 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6125 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6126 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6127 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6128 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6129 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 6130 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 6131 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 6132 | key_file=data_files/dir-maxpath/10.key" \ |
| 6133 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6134 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6135 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6136 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6137 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6138 | run_test "Authentication: client max_int chain, server required" \ |
| 6139 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 6140 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 6141 | key_file=data_files/dir-maxpath/09.key" \ |
| 6142 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6143 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6144 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6145 | # Tests for CA list in CertificateRequest messages |
| 6146 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6147 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6148 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 6149 | "$P_SRV debug_level=3 auth_mode=required" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6150 | "$P_CLI force_version=tls12 crt_file=data_files/server6.crt \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6151 | key_file=data_files/server6.key" \ |
| 6152 | 0 \ |
| 6153 | -s "requested DN" |
| 6154 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6155 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6156 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 6157 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6158 | "$P_CLI force_version=tls12 crt_file=data_files/server6.crt \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6159 | key_file=data_files/server6.key" \ |
| 6160 | 0 \ |
| 6161 | -S "requested DN" |
| 6162 | |
| 6163 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6164 | "$P_SRV force_version=tls12 debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6165 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 6166 | key_file=data_files/server5.key" \ |
| 6167 | 1 \ |
| 6168 | -S "requested DN" \ |
| 6169 | -s "x509_verify_cert() returned" \ |
| 6170 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6171 | -s "! mbedtls_ssl_handshake returned" \ |
| 6172 | -c "! mbedtls_ssl_handshake returned" \ |
| 6173 | -s "X509 - Certificate verification failed" |
| 6174 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6175 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6176 | run_test "Authentication: send alt conf DN hints in CertificateRequest" \ |
| 6177 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 6178 | crt_file2=data_files/server1.crt \ |
| 6179 | key_file2=data_files/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6180 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6181 | crt_file=data_files/server6.crt \ |
| 6182 | key_file=data_files/server6.key" \ |
| 6183 | 0 \ |
| 6184 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 6185 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6186 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6187 | run_test "Authentication: send alt conf DN hints in CertificateRequest (2)" \ |
| 6188 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 6189 | crt_file2=data_files/server2.crt \ |
| 6190 | key_file2=data_files/server2.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6191 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6192 | crt_file=data_files/server6.crt \ |
| 6193 | key_file=data_files/server6.key" \ |
| 6194 | 0 \ |
| 6195 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" |
| 6196 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6197 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6198 | run_test "Authentication: send alt hs DN hints in CertificateRequest" \ |
| 6199 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=3 \ |
| 6200 | crt_file2=data_files/server1.crt \ |
| 6201 | key_file2=data_files/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6202 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6203 | crt_file=data_files/server6.crt \ |
| 6204 | key_file=data_files/server6.key" \ |
| 6205 | 0 \ |
| 6206 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 6207 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 6208 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 6209 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6210 | |
| 6211 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6212 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 6213 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 6214 | key_file=data_files/server5.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 6215 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6216 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6217 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6218 | -c "x509_verify_cert() returned" \ |
| 6219 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6220 | -c "! mbedtls_ssl_handshake returned" \ |
| 6221 | -c "X509 - Certificate verification failed" |
| 6222 | |
| 6223 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6224 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 6225 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 6226 | key_file=data_files/server5.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 6227 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 auth_mode=optional" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6228 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6229 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6230 | -c "x509_verify_cert() returned" \ |
| 6231 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6232 | -C "! mbedtls_ssl_handshake returned" \ |
| 6233 | -C "X509 - Certificate verification failed" |
| 6234 | |
| 6235 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 6236 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 6237 | # the client informs the server about the supported curves - it does, though, in the |
| 6238 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 6239 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 6240 | # different means to have the server ignoring the client's supported curve list. |
| 6241 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6242 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6243 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 6244 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 6245 | crt_file=data_files/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6246 | "$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] | 6247 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6248 | -c "use CA callback for X.509 CRT verification" \ |
| 6249 | -c "bad certificate (EC key curve)" \ |
| 6250 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6251 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 6252 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6253 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6254 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
Valerio Setti | a9aafd4 | 2023-04-11 12:30:45 +0200 | [diff] [blame] | 6255 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6256 | crt_file=data_files/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6257 | "$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] | 6258 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6259 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6260 | -c "bad certificate (EC key curve)"\ |
| 6261 | -c "! Certificate verification flags"\ |
| 6262 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 6263 | |
| 6264 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6265 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6266 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 6267 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 6268 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 6269 | key_file=data_files/server6.key \ |
| 6270 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 6271 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6272 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6273 | -c "Supported Signature Algorithm found: 04 " \ |
| 6274 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6275 | |
| 6276 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6277 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6278 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 6279 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 6280 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 6281 | key_file=data_files/server6.key \ |
| 6282 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 6283 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6284 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6285 | -c "Supported Signature Algorithm found: 04 " \ |
| 6286 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6287 | |
| 6288 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6289 | run_test "Authentication, CA callback: client badcert, server required" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 6290 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6291 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 6292 | key_file=data_files/server5.key" \ |
| 6293 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6294 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6295 | -S "skip write certificate request" \ |
| 6296 | -C "skip parse certificate request" \ |
| 6297 | -c "got a certificate request" \ |
| 6298 | -C "skip write certificate" \ |
| 6299 | -C "skip write certificate verify" \ |
| 6300 | -S "skip parse certificate verify" \ |
| 6301 | -s "x509_verify_cert() returned" \ |
| 6302 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6303 | -s "! mbedtls_ssl_handshake returned" \ |
| 6304 | -s "send alert level=2 message=48" \ |
| 6305 | -c "! mbedtls_ssl_handshake returned" \ |
| 6306 | -s "X509 - Certificate verification failed" |
| 6307 | # We don't check that the client receives the alert because it might |
| 6308 | # detect that its write end of the connection is closed and abort |
| 6309 | # before reading the alert message. |
| 6310 | |
| 6311 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6312 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 6313 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6314 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 6315 | key_file=data_files/server5.key" \ |
| 6316 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6317 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6318 | -S "skip write certificate request" \ |
| 6319 | -C "skip parse certificate request" \ |
| 6320 | -c "got a certificate request" \ |
| 6321 | -C "skip write certificate" \ |
| 6322 | -C "skip write certificate verify" \ |
| 6323 | -S "skip parse certificate verify" \ |
| 6324 | -s "x509_verify_cert() returned" \ |
| 6325 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6326 | -s "! mbedtls_ssl_handshake returned" \ |
| 6327 | -c "! mbedtls_ssl_handshake returned" \ |
| 6328 | -s "X509 - Certificate verification failed" |
| 6329 | |
| 6330 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6331 | run_test "Authentication, CA callback: client badcert, server optional" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 6332 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 auth_mode=optional" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6333 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 6334 | key_file=data_files/server5.key" \ |
| 6335 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6336 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6337 | -S "skip write certificate request" \ |
| 6338 | -C "skip parse certificate request" \ |
| 6339 | -c "got a certificate request" \ |
| 6340 | -C "skip write certificate" \ |
| 6341 | -C "skip write certificate verify" \ |
| 6342 | -S "skip parse certificate verify" \ |
| 6343 | -s "x509_verify_cert() returned" \ |
| 6344 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6345 | -S "! mbedtls_ssl_handshake returned" \ |
| 6346 | -C "! mbedtls_ssl_handshake returned" \ |
| 6347 | -S "X509 - Certificate verification failed" |
| 6348 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6349 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6350 | requires_full_size_output_buffer |
| 6351 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6352 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 6353 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 6354 | key_file=data_files/dir-maxpath/09.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 6355 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6356 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6357 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6358 | -C "X509 - A fatal error occurred" |
| 6359 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6360 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6361 | requires_full_size_output_buffer |
| 6362 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6363 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 6364 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 6365 | key_file=data_files/dir-maxpath/10.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 6366 | "$P_CLI force_version=tls12 debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6367 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6368 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6369 | -c "X509 - A fatal error occurred" |
| 6370 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6371 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6372 | requires_full_size_output_buffer |
| 6373 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6374 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 6375 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 6376 | key_file=data_files/dir-maxpath/10.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 6377 | "$P_CLI force_version=tls12 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6378 | debug_level=3 auth_mode=optional" \ |
| 6379 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6380 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6381 | -c "X509 - A fatal error occurred" |
| 6382 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6383 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6384 | requires_full_size_output_buffer |
| 6385 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6386 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 6387 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6388 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 6389 | key_file=data_files/dir-maxpath/10.key" \ |
| 6390 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6391 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6392 | -s "X509 - A fatal error occurred" |
| 6393 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6394 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6395 | requires_full_size_output_buffer |
| 6396 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6397 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 6398 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6399 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 6400 | key_file=data_files/dir-maxpath/10.key" \ |
| 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 "X509 - A fatal error occurred" |
| 6404 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6405 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6406 | requires_full_size_output_buffer |
| 6407 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6408 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 6409 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6410 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 6411 | key_file=data_files/dir-maxpath/09.key" \ |
| 6412 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6413 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6414 | -S "X509 - A fatal error occurred" |
| 6415 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 6416 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6417 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6418 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6419 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6420 | "$P_SRV force_version=tls12 crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6421 | key_file=data_files/server5.key \ |
| 6422 | crt_file2=data_files/server5-sha1.crt \ |
| 6423 | key_file2=data_files/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6424 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6425 | 0 \ |
| 6426 | -c "signed using.*ECDSA with SHA256" \ |
| 6427 | -C "signed using.*ECDSA with SHA1" |
| 6428 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6429 | # tests for SNI |
| 6430 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6431 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6432 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6433 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6434 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6435 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6436 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6437 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6438 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6439 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6440 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6441 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6442 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6443 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6444 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6445 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 6446 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6447 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6448 | 0 \ |
| 6449 | -s "parse ServerName extension" \ |
| 6450 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6451 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6452 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6453 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6454 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6455 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6456 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6457 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 6458 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6459 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6460 | 0 \ |
| 6461 | -s "parse ServerName extension" \ |
| 6462 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6463 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6464 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6465 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6466 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6467 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6468 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6469 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 6470 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6471 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6472 | 1 \ |
| 6473 | -s "parse ServerName extension" \ |
| 6474 | -s "ssl_sni_wrapper() returned" \ |
| 6475 | -s "mbedtls_ssl_handshake returned" \ |
| 6476 | -c "mbedtls_ssl_handshake returned" \ |
| 6477 | -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] | 6478 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6479 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6480 | run_test "SNI: client auth no override: optional" \ |
| 6481 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6482 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6483 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 6484 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6485 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6486 | -S "skip write certificate request" \ |
| 6487 | -C "skip parse certificate request" \ |
| 6488 | -c "got a certificate request" \ |
| 6489 | -C "skip write certificate" \ |
| 6490 | -C "skip write certificate verify" \ |
| 6491 | -S "skip parse certificate verify" |
| 6492 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6493 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6494 | run_test "SNI: client auth override: none -> optional" \ |
| 6495 | "$P_SRV debug_level=3 auth_mode=none \ |
| 6496 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6497 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 6498 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6499 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6500 | -S "skip write certificate request" \ |
| 6501 | -C "skip parse certificate request" \ |
| 6502 | -c "got a certificate request" \ |
| 6503 | -C "skip write certificate" \ |
| 6504 | -C "skip write certificate verify" \ |
| 6505 | -S "skip parse certificate verify" |
| 6506 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6507 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6508 | run_test "SNI: client auth override: optional -> none" \ |
| 6509 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6510 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6511 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 6512 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6513 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6514 | -s "skip write certificate request" \ |
| 6515 | -C "skip parse certificate request" \ |
| 6516 | -c "got no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 6517 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6518 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6519 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6520 | run_test "SNI: CA no override" \ |
| 6521 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6522 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6523 | ca_file=data_files/test-ca.crt \ |
| 6524 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 6525 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6526 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6527 | 1 \ |
| 6528 | -S "skip write certificate request" \ |
| 6529 | -C "skip parse certificate request" \ |
| 6530 | -c "got a certificate request" \ |
| 6531 | -C "skip write certificate" \ |
| 6532 | -C "skip write certificate verify" \ |
| 6533 | -S "skip parse certificate verify" \ |
| 6534 | -s "x509_verify_cert() returned" \ |
| 6535 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6536 | -S "The certificate has been revoked (is on a CRL)" |
| 6537 | |
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 | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6539 | run_test "SNI: CA override" \ |
| 6540 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6541 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6542 | ca_file=data_files/test-ca.crt \ |
| 6543 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 6544 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6545 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6546 | 0 \ |
| 6547 | -S "skip write certificate request" \ |
| 6548 | -C "skip parse certificate request" \ |
| 6549 | -c "got a certificate request" \ |
| 6550 | -C "skip write certificate" \ |
| 6551 | -C "skip write certificate verify" \ |
| 6552 | -S "skip parse certificate verify" \ |
| 6553 | -S "x509_verify_cert() returned" \ |
| 6554 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6555 | -S "The certificate has been revoked (is on a CRL)" |
| 6556 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6557 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6558 | run_test "SNI: CA override with CRL" \ |
| 6559 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6560 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6561 | ca_file=data_files/test-ca.crt \ |
| 6562 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 6563 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6564 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6565 | 1 \ |
| 6566 | -S "skip write certificate request" \ |
| 6567 | -C "skip parse certificate request" \ |
| 6568 | -c "got a certificate request" \ |
| 6569 | -C "skip write certificate" \ |
| 6570 | -C "skip write certificate verify" \ |
| 6571 | -S "skip parse certificate verify" \ |
| 6572 | -s "x509_verify_cert() returned" \ |
| 6573 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6574 | -s "The certificate has been revoked (is on a CRL)" |
| 6575 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6576 | # Tests for SNI and DTLS |
| 6577 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6578 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6579 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6580 | run_test "SNI: DTLS, no SNI callback" \ |
| 6581 | "$P_SRV debug_level=3 dtls=1 \ |
| 6582 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 6583 | "$P_CLI server_name=localhost dtls=1" \ |
| 6584 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6585 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6586 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6587 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6588 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6589 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6590 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6591 | "$P_SRV debug_level=3 dtls=1 \ |
| 6592 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6593 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6594 | "$P_CLI server_name=localhost dtls=1" \ |
| 6595 | 0 \ |
| 6596 | -s "parse ServerName extension" \ |
| 6597 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6598 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6599 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6600 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6601 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6602 | run_test "SNI: DTLS, matching cert 2" \ |
| 6603 | "$P_SRV debug_level=3 dtls=1 \ |
| 6604 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6605 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6606 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 6607 | 0 \ |
| 6608 | -s "parse ServerName extension" \ |
| 6609 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6610 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6611 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6612 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6613 | run_test "SNI: DTLS, no matching cert" \ |
| 6614 | "$P_SRV debug_level=3 dtls=1 \ |
| 6615 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6616 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6617 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 6618 | 1 \ |
| 6619 | -s "parse ServerName extension" \ |
| 6620 | -s "ssl_sni_wrapper() returned" \ |
| 6621 | -s "mbedtls_ssl_handshake returned" \ |
| 6622 | -c "mbedtls_ssl_handshake returned" \ |
| 6623 | -c "SSL - A fatal alert message was received from our peer" |
| 6624 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6625 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6626 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 6627 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6628 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6629 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 6630 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6631 | 0 \ |
| 6632 | -S "skip write certificate request" \ |
| 6633 | -C "skip parse certificate request" \ |
| 6634 | -c "got a certificate request" \ |
| 6635 | -C "skip write certificate" \ |
| 6636 | -C "skip write certificate verify" \ |
| 6637 | -S "skip parse certificate verify" |
| 6638 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6639 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6640 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 6641 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 6642 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6643 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 6644 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6645 | 0 \ |
| 6646 | -S "skip write certificate request" \ |
| 6647 | -C "skip parse certificate request" \ |
| 6648 | -c "got a certificate request" \ |
| 6649 | -C "skip write certificate" \ |
| 6650 | -C "skip write certificate verify" \ |
| 6651 | -S "skip parse certificate verify" |
| 6652 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6653 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6654 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 6655 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6656 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6657 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 6658 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6659 | 0 \ |
| 6660 | -s "skip write certificate request" \ |
| 6661 | -C "skip parse certificate request" \ |
| 6662 | -c "got no certificate request" \ |
| 6663 | -c "skip write certificate" \ |
| 6664 | -c "skip write certificate verify" \ |
| 6665 | -s "skip parse certificate verify" |
| 6666 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6667 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6668 | run_test "SNI: DTLS, CA no override" \ |
| 6669 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6670 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6671 | ca_file=data_files/test-ca.crt \ |
| 6672 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 6673 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6674 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6675 | 1 \ |
| 6676 | -S "skip write certificate request" \ |
| 6677 | -C "skip parse certificate request" \ |
| 6678 | -c "got a certificate request" \ |
| 6679 | -C "skip write certificate" \ |
| 6680 | -C "skip write certificate verify" \ |
| 6681 | -S "skip parse certificate verify" \ |
| 6682 | -s "x509_verify_cert() returned" \ |
| 6683 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6684 | -S "The certificate has been revoked (is on a CRL)" |
| 6685 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6686 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6687 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6688 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6689 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6690 | ca_file=data_files/test-ca.crt \ |
| 6691 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 6692 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6693 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6694 | 0 \ |
| 6695 | -S "skip write certificate request" \ |
| 6696 | -C "skip parse certificate request" \ |
| 6697 | -c "got a certificate request" \ |
| 6698 | -C "skip write certificate" \ |
| 6699 | -C "skip write certificate verify" \ |
| 6700 | -S "skip parse certificate verify" \ |
| 6701 | -S "x509_verify_cert() returned" \ |
| 6702 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6703 | -S "The certificate has been revoked (is on a CRL)" |
| 6704 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6705 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6706 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6707 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6708 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 6709 | ca_file=data_files/test-ca.crt \ |
| 6710 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 6711 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6712 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6713 | 1 \ |
| 6714 | -S "skip write certificate request" \ |
| 6715 | -C "skip parse certificate request" \ |
| 6716 | -c "got a certificate request" \ |
| 6717 | -C "skip write certificate" \ |
| 6718 | -C "skip write certificate verify" \ |
| 6719 | -S "skip parse certificate verify" \ |
| 6720 | -s "x509_verify_cert() returned" \ |
| 6721 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6722 | -s "The certificate has been revoked (is on a CRL)" |
| 6723 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6724 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 6725 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6726 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6727 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6728 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6729 | "$P_CLI nbio=2 tickets=0" \ |
| 6730 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6731 | -S "mbedtls_ssl_handshake returned" \ |
| 6732 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6733 | -c "Read from server: .* bytes read" |
| 6734 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6735 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6736 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6737 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 6738 | "$P_CLI nbio=2 tickets=0" \ |
| 6739 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6740 | -S "mbedtls_ssl_handshake returned" \ |
| 6741 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6742 | -c "Read from server: .* bytes read" |
| 6743 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6744 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6745 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6746 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6747 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6748 | "$P_CLI nbio=2 tickets=1" \ |
| 6749 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6750 | -S "mbedtls_ssl_handshake returned" \ |
| 6751 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6752 | -c "Read from server: .* bytes read" |
| 6753 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6754 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6755 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6756 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6757 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6758 | "$P_CLI nbio=2 tickets=1" \ |
| 6759 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6760 | -S "mbedtls_ssl_handshake returned" \ |
| 6761 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6762 | -c "Read from server: .* bytes read" |
| 6763 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6764 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6765 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6766 | 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] | 6767 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6768 | "$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] | 6769 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6770 | -S "mbedtls_ssl_handshake returned" \ |
| 6771 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6772 | -c "Read from server: .* bytes read" |
| 6773 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6774 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6775 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6776 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6777 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6778 | run_test "Non-blocking I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 6779 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6780 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6781 | 0 \ |
| 6782 | -S "mbedtls_ssl_handshake returned" \ |
| 6783 | -C "mbedtls_ssl_handshake returned" \ |
| 6784 | -c "Read from server: .* bytes read" |
| 6785 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6786 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6787 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6788 | 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] | 6789 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6790 | "$P_CLI force_version=tls12 nbio=2 tickets=1 reconnect=1" \ |
| 6791 | 0 \ |
| 6792 | -S "mbedtls_ssl_handshake returned" \ |
| 6793 | -C "mbedtls_ssl_handshake returned" \ |
| 6794 | -c "Read from server: .* bytes read" |
| 6795 | |
| 6796 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6797 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6798 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6799 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6800 | run_test "Non-blocking I/O: TLS 1.3 + ticket + resume" \ |
| 6801 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6802 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6803 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6804 | -S "mbedtls_ssl_handshake returned" \ |
| 6805 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6806 | -c "Read from server: .* bytes read" |
| 6807 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6808 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6809 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6810 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6811 | "$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] | 6812 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6813 | -S "mbedtls_ssl_handshake returned" \ |
| 6814 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6815 | -c "Read from server: .* bytes read" |
| 6816 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6817 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 6818 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6819 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6820 | run_test "Event-driven I/O: basic handshake" \ |
| 6821 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6822 | "$P_CLI event=1 tickets=0" \ |
| 6823 | 0 \ |
| 6824 | -S "mbedtls_ssl_handshake returned" \ |
| 6825 | -C "mbedtls_ssl_handshake returned" \ |
| 6826 | -c "Read from server: .* bytes read" |
| 6827 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6828 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6829 | run_test "Event-driven I/O: client auth" \ |
| 6830 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 6831 | "$P_CLI event=1 tickets=0" \ |
| 6832 | 0 \ |
| 6833 | -S "mbedtls_ssl_handshake returned" \ |
| 6834 | -C "mbedtls_ssl_handshake returned" \ |
| 6835 | -c "Read from server: .* bytes read" |
| 6836 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6837 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6838 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6839 | run_test "Event-driven I/O: ticket" \ |
| 6840 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6841 | "$P_CLI event=1 tickets=1" \ |
| 6842 | 0 \ |
| 6843 | -S "mbedtls_ssl_handshake returned" \ |
| 6844 | -C "mbedtls_ssl_handshake returned" \ |
| 6845 | -c "Read from server: .* bytes read" |
| 6846 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6847 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6848 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6849 | run_test "Event-driven I/O: ticket + client auth" \ |
| 6850 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6851 | "$P_CLI event=1 tickets=1" \ |
| 6852 | 0 \ |
| 6853 | -S "mbedtls_ssl_handshake returned" \ |
| 6854 | -C "mbedtls_ssl_handshake returned" \ |
| 6855 | -c "Read from server: .* bytes read" |
| 6856 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6857 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6858 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6859 | 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] | 6860 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6861 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6862 | 0 \ |
| 6863 | -S "mbedtls_ssl_handshake returned" \ |
| 6864 | -C "mbedtls_ssl_handshake returned" \ |
| 6865 | -c "Read from server: .* bytes read" |
| 6866 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6867 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6868 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6869 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6870 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6871 | run_test "Event-driven I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 6872 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6873 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6874 | 0 \ |
| 6875 | -S "mbedtls_ssl_handshake returned" \ |
| 6876 | -C "mbedtls_ssl_handshake returned" \ |
| 6877 | -c "Read from server: .* bytes read" |
| 6878 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6879 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6880 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6881 | run_test "Event-driven I/O: TLS 1.2 + ticket + resume" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6882 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6883 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
| 6884 | 0 \ |
| 6885 | -S "mbedtls_ssl_handshake returned" \ |
| 6886 | -C "mbedtls_ssl_handshake returned" \ |
| 6887 | -c "Read from server: .* bytes read" |
| 6888 | |
| 6889 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6890 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6891 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6892 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6893 | run_test "Event-driven I/O: TLS 1.3 + ticket + resume" \ |
| 6894 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6895 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6896 | 0 \ |
| 6897 | -S "mbedtls_ssl_handshake returned" \ |
| 6898 | -C "mbedtls_ssl_handshake returned" \ |
| 6899 | -c "Read from server: .* bytes read" |
| 6900 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6901 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6902 | run_test "Event-driven I/O: session-id resume" \ |
| 6903 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6904 | "$P_CLI force_version=tls12 event=1 tickets=0 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6905 | 0 \ |
| 6906 | -S "mbedtls_ssl_handshake returned" \ |
| 6907 | -C "mbedtls_ssl_handshake returned" \ |
| 6908 | -c "Read from server: .* bytes read" |
| 6909 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6910 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6911 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 6912 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 6913 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6914 | 0 \ |
| 6915 | -c "Read from server: .* bytes read" |
| 6916 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6917 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6918 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 6919 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 6920 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6921 | 0 \ |
| 6922 | -c "Read from server: .* bytes read" |
| 6923 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6924 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6925 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6926 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 6927 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 6928 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6929 | 0 \ |
| 6930 | -c "Read from server: .* bytes read" |
| 6931 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6932 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6933 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6934 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 6935 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 6936 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6937 | 0 \ |
| 6938 | -c "Read from server: .* bytes read" |
| 6939 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6940 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6941 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6942 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 6943 | "$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] | 6944 | "$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] | 6945 | 0 \ |
| 6946 | -c "Read from server: .* bytes read" |
| 6947 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6948 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6949 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6950 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 6951 | "$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] | 6952 | "$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] | 6953 | 0 \ |
| 6954 | -c "Read from server: .* bytes read" |
| 6955 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6956 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6957 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 6958 | "$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] | 6959 | "$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] | 6960 | 0 \ |
| 6961 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6962 | |
| 6963 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 6964 | # During session resumption, the client will send its ApplicationData record |
| 6965 | # within the same datagram as the Finished messages. In this situation, the |
| 6966 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 6967 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6968 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6969 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6970 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6971 | "$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] | 6972 | "$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] | 6973 | 0 \ |
| 6974 | -c "Read from server: .* bytes read" |
| 6975 | |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 6976 | # Tests for version negotiation. Some information to ease the understanding |
| 6977 | # of the version negotiation test titles below: |
| 6978 | # . 1.2/1.3 means that only TLS 1.2/TLS 1.3 is enabled. |
| 6979 | # . 1.2+1.3 means that both TLS 1.2 and TLS 1.3 are enabled. |
| 6980 | # . 1.2+(1.3)/(1.2)+1.3 means that TLS 1.2/1.3 is enabled and that |
| 6981 | # TLS 1.3/1.2 may be enabled or not. |
| 6982 | # . max=1.2 means that both TLS 1.2 and TLS 1.3 are enabled at build time but |
| 6983 | # TLS 1.3 is disabled at runtime (maximum negotiable version is TLS 1.2). |
| 6984 | # . min=1.3 means that both TLS 1.2 and TLS 1.3 are enabled at build time but |
| 6985 | # TLS 1.2 is disabled at runtime (minimum negotiable version is TLS 1.3). |
| 6986 | |
Ronald Cron | fe18d8d | 2024-03-06 15:19:55 +0100 | [diff] [blame] | 6987 | # Tests for version negotiation, MbedTLS client and server |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6988 | |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 6989 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C |
| 6990 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6991 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 6992 | 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] | 6993 | "$P_SRV" \ |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 6994 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6995 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6996 | -S "mbedtls_ssl_handshake returned" \ |
| 6997 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6998 | -s "Protocol is TLSv1.2" \ |
| 6999 | -c "Protocol is TLSv1.2" |
| 7000 | |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7001 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7002 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7003 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7004 | 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] | 7005 | "$P_SRV max_version=tls12" \ |
| 7006 | "$P_CLI max_version=tls12" \ |
| 7007 | 0 \ |
| 7008 | -S "mbedtls_ssl_handshake returned" \ |
| 7009 | -C "mbedtls_ssl_handshake returned" \ |
| 7010 | -s "Protocol is TLSv1.2" \ |
| 7011 | -c "Protocol is TLSv1.2" |
| 7012 | |
| 7013 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7014 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 7015 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7016 | 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] | 7017 | "$P_SRV" \ |
| 7018 | "$P_CLI" \ |
| 7019 | 0 \ |
| 7020 | -S "mbedtls_ssl_handshake returned" \ |
| 7021 | -C "mbedtls_ssl_handshake returned" \ |
| 7022 | -s "Protocol is TLSv1.3" \ |
| 7023 | -c "Protocol is TLSv1.3" |
| 7024 | |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7025 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7026 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7027 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7028 | 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] | 7029 | "$P_SRV min_version=tls13" \ |
| 7030 | "$P_CLI min_version=tls13" \ |
| 7031 | 0 \ |
| 7032 | -S "mbedtls_ssl_handshake returned" \ |
| 7033 | -C "mbedtls_ssl_handshake returned" \ |
| 7034 | -s "Protocol is TLSv1.3" \ |
| 7035 | -c "Protocol is TLSv1.3" |
| 7036 | |
| 7037 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7038 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7039 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7040 | 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] | 7041 | "$P_SRV" \ |
| 7042 | "$P_CLI" \ |
| 7043 | 0 \ |
| 7044 | -S "mbedtls_ssl_handshake returned" \ |
| 7045 | -C "mbedtls_ssl_handshake returned" \ |
| 7046 | -s "Protocol is TLSv1.3" \ |
| 7047 | -c "Protocol is TLSv1.3" |
| 7048 | |
| 7049 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7050 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7051 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7052 | 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] | 7053 | "$P_SRV min_version=tls13" \ |
| 7054 | "$P_CLI" \ |
| 7055 | 0 \ |
| 7056 | -S "mbedtls_ssl_handshake returned" \ |
| 7057 | -C "mbedtls_ssl_handshake returned" \ |
| 7058 | -s "Protocol is TLSv1.3" \ |
| 7059 | -c "Protocol is TLSv1.3" |
| 7060 | |
| 7061 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7062 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7063 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7064 | 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] | 7065 | "$P_SRV max_version=tls12" \ |
| 7066 | "$P_CLI" \ |
| 7067 | 0 \ |
| 7068 | -S "mbedtls_ssl_handshake returned" \ |
| 7069 | -C "mbedtls_ssl_handshake returned" \ |
| 7070 | -s "Protocol is TLSv1.2" \ |
| 7071 | -c "Protocol is TLSv1.2" |
| 7072 | |
| 7073 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7074 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7075 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7076 | 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] | 7077 | "$P_SRV" \ |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7078 | "$P_CLI max_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7079 | 0 \ |
| 7080 | -S "mbedtls_ssl_handshake returned" \ |
| 7081 | -C "mbedtls_ssl_handshake returned" \ |
| 7082 | -s "Protocol is TLSv1.2" \ |
| 7083 | -c "Protocol is TLSv1.2" |
| 7084 | |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7085 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7086 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7087 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7088 | 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] | 7089 | "$P_SRV" \ |
| 7090 | "$P_CLI min_version=tls13" \ |
| 7091 | 0 \ |
| 7092 | -S "mbedtls_ssl_handshake returned" \ |
| 7093 | -C "mbedtls_ssl_handshake returned" \ |
| 7094 | -s "Protocol is TLSv1.3" \ |
| 7095 | -c "Protocol is TLSv1.3" |
| 7096 | |
| 7097 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7098 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7099 | 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] | 7100 | "$P_SRV min_version=tls13" \ |
| 7101 | "$P_CLI max_version=tls12" \ |
| 7102 | 1 \ |
| 7103 | -s "Handshake protocol not within min/max boundaries" \ |
| 7104 | -S "Protocol is TLSv1.2" \ |
| 7105 | -C "Protocol is TLSv1.2" \ |
| 7106 | -S "Protocol is TLSv1.3" \ |
| 7107 | -C "Protocol is TLSv1.3" |
Ronald Cron | fe18d8d | 2024-03-06 15:19:55 +0100 | [diff] [blame] | 7108 | |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7109 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7110 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7111 | 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] | 7112 | "$P_SRV max_version=tls12" \ |
| 7113 | "$P_CLI min_version=tls13" \ |
| 7114 | 1 \ |
| 7115 | -s "The handshake negotiation failed" \ |
| 7116 | -S "Protocol is TLSv1.2" \ |
| 7117 | -C "Protocol is TLSv1.2" \ |
| 7118 | -S "Protocol is TLSv1.3" \ |
| 7119 | -C "Protocol is TLSv1.3" |
| 7120 | |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7121 | # Tests of version negotiation on server side against GnuTLS client |
| 7122 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7123 | 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] | 7124 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7125 | 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] | 7126 | "$P_SRV" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7127 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7128 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7129 | -S "mbedtls_ssl_handshake returned" \ |
| 7130 | -s "Protocol is TLSv1.2" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7131 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7132 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7133 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7134 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7135 | 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] | 7136 | "$P_SRV max_version=tls12" \ |
| 7137 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7138 | 0 \ |
| 7139 | -S "mbedtls_ssl_handshake returned" \ |
| 7140 | -s "Protocol is TLSv1.2" |
| 7141 | |
| 7142 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7143 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7144 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7145 | 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] | 7146 | "$P_SRV" \ |
| 7147 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7148 | 0 \ |
| 7149 | -S "mbedtls_ssl_handshake returned" \ |
| 7150 | -s "Protocol is TLSv1.3" |
| 7151 | |
| 7152 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7153 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7154 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7155 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7156 | 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] | 7157 | "$P_SRV min_version=tls13" \ |
| 7158 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7159 | 0 \ |
| 7160 | -S "mbedtls_ssl_handshake returned" \ |
| 7161 | -s "Protocol is TLSv1.3" |
| 7162 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7163 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7164 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7165 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7166 | 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] | 7167 | "$P_SRV" \ |
| 7168 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7169 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7170 | -S "mbedtls_ssl_handshake returned" \ |
| 7171 | -s "Protocol is TLSv1.3" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7172 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7173 | requires_gnutls_next_disable_tls13_compat |
| 7174 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7175 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7176 | run_test "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] | 7177 | "$P_SRV" \ |
| 7178 | "$G_NEXT_CLI localhost --priority=NORMAL:%DISABLE_TLS13_COMPAT_MODE" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7179 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7180 | -S "mbedtls_ssl_handshake returned" \ |
| 7181 | -s "Protocol is TLSv1.3" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7182 | |
| 7183 | # GnuTLS can be setup to send a ClientHello containing a supported versions |
| 7184 | # extension proposing TLS 1.2 (preferred) and then TLS 1.3. In that case, |
| 7185 | # a TLS 1.3 and TLS 1.2 capable server is supposed to negotiate TLS 1.2 and |
| 7186 | # to indicate in the ServerHello that it downgrades from TLS 1.3. The GnuTLS |
| 7187 | # client then detects the downgrade indication and aborts the handshake even |
| 7188 | # if TLS 1.2 was its preferred version. Keeping the test even if the |
| 7189 | # handshake fails eventually as it exercices parts of the Mbed TLS |
| 7190 | # implementation that are otherwise not exercised. |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7191 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7192 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7193 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7194 | 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] | 7195 | "$P_SRV" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7196 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3" \ |
| 7197 | 1 \ |
| 7198 | -c "Detected downgrade to TLS 1.2 from TLS 1.3" |
| 7199 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7200 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7201 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7202 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7203 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7204 | 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] | 7205 | "$P_SRV min_version=tls13" \ |
| 7206 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7207 | 0 \ |
| 7208 | -S "mbedtls_ssl_handshake returned" \ |
| 7209 | -s "Protocol is TLSv1.3" |
| 7210 | |
| 7211 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7212 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7213 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7214 | 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] | 7215 | "$P_SRV" \ |
| 7216 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7217 | 0 \ |
| 7218 | -S "mbedtls_ssl_handshake returned" \ |
| 7219 | -s "Protocol is TLSv1.2" |
| 7220 | |
| 7221 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7222 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7223 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7224 | 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] | 7225 | "$P_SRV max_version=tls12" \ |
| 7226 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7227 | 0 \ |
| 7228 | -S "mbedtls_ssl_handshake returned" \ |
| 7229 | -s "Protocol is TLSv1.2" |
| 7230 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7231 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7232 | 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] | 7233 | "$P_SRV" \ |
| 7234 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 7235 | 1 \ |
| 7236 | -s "Handshake protocol not within min/max boundaries" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7237 | -S "Protocol is TLSv1.0" |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7238 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7239 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7240 | 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] | 7241 | "$P_SRV" \ |
| 7242 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 7243 | 1 \ |
| 7244 | -s "Handshake protocol not within min/max boundaries" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7245 | -S "Protocol is TLSv1.1" |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7246 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7247 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7248 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7249 | 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] | 7250 | "$P_SRV" \ |
| 7251 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7252 | 1 \ |
| 7253 | -s "Handshake protocol not within min/max boundaries" \ |
| 7254 | -S "Protocol is TLSv1.2" |
| 7255 | |
| 7256 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7257 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7258 | 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] | 7259 | "$P_SRV" \ |
| 7260 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7261 | 1 \ |
| 7262 | -S "Handshake protocol not within min/max boundaries" \ |
| 7263 | -s "The handshake negotiation failed" \ |
| 7264 | -S "Protocol is TLSv1.3" |
| 7265 | |
| 7266 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7267 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7268 | 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] | 7269 | "$P_SRV min_version=tls13" \ |
| 7270 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7271 | 1 \ |
| 7272 | -s "Handshake protocol not within min/max boundaries" \ |
| 7273 | -S "Protocol is TLSv1.2" |
| 7274 | |
| 7275 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7276 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7277 | 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] | 7278 | "$P_SRV max_version=tls12" \ |
| 7279 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7280 | 1 \ |
| 7281 | -S "Handshake protocol not within min/max boundaries" \ |
| 7282 | -s "The handshake negotiation failed" \ |
| 7283 | -S "Protocol is TLSv1.3" |
| 7284 | |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7285 | # Tests of version negotiation on server side against OpenSSL client |
| 7286 | |
| 7287 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_2 |
| 7288 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7289 | 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] | 7290 | "$P_SRV" \ |
| 7291 | "$O_NEXT_CLI -tls1_2" \ |
| 7292 | 0 \ |
| 7293 | -S "mbedtls_ssl_handshake returned" \ |
| 7294 | -s "Protocol is TLSv1.2" |
| 7295 | |
| 7296 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7297 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7298 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7299 | 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] | 7300 | "$P_SRV max_version=tls12" \ |
| 7301 | "$O_NEXT_CLI -tls1_2" \ |
| 7302 | 0 \ |
| 7303 | -S "mbedtls_ssl_handshake returned" \ |
| 7304 | -s "Protocol is TLSv1.2" |
| 7305 | |
| 7306 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7307 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7308 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7309 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7310 | 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] | 7311 | "$P_SRV" \ |
| 7312 | "$O_NEXT_CLI -tls1_3" \ |
| 7313 | 0 \ |
| 7314 | -S "mbedtls_ssl_handshake returned" \ |
| 7315 | -s "Protocol is TLSv1.3" |
| 7316 | |
| 7317 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7318 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7319 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7320 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7321 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7322 | 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] | 7323 | "$P_SRV min_version=tls13" \ |
| 7324 | "$O_NEXT_CLI -tls1_3" \ |
| 7325 | 0 \ |
| 7326 | -S "mbedtls_ssl_handshake returned" \ |
| 7327 | -s "Protocol is TLSv1.3" |
| 7328 | |
| 7329 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7330 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7331 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7332 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7333 | 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] | 7334 | "$P_SRV" \ |
| 7335 | "$O_NEXT_CLI" \ |
| 7336 | 0 \ |
| 7337 | -S "mbedtls_ssl_handshake returned" \ |
| 7338 | -s "Protocol is TLSv1.3" |
| 7339 | |
| 7340 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7341 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7342 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7343 | 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] | 7344 | "$P_SRV" \ |
| 7345 | "$O_NEXT_CLI -no_middlebox" \ |
| 7346 | 0 \ |
| 7347 | -S "mbedtls_ssl_handshake returned" \ |
| 7348 | -s "Protocol is TLSv1.3" |
| 7349 | |
| 7350 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7351 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7352 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7353 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7354 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7355 | 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] | 7356 | "$P_SRV min_version=tls13" \ |
| 7357 | "$O_NEXT_CLI" \ |
| 7358 | 0 \ |
| 7359 | -S "mbedtls_ssl_handshake returned" \ |
| 7360 | -s "Protocol is TLSv1.3" |
| 7361 | |
| 7362 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7363 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7364 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7365 | 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] | 7366 | "$P_SRV" \ |
| 7367 | "$O_NEXT_CLI" \ |
| 7368 | 0 \ |
| 7369 | -S "mbedtls_ssl_handshake returned" \ |
| 7370 | -s "Protocol is TLSv1.2" |
| 7371 | |
| 7372 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7373 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7374 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7375 | 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] | 7376 | "$P_SRV max_version=tls12" \ |
| 7377 | "$O_NEXT_CLI" \ |
| 7378 | 0 \ |
| 7379 | -S "mbedtls_ssl_handshake returned" \ |
| 7380 | -s "Protocol is TLSv1.2" |
| 7381 | |
| 7382 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7383 | 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] | 7384 | "$P_SRV" \ |
| 7385 | "$O_CLI -tls1" \ |
| 7386 | 1 \ |
| 7387 | -s "Handshake protocol not within min/max boundaries" \ |
| 7388 | -S "Protocol is TLSv1.0" |
| 7389 | |
| 7390 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7391 | 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] | 7392 | "$P_SRV" \ |
| 7393 | "$O_CLI -tls1_1" \ |
| 7394 | 1 \ |
| 7395 | -s "Handshake protocol not within min/max boundaries" \ |
| 7396 | -S "Protocol is TLSv1.1" |
| 7397 | |
| 7398 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7399 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7400 | 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] | 7401 | "$P_SRV" \ |
| 7402 | "$O_NEXT_CLI -tls1_2" \ |
| 7403 | 1 \ |
| 7404 | -s "Handshake protocol not within min/max boundaries" \ |
| 7405 | -S "Protocol is TLSv1.2" |
| 7406 | |
| 7407 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7408 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7409 | 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] | 7410 | "$P_SRV" \ |
| 7411 | "$O_NEXT_CLI -tls1_3" \ |
| 7412 | 1 \ |
| 7413 | -S "Handshake protocol not within min/max boundaries" \ |
| 7414 | -s "The handshake negotiation failed" \ |
| 7415 | -S "Protocol is TLSv1.3" |
| 7416 | |
| 7417 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7418 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7419 | 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] | 7420 | "$P_SRV min_version=tls13" \ |
| 7421 | "$O_NEXT_CLI -tls1_2" \ |
| 7422 | 1 \ |
| 7423 | -s "Handshake protocol not within min/max boundaries" \ |
| 7424 | -S "Protocol is TLSv1.2" |
| 7425 | |
| 7426 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7427 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7428 | 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] | 7429 | "$P_SRV max_version=tls12" \ |
| 7430 | "$O_NEXT_CLI -tls1_3" \ |
| 7431 | 1 \ |
| 7432 | -S "Handshake protocol not within min/max boundaries" \ |
| 7433 | -s "The handshake negotiation failed" \ |
| 7434 | -S "Protocol is TLSv1.3" |
| 7435 | |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7436 | # Tests of version negotiation on client side against GnuTLS and OpenSSL server |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7437 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7438 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7439 | run_test "Not supported version: srv max TLS 1.0" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7440 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 7441 | "$P_CLI" \ |
| 7442 | 1 \ |
| 7443 | -s "Error in protocol version" \ |
| 7444 | -c "Handshake protocol not within min/max boundaries" \ |
| 7445 | -S "Version: TLS1.0" \ |
| 7446 | -C "Protocol is TLSv1.0" |
| 7447 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7448 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7449 | run_test "Not supported version: srv max TLS 1.1" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7450 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 7451 | "$P_CLI" \ |
| 7452 | 1 \ |
| 7453 | -s "Error in protocol version" \ |
| 7454 | -c "Handshake protocol not within min/max boundaries" \ |
| 7455 | -S "Version: TLS1.1" \ |
| 7456 | -C "Protocol is TLSv1.1" |
| 7457 | |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7458 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7459 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7460 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7461 | skip_handshake_stage_check |
| 7462 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7463 | 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] | 7464 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \ |
| 7465 | "$P_CLI debug_level=4" \ |
| 7466 | 1 \ |
| 7467 | -s "Client's version: 3.3" \ |
| 7468 | -S "Version: TLS1.0" \ |
| 7469 | -C "Protocol is TLSv1.0" |
| 7470 | |
| 7471 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7472 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7473 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7474 | skip_handshake_stage_check |
| 7475 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7476 | 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] | 7477 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \ |
| 7478 | "$P_CLI debug_level=4" \ |
| 7479 | 1 \ |
| 7480 | -s "Client's version: 3.3" \ |
| 7481 | -S "Version: TLS1.1" \ |
| 7482 | -C "Protocol is TLSv1.1" |
| 7483 | |
| 7484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7485 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7486 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7487 | skip_handshake_stage_check |
| 7488 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7489 | 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] | 7490 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \ |
| 7491 | "$P_CLI force_version=tls13 debug_level=4" \ |
| 7492 | 1 \ |
| 7493 | -s "Client's version: 3.3" \ |
| 7494 | -c "is a fatal alert message (msg 40)" \ |
| 7495 | -S "Version: TLS1.2" \ |
| 7496 | -C "Protocol is TLSv1.2" |
| 7497 | |
| 7498 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7499 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7500 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7501 | skip_handshake_stage_check |
| 7502 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7503 | 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] | 7504 | "$O_NEXT_SRV -msg -tls1" \ |
| 7505 | "$P_CLI debug_level=4" \ |
| 7506 | 1 \ |
| 7507 | -s "fatal protocol_version" \ |
| 7508 | -c "is a fatal alert message (msg 70)" \ |
| 7509 | -S "Version: TLS1.0" \ |
| 7510 | -C "Protocol : TLSv1.0" |
| 7511 | |
| 7512 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7513 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7514 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7515 | skip_handshake_stage_check |
| 7516 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7517 | 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] | 7518 | "$O_NEXT_SRV -msg -tls1_1" \ |
| 7519 | "$P_CLI debug_level=4" \ |
| 7520 | 1 \ |
| 7521 | -s "fatal protocol_version" \ |
| 7522 | -c "is a fatal alert message (msg 70)" \ |
| 7523 | -S "Version: TLS1.1" \ |
| 7524 | -C "Protocol : TLSv1.1" |
| 7525 | |
| 7526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7527 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7528 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7529 | skip_handshake_stage_check |
| 7530 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7531 | 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] | 7532 | "$O_NEXT_SRV -msg -tls1_2" \ |
| 7533 | "$P_CLI force_version=tls13 debug_level=4" \ |
| 7534 | 1 \ |
| 7535 | -s "fatal protocol_version" \ |
| 7536 | -c "is a fatal alert message (msg 70)" \ |
| 7537 | -S "Version: TLS1.2" \ |
| 7538 | -C "Protocol : TLSv1.2" |
| 7539 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7540 | # Tests for ALPN extension |
| 7541 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7542 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7543 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7544 | "$P_SRV debug_level=3" \ |
| 7545 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7546 | 0 \ |
| 7547 | -C "client hello, adding alpn extension" \ |
| 7548 | -S "found alpn extension" \ |
| 7549 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7550 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7551 | -C "found alpn extension " \ |
| 7552 | -C "Application Layer Protocol is" \ |
| 7553 | -S "Application Layer Protocol is" |
| 7554 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7555 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7556 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7557 | "$P_SRV debug_level=3" \ |
| 7558 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7559 | 0 \ |
| 7560 | -c "client hello, adding alpn extension" \ |
| 7561 | -s "found alpn extension" \ |
| 7562 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7563 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7564 | -C "found alpn extension " \ |
| 7565 | -c "Application Layer Protocol is (none)" \ |
| 7566 | -S "Application Layer Protocol is" |
| 7567 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7568 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7569 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7570 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7571 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7572 | 0 \ |
| 7573 | -C "client hello, adding alpn extension" \ |
| 7574 | -S "found alpn extension" \ |
| 7575 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7576 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7577 | -C "found alpn extension " \ |
| 7578 | -C "Application Layer Protocol is" \ |
| 7579 | -s "Application Layer Protocol is (none)" |
| 7580 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7581 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7582 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7583 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7584 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7585 | 0 \ |
| 7586 | -c "client hello, adding alpn extension" \ |
| 7587 | -s "found alpn extension" \ |
| 7588 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7589 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7590 | -c "found alpn extension" \ |
| 7591 | -c "Application Layer Protocol is abc" \ |
| 7592 | -s "Application Layer Protocol is abc" |
| 7593 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7594 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7595 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7596 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7597 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7598 | 0 \ |
| 7599 | -c "client hello, adding alpn extension" \ |
| 7600 | -s "found alpn extension" \ |
| 7601 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7602 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7603 | -c "found alpn extension" \ |
| 7604 | -c "Application Layer Protocol is abc" \ |
| 7605 | -s "Application Layer Protocol is abc" |
| 7606 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7607 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7608 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7609 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7610 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7611 | 0 \ |
| 7612 | -c "client hello, adding alpn extension" \ |
| 7613 | -s "found alpn extension" \ |
| 7614 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7615 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7616 | -c "found alpn extension" \ |
| 7617 | -c "Application Layer Protocol is 1234" \ |
| 7618 | -s "Application Layer Protocol is 1234" |
| 7619 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7620 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7621 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7622 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 7623 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7624 | 1 \ |
| 7625 | -c "client hello, adding alpn extension" \ |
| 7626 | -s "found alpn extension" \ |
| 7627 | -c "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7628 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7629 | -C "found alpn extension" \ |
| 7630 | -C "Application Layer Protocol is 1234" \ |
| 7631 | -S "Application Layer Protocol is 1234" |
| 7632 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 7633 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7634 | # Tests for keyUsage in leaf certificates, part 1: |
| 7635 | # server-side certificate/suite selection |
| 7636 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7637 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 7638 | "$P_SRV force_version=tls12 key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7639 | crt_file=data_files/server2.ku-ds.crt" \ |
| 7640 | "$P_CLI" \ |
| 7641 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 7642 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7643 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7644 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 7645 | "$P_SRV force_version=tls12 key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7646 | crt_file=data_files/server2.ku-ke.crt" \ |
| 7647 | "$P_CLI" \ |
| 7648 | 0 \ |
| 7649 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 7650 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7651 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 7652 | "$P_SRV force_version=tls12 key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7653 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 7654 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7655 | 1 \ |
| 7656 | -C "Ciphersuite is " |
| 7657 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 7658 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7659 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 7660 | "$P_SRV force_version=tls12 key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7661 | crt_file=data_files/server5.ku-ds.crt" \ |
| 7662 | "$P_CLI" \ |
| 7663 | 0 \ |
| 7664 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 7665 | |
| 7666 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7667 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 7668 | "$P_SRV force_version=tls12 key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7669 | crt_file=data_files/server5.ku-ka.crt" \ |
| 7670 | "$P_CLI" \ |
| 7671 | 0 \ |
| 7672 | -c "Ciphersuite is TLS-ECDH-" |
| 7673 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7674 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 7675 | "$P_SRV force_version=tls12 key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7676 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 7677 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7678 | 1 \ |
| 7679 | -C "Ciphersuite is " |
| 7680 | |
| 7681 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7682 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7683 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7684 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 7685 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7686 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7687 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7688 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7689 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7690 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7691 | -C "Processing of the Certificate handshake message failed" \ |
| 7692 | -c "Ciphersuite is TLS-" |
| 7693 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7694 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 7695 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7696 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7697 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7698 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7699 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7700 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7701 | -C "Processing of the Certificate handshake message failed" \ |
| 7702 | -c "Ciphersuite is TLS-" |
| 7703 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7704 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 7705 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7706 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7707 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7708 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7709 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7710 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7711 | -C "Processing of the Certificate handshake message failed" \ |
| 7712 | -c "Ciphersuite is TLS-" |
| 7713 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7714 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 7715 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7716 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7717 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7718 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7719 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7720 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7721 | -c "Processing of the Certificate handshake message failed" \ |
| 7722 | -C "Ciphersuite is TLS-" |
| 7723 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7724 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 7725 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7726 | -cert data_files/server2.ku-ke.crt" \ |
| 7727 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 7728 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7729 | 0 \ |
| 7730 | -c "bad certificate (usage extensions)" \ |
| 7731 | -C "Processing of the Certificate handshake message failed" \ |
| 7732 | -c "Ciphersuite is TLS-" \ |
| 7733 | -c "! Usage does not match the keyUsage extension" |
| 7734 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7735 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 7736 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7737 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7738 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7739 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7740 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7741 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7742 | -C "Processing of the Certificate handshake message failed" \ |
| 7743 | -c "Ciphersuite is TLS-" |
| 7744 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7745 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 7746 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7747 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7748 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7749 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7750 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7751 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7752 | -c "Processing of the Certificate handshake message failed" \ |
| 7753 | -C "Ciphersuite is TLS-" |
| 7754 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7755 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 7756 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7757 | -cert data_files/server2.ku-ds.crt" \ |
| 7758 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 7759 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7760 | 0 \ |
| 7761 | -c "bad certificate (usage extensions)" \ |
| 7762 | -C "Processing of the Certificate handshake message failed" \ |
| 7763 | -c "Ciphersuite is TLS-" \ |
| 7764 | -c "! Usage does not match the keyUsage extension" |
| 7765 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7766 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7767 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7768 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7769 | run_test "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ |
| 7770 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
Ronald Cron | b3cdd4b | 2024-03-27 14:16:40 +0100 | [diff] [blame] | 7771 | -cert data_files/server2-sha256.ku-ds_ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7772 | "$P_CLI debug_level=3" \ |
| 7773 | 0 \ |
| 7774 | -C "bad certificate (usage extensions)" \ |
| 7775 | -C "Processing of the Certificate handshake message failed" \ |
| 7776 | -c "Ciphersuite is" |
| 7777 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7778 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7779 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7780 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 7781 | run_test "keyUsage cli 1.3: KeyEncipherment, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7782 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
Ronald Cron | b3cdd4b | 2024-03-27 14:16:40 +0100 | [diff] [blame] | 7783 | -cert data_files/server2-sha256.ku-ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7784 | "$P_CLI debug_level=1" \ |
| 7785 | 1 \ |
| 7786 | -c "bad certificate (usage extensions)" \ |
| 7787 | -c "Processing of the Certificate handshake message failed" \ |
| 7788 | -C "Ciphersuite is" |
| 7789 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7790 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7791 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7792 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 7793 | run_test "keyUsage cli 1.3: KeyAgreement, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7794 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
Ronald Cron | b3cdd4b | 2024-03-27 14:16:40 +0100 | [diff] [blame] | 7795 | -cert data_files/server2-sha256.ku-ka.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7796 | "$P_CLI debug_level=1" \ |
| 7797 | 1 \ |
| 7798 | -c "bad certificate (usage extensions)" \ |
| 7799 | -c "Processing of the Certificate handshake message failed" \ |
| 7800 | -C "Ciphersuite is" |
| 7801 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7802 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7803 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7804 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7805 | run_test "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ |
| 7806 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 7807 | -cert data_files/server5.ku-ds.crt" \ |
| 7808 | "$P_CLI debug_level=3" \ |
| 7809 | 0 \ |
| 7810 | -C "bad certificate (usage extensions)" \ |
| 7811 | -C "Processing of the Certificate handshake message failed" \ |
| 7812 | -c "Ciphersuite is" |
| 7813 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7814 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7815 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7816 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 7817 | run_test "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7818 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 7819 | -cert data_files/server5.ku-ke.crt" \ |
| 7820 | "$P_CLI debug_level=1" \ |
| 7821 | 1 \ |
| 7822 | -c "bad certificate (usage extensions)" \ |
| 7823 | -c "Processing of the Certificate handshake message failed" \ |
| 7824 | -C "Ciphersuite is" |
| 7825 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7826 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7827 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7828 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 7829 | run_test "keyUsage cli 1.3: KeyAgreement, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7830 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 7831 | -cert data_files/server5.ku-ka.crt" \ |
| 7832 | "$P_CLI debug_level=1" \ |
| 7833 | 1 \ |
| 7834 | -c "bad certificate (usage extensions)" \ |
| 7835 | -c "Processing of the Certificate handshake message failed" \ |
| 7836 | -C "Ciphersuite is" |
| 7837 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7838 | # Tests for keyUsage in leaf certificates, part 3: |
| 7839 | # server-side checking of client cert |
| 7840 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7841 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7842 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7843 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Gilles Peskine | 5194ff8 | 2024-05-13 21:17:35 +0200 | [diff] [blame] | 7844 | "$O_CLI -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7845 | -cert data_files/server2.ku-ds.crt" \ |
| 7846 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 7847 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7848 | -S "bad certificate (usage extensions)" \ |
| 7849 | -S "Processing of the Certificate handshake message failed" |
| 7850 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7851 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7852 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7853 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Gilles Peskine | 5194ff8 | 2024-05-13 21:17:35 +0200 | [diff] [blame] | 7854 | "$O_CLI -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7855 | -cert data_files/server2.ku-ke.crt" \ |
| 7856 | 0 \ |
| 7857 | -s "bad certificate (usage extensions)" \ |
| 7858 | -S "Processing of the Certificate handshake message failed" |
| 7859 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7860 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7861 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 7862 | "$P_SRV debug_level=1 force_version=tls12 auth_mode=required" \ |
Gilles Peskine | 5194ff8 | 2024-05-13 21:17:35 +0200 | [diff] [blame] | 7863 | "$O_CLI -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7864 | -cert data_files/server2.ku-ke.crt" \ |
| 7865 | 1 \ |
| 7866 | -s "bad certificate (usage extensions)" \ |
| 7867 | -s "Processing of the Certificate handshake message failed" |
| 7868 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7869 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7870 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7871 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Gilles Peskine | 5194ff8 | 2024-05-13 21:17:35 +0200 | [diff] [blame] | 7872 | "$O_CLI -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7873 | -cert data_files/server5.ku-ds.crt" \ |
| 7874 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 7875 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7876 | -S "bad certificate (usage extensions)" \ |
| 7877 | -S "Processing of the Certificate handshake message failed" |
| 7878 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7879 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7880 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7881 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Gilles Peskine | 5194ff8 | 2024-05-13 21:17:35 +0200 | [diff] [blame] | 7882 | "$O_CLI -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7883 | -cert data_files/server5.ku-ka.crt" \ |
| 7884 | 0 \ |
| 7885 | -s "bad certificate (usage extensions)" \ |
| 7886 | -S "Processing of the Certificate handshake message failed" |
| 7887 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7888 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7889 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7890 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7891 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7892 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7893 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
Ronald Cron | b3cdd4b | 2024-03-27 14:16:40 +0100 | [diff] [blame] | 7894 | -cert data_files/server2-sha256.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7895 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 7896 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7897 | -S "bad certificate (usage extensions)" \ |
| 7898 | -S "Processing of the Certificate handshake message failed" |
| 7899 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7900 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7901 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7902 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7903 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7904 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7905 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
Ronald Cron | b3cdd4b | 2024-03-27 14:16:40 +0100 | [diff] [blame] | 7906 | -cert data_files/server2-sha256.ku-ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7907 | 0 \ |
| 7908 | -s "bad certificate (usage extensions)" \ |
| 7909 | -S "Processing of the Certificate handshake message failed" |
| 7910 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7911 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7912 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7913 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7914 | run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7915 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7916 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7917 | -cert data_files/server5.ku-ds.crt" \ |
| 7918 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 7919 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7920 | -S "bad certificate (usage extensions)" \ |
| 7921 | -S "Processing of the Certificate handshake message failed" |
| 7922 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7923 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7924 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7925 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7926 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7927 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7928 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7929 | -cert data_files/server5.ku-ka.crt" \ |
| 7930 | 0 \ |
| 7931 | -s "bad certificate (usage extensions)" \ |
| 7932 | -S "Processing of the Certificate handshake message failed" |
| 7933 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7934 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 7935 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7936 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7937 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7938 | "$P_SRV key_file=data_files/server5.key \ |
| 7939 | crt_file=data_files/server5.eku-srv.crt" \ |
| 7940 | "$P_CLI" \ |
| 7941 | 0 |
| 7942 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7943 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7944 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7945 | "$P_SRV key_file=data_files/server5.key \ |
| 7946 | crt_file=data_files/server5.eku-srv.crt" \ |
| 7947 | "$P_CLI" \ |
| 7948 | 0 |
| 7949 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7950 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7951 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7952 | "$P_SRV key_file=data_files/server5.key \ |
| 7953 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 7954 | "$P_CLI" \ |
| 7955 | 0 |
| 7956 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7957 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7958 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 7959 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7960 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 7961 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7962 | 1 |
| 7963 | |
| 7964 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 7965 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7966 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7967 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 7968 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7969 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7970 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7971 | 0 \ |
| 7972 | -C "bad certificate (usage extensions)" \ |
| 7973 | -C "Processing of the Certificate handshake message failed" \ |
| 7974 | -c "Ciphersuite is TLS-" |
| 7975 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7976 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7977 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 7978 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7979 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7980 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7981 | 0 \ |
| 7982 | -C "bad certificate (usage extensions)" \ |
| 7983 | -C "Processing of the Certificate handshake message failed" \ |
| 7984 | -c "Ciphersuite is TLS-" |
| 7985 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7986 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7987 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 7988 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7989 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7990 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7991 | 0 \ |
| 7992 | -C "bad certificate (usage extensions)" \ |
| 7993 | -C "Processing of the Certificate handshake message failed" \ |
| 7994 | -c "Ciphersuite is TLS-" |
| 7995 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7996 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7997 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 7998 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7999 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8000 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8001 | 1 \ |
| 8002 | -c "bad certificate (usage extensions)" \ |
| 8003 | -c "Processing of the Certificate handshake message failed" \ |
| 8004 | -C "Ciphersuite is TLS-" |
| 8005 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8006 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8007 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8008 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8009 | run_test "extKeyUsage cli 1.3: serverAuth -> OK" \ |
| 8010 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 8011 | -cert data_files/server5.eku-srv.crt" \ |
| 8012 | "$P_CLI debug_level=1" \ |
| 8013 | 0 \ |
| 8014 | -C "bad certificate (usage extensions)" \ |
| 8015 | -C "Processing of the Certificate handshake message failed" \ |
| 8016 | -c "Ciphersuite is" |
| 8017 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8018 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8019 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8020 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8021 | run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ |
| 8022 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 8023 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 8024 | "$P_CLI debug_level=1" \ |
| 8025 | 0 \ |
| 8026 | -C "bad certificate (usage extensions)" \ |
| 8027 | -C "Processing of the Certificate handshake message failed" \ |
| 8028 | -c "Ciphersuite is" |
| 8029 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8030 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8031 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8032 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8033 | run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ |
| 8034 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 8035 | -cert data_files/server5.eku-cs_any.crt" \ |
| 8036 | "$P_CLI debug_level=1" \ |
| 8037 | 0 \ |
| 8038 | -C "bad certificate (usage extensions)" \ |
| 8039 | -C "Processing of the Certificate handshake message failed" \ |
| 8040 | -c "Ciphersuite is" |
| 8041 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8042 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8043 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8044 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8045 | run_test "extKeyUsage cli 1.3: codeSign -> fail" \ |
| 8046 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 8047 | -cert data_files/server5.eku-cs.crt" \ |
| 8048 | "$P_CLI debug_level=1" \ |
| 8049 | 1 \ |
| 8050 | -c "bad certificate (usage extensions)" \ |
| 8051 | -c "Processing of the Certificate handshake message failed" \ |
| 8052 | -C "Ciphersuite is" |
| 8053 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8054 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 8055 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8056 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8057 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8058 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Gilles Peskine | 5194ff8 | 2024-05-13 21:17:35 +0200 | [diff] [blame] | 8059 | "$O_CLI -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8060 | -cert data_files/server5.eku-cli.crt" \ |
| 8061 | 0 \ |
| 8062 | -S "bad certificate (usage extensions)" \ |
| 8063 | -S "Processing of the Certificate handshake message failed" |
| 8064 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8065 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8066 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8067 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Gilles Peskine | 5194ff8 | 2024-05-13 21:17:35 +0200 | [diff] [blame] | 8068 | "$O_CLI -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8069 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 8070 | 0 \ |
| 8071 | -S "bad certificate (usage extensions)" \ |
| 8072 | -S "Processing of the Certificate handshake message failed" |
| 8073 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8074 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8075 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8076 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Gilles Peskine | 5194ff8 | 2024-05-13 21:17:35 +0200 | [diff] [blame] | 8077 | "$O_CLI -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8078 | -cert data_files/server5.eku-cs_any.crt" \ |
| 8079 | 0 \ |
| 8080 | -S "bad certificate (usage extensions)" \ |
| 8081 | -S "Processing of the Certificate handshake message failed" |
| 8082 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8083 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8084 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8085 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Gilles Peskine | 5194ff8 | 2024-05-13 21:17:35 +0200 | [diff] [blame] | 8086 | "$O_CLI -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8087 | -cert data_files/server5.eku-cs.crt" \ |
| 8088 | 0 \ |
| 8089 | -s "bad certificate (usage extensions)" \ |
| 8090 | -S "Processing of the Certificate handshake message failed" |
| 8091 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8092 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8093 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Gilles Peskine | 5194ff8 | 2024-05-13 21:17:35 +0200 | [diff] [blame] | 8094 | "$P_SRV debug_level=1 auth_mode=required" \ |
| 8095 | "$O_CLI -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8096 | -cert data_files/server5.eku-cs.crt" \ |
| 8097 | 1 \ |
| 8098 | -s "bad certificate (usage extensions)" \ |
| 8099 | -s "Processing of the Certificate handshake message failed" |
| 8100 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8101 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8102 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8103 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8104 | run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8105 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8106 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 8107 | -cert data_files/server5.eku-cli.crt" \ |
| 8108 | 0 \ |
| 8109 | -S "bad certificate (usage extensions)" \ |
| 8110 | -S "Processing of the Certificate handshake message failed" |
| 8111 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8112 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8113 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8114 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8115 | run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8116 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8117 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 8118 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 8119 | 0 \ |
| 8120 | -S "bad certificate (usage extensions)" \ |
| 8121 | -S "Processing of the Certificate handshake message failed" |
| 8122 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8123 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8124 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8125 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8126 | run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8127 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8128 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 8129 | -cert data_files/server5.eku-cs_any.crt" \ |
| 8130 | 0 \ |
| 8131 | -S "bad certificate (usage extensions)" \ |
| 8132 | -S "Processing of the Certificate handshake message failed" |
| 8133 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8134 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8135 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8136 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8137 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8138 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8139 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 8140 | -cert data_files/server5.eku-cs.crt" \ |
| 8141 | 0 \ |
| 8142 | -s "bad certificate (usage extensions)" \ |
| 8143 | -S "Processing of the Certificate handshake message failed" |
| 8144 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8145 | # Tests for DHM parameters loading |
| 8146 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8147 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8148 | "$P_SRV" \ |
| 8149 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8150 | debug_level=3" \ |
| 8151 | 0 \ |
| 8152 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 8153 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8154 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8155 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8156 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 8157 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8158 | debug_level=3" \ |
| 8159 | 0 \ |
| 8160 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 8161 | -c "value of 'DHM: G ' (2 bits)" |
| 8162 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8163 | # Tests for DHM client-side size checking |
| 8164 | |
| 8165 | run_test "DHM size: server default, client default, OK" \ |
| 8166 | "$P_SRV" \ |
| 8167 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8168 | debug_level=1" \ |
| 8169 | 0 \ |
| 8170 | -C "DHM prime too short:" |
| 8171 | |
| 8172 | run_test "DHM size: server default, client 2048, OK" \ |
| 8173 | "$P_SRV" \ |
| 8174 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8175 | debug_level=1 dhmlen=2048" \ |
| 8176 | 0 \ |
| 8177 | -C "DHM prime too short:" |
| 8178 | |
| 8179 | run_test "DHM size: server 1024, client default, OK" \ |
| 8180 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 8181 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8182 | debug_level=1" \ |
| 8183 | 0 \ |
| 8184 | -C "DHM prime too short:" |
| 8185 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8186 | run_test "DHM size: server 999, client 999, OK" \ |
| 8187 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 8188 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8189 | debug_level=1 dhmlen=999" \ |
| 8190 | 0 \ |
| 8191 | -C "DHM prime too short:" |
| 8192 | |
| 8193 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 8194 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 8195 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8196 | debug_level=1 dhmlen=1000" \ |
| 8197 | 0 \ |
| 8198 | -C "DHM prime too short:" |
| 8199 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8200 | run_test "DHM size: server 1000, client default, rejected" \ |
| 8201 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 8202 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8203 | debug_level=1" \ |
| 8204 | 1 \ |
| 8205 | -c "DHM prime too short:" |
| 8206 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8207 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 8208 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 8209 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8210 | debug_level=1 dhmlen=1001" \ |
| 8211 | 1 \ |
| 8212 | -c "DHM prime too short:" |
| 8213 | |
| 8214 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 8215 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 8216 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8217 | debug_level=1 dhmlen=1000" \ |
| 8218 | 1 \ |
| 8219 | -c "DHM prime too short:" |
| 8220 | |
| 8221 | run_test "DHM size: server 998, client 999, rejected" \ |
| 8222 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 8223 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8224 | debug_level=1 dhmlen=999" \ |
| 8225 | 1 \ |
| 8226 | -c "DHM prime too short:" |
| 8227 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8228 | run_test "DHM size: server default, client 2049, rejected" \ |
| 8229 | "$P_SRV" \ |
| 8230 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8231 | debug_level=1 dhmlen=2049" \ |
| 8232 | 1 \ |
| 8233 | -c "DHM prime too short:" |
| 8234 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8235 | # Tests for PSK callback |
| 8236 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8237 | run_test "PSK callback: psk, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8238 | "$P_SRV psk=73776f726466697368 psk_identity=foo" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8239 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8240 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8241 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8242 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 8243 | -S "SSL - Unknown identity received" \ |
| 8244 | -S "SSL - Verification of the message MAC failed" |
| 8245 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8246 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8247 | run_test "PSK callback: opaque psk on client, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8248 | "$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] | 8249 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8250 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8251 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8252 | -C "session hash for extended master secret"\ |
| 8253 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8254 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8255 | -S "SSL - Unknown identity received" \ |
| 8256 | -S "SSL - Verification of the message MAC failed" |
| 8257 | |
| 8258 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8259 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8260 | "$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] | 8261 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8262 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8263 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8264 | -C "session hash for extended master secret"\ |
| 8265 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8266 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8267 | -S "SSL - Unknown identity received" \ |
| 8268 | -S "SSL - Verification of the message MAC failed" |
| 8269 | |
| 8270 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8271 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8272 | "$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] | 8273 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8274 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8275 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8276 | -c "session hash for extended master secret"\ |
| 8277 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8278 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8279 | -S "SSL - Unknown identity received" \ |
| 8280 | -S "SSL - Verification of the message MAC failed" |
| 8281 | |
| 8282 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8283 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8284 | "$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] | 8285 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8286 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8287 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8288 | -c "session hash for extended master secret"\ |
| 8289 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8290 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8291 | -S "SSL - Unknown identity received" \ |
| 8292 | -S "SSL - Verification of the message MAC failed" |
| 8293 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8294 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8295 | run_test "PSK callback: opaque rsa-psk on client, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8296 | "$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] | 8297 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8298 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8299 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8300 | -C "session hash for extended master secret"\ |
| 8301 | -S "session hash for extended master secret"\ |
| 8302 | -S "SSL - The handshake negotiation failed" \ |
| 8303 | -S "SSL - Unknown identity received" \ |
| 8304 | -S "SSL - Verification of the message MAC failed" |
| 8305 | |
| 8306 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8307 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8308 | "$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] | 8309 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8310 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8311 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8312 | -C "session hash for extended master secret"\ |
| 8313 | -S "session hash for extended master secret"\ |
| 8314 | -S "SSL - The handshake negotiation failed" \ |
| 8315 | -S "SSL - Unknown identity received" \ |
| 8316 | -S "SSL - Verification of the message MAC failed" |
| 8317 | |
| 8318 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8319 | run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8320 | "$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] | 8321 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8322 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8323 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8324 | -c "session hash for extended master secret"\ |
| 8325 | -s "session hash for extended master secret"\ |
| 8326 | -S "SSL - The handshake negotiation failed" \ |
| 8327 | -S "SSL - Unknown identity received" \ |
| 8328 | -S "SSL - Verification of the message MAC failed" |
| 8329 | |
| 8330 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8331 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8332 | "$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] | 8333 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8334 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8335 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8336 | -c "session hash for extended master secret"\ |
| 8337 | -s "session hash for extended master secret"\ |
| 8338 | -S "SSL - The handshake negotiation failed" \ |
| 8339 | -S "SSL - Unknown identity received" \ |
| 8340 | -S "SSL - Verification of the message MAC failed" |
| 8341 | |
| 8342 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8343 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8344 | "$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] | 8345 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8346 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8347 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8348 | -C "session hash for extended master secret"\ |
| 8349 | -S "session hash for extended master secret"\ |
| 8350 | -S "SSL - The handshake negotiation failed" \ |
| 8351 | -S "SSL - Unknown identity received" \ |
| 8352 | -S "SSL - Verification of the message MAC failed" |
| 8353 | |
| 8354 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8355 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8356 | "$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] | 8357 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8358 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8359 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8360 | -C "session hash for extended master secret"\ |
| 8361 | -S "session hash for extended master secret"\ |
| 8362 | -S "SSL - The handshake negotiation failed" \ |
| 8363 | -S "SSL - Unknown identity received" \ |
| 8364 | -S "SSL - Verification of the message MAC failed" |
| 8365 | |
| 8366 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8367 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8368 | "$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] | 8369 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8370 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8371 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8372 | -c "session hash for extended master secret"\ |
| 8373 | -s "session hash for extended master secret"\ |
| 8374 | -S "SSL - The handshake negotiation failed" \ |
| 8375 | -S "SSL - Unknown identity received" \ |
| 8376 | -S "SSL - Verification of the message MAC failed" |
| 8377 | |
| 8378 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8379 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8380 | "$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] | 8381 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8382 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8383 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8384 | -c "session hash for extended master secret"\ |
| 8385 | -s "session hash for extended master secret"\ |
| 8386 | -S "SSL - The handshake negotiation failed" \ |
| 8387 | -S "SSL - Unknown identity received" \ |
| 8388 | -S "SSL - Verification of the message MAC failed" |
| 8389 | |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8390 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8391 | run_test "PSK callback: opaque dhe-psk on client, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8392 | "$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] | 8393 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA256 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8394 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8395 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8396 | -C "session hash for extended master secret"\ |
| 8397 | -S "session hash for extended master secret"\ |
| 8398 | -S "SSL - The handshake negotiation failed" \ |
| 8399 | -S "SSL - Unknown identity received" \ |
| 8400 | -S "SSL - Verification of the message MAC failed" |
| 8401 | |
| 8402 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8403 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8404 | "$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] | 8405 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8406 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8407 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8408 | -C "session hash for extended master secret"\ |
| 8409 | -S "session hash for extended master secret"\ |
| 8410 | -S "SSL - The handshake negotiation failed" \ |
| 8411 | -S "SSL - Unknown identity received" \ |
| 8412 | -S "SSL - Verification of the message MAC failed" |
| 8413 | |
| 8414 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8415 | run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8416 | "$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] | 8417 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8418 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8419 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8420 | -c "session hash for extended master secret"\ |
| 8421 | -s "session hash for extended master secret"\ |
| 8422 | -S "SSL - The handshake negotiation failed" \ |
| 8423 | -S "SSL - Unknown identity received" \ |
| 8424 | -S "SSL - Verification of the message MAC failed" |
| 8425 | |
| 8426 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8427 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8428 | "$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] | 8429 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8430 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8431 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8432 | -c "session hash for extended master secret"\ |
| 8433 | -s "session hash for extended master secret"\ |
| 8434 | -S "SSL - The handshake negotiation failed" \ |
| 8435 | -S "SSL - Unknown identity received" \ |
| 8436 | -S "SSL - Verification of the message MAC failed" |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8437 | |
| 8438 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8439 | run_test "PSK callback: raw psk on client, static opaque on server, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8440 | "$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] | 8441 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8442 | psk_identity=foo psk=73776f726466697368" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8443 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8444 | -C "session hash for extended master secret"\ |
| 8445 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8446 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8447 | -S "SSL - Unknown identity received" \ |
| 8448 | -S "SSL - Verification of the message MAC failed" |
| 8449 | |
| 8450 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8451 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8452 | "$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] | 8453 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8454 | psk_identity=foo psk=73776f726466697368" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8455 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8456 | -C "session hash for extended master secret"\ |
| 8457 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8458 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8459 | -S "SSL - Unknown identity received" \ |
| 8460 | -S "SSL - Verification of the message MAC failed" |
| 8461 | |
| 8462 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8463 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8464 | "$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] | 8465 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8466 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8467 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8468 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8469 | -c "session hash for extended master secret"\ |
| 8470 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8471 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8472 | -S "SSL - Unknown identity received" \ |
| 8473 | -S "SSL - Verification of the message MAC failed" |
| 8474 | |
| 8475 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8476 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8477 | "$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] | 8478 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8479 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8480 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8481 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8482 | -c "session hash for extended master secret"\ |
| 8483 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8484 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8485 | -S "SSL - Unknown identity received" \ |
| 8486 | -S "SSL - Verification of the message MAC failed" |
| 8487 | |
| 8488 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8489 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8490 | "$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] | 8491 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8492 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8493 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8494 | -C "session hash for extended master secret"\ |
| 8495 | -S "session hash for extended master secret"\ |
| 8496 | -S "SSL - The handshake negotiation failed" \ |
| 8497 | -S "SSL - Unknown identity received" \ |
| 8498 | -S "SSL - Verification of the message MAC failed" |
| 8499 | |
| 8500 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8501 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8502 | "$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] | 8503 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8504 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8505 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8506 | -C "session hash for extended master secret"\ |
| 8507 | -S "session hash for extended master secret"\ |
| 8508 | -S "SSL - The handshake negotiation failed" \ |
| 8509 | -S "SSL - Unknown identity received" \ |
| 8510 | -S "SSL - Verification of the message MAC failed" |
| 8511 | |
| 8512 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8513 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8514 | "$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] | 8515 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8516 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8517 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8518 | 0 \ |
| 8519 | -c "session hash for extended master secret"\ |
| 8520 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8521 | -S "SSL - The handshake negotiation failed" \ |
| 8522 | -S "SSL - Unknown identity received" \ |
| 8523 | -S "SSL - Verification of the message MAC failed" |
| 8524 | |
| 8525 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8526 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8527 | "$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] | 8528 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8529 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8530 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8531 | 0 \ |
| 8532 | -c "session hash for extended master secret"\ |
| 8533 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8534 | -S "SSL - The handshake negotiation failed" \ |
| 8535 | -S "SSL - Unknown identity received" \ |
| 8536 | -S "SSL - Verification of the message MAC failed" |
| 8537 | |
| 8538 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8539 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8540 | "$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] | 8541 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8542 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8543 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8544 | -C "session hash for extended master secret"\ |
| 8545 | -S "session hash for extended master secret"\ |
| 8546 | -S "SSL - The handshake negotiation failed" \ |
| 8547 | -S "SSL - Unknown identity received" \ |
| 8548 | -S "SSL - Verification of the message MAC failed" |
| 8549 | |
| 8550 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8551 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8552 | "$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] | 8553 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8554 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8555 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8556 | -C "session hash for extended master secret"\ |
| 8557 | -S "session hash for extended master secret"\ |
| 8558 | -S "SSL - The handshake negotiation failed" \ |
| 8559 | -S "SSL - Unknown identity received" \ |
| 8560 | -S "SSL - Verification of the message MAC failed" |
| 8561 | |
| 8562 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8563 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8564 | "$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] | 8565 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8566 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8567 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8568 | 0 \ |
| 8569 | -c "session hash for extended master secret"\ |
| 8570 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8571 | -S "SSL - The handshake negotiation failed" \ |
| 8572 | -S "SSL - Unknown identity received" \ |
| 8573 | -S "SSL - Verification of the message MAC failed" |
| 8574 | |
| 8575 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8576 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8577 | "$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] | 8578 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8579 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8580 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8581 | 0 \ |
| 8582 | -c "session hash for extended master secret"\ |
| 8583 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8584 | -S "SSL - The handshake negotiation failed" \ |
| 8585 | -S "SSL - Unknown identity received" \ |
| 8586 | -S "SSL - Verification of the message MAC failed" |
| 8587 | |
| 8588 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8589 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8590 | "$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] | 8591 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8592 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8593 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8594 | -C "session hash for extended master secret"\ |
| 8595 | -S "session hash for extended master secret"\ |
| 8596 | -S "SSL - The handshake negotiation failed" \ |
| 8597 | -S "SSL - Unknown identity received" \ |
| 8598 | -S "SSL - Verification of the message MAC failed" |
| 8599 | |
| 8600 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8601 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8602 | "$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] | 8603 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8604 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8605 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8606 | -C "session hash for extended master secret"\ |
| 8607 | -S "session hash for extended master secret"\ |
| 8608 | -S "SSL - The handshake negotiation failed" \ |
| 8609 | -S "SSL - Unknown identity received" \ |
| 8610 | -S "SSL - Verification of the message MAC failed" |
| 8611 | |
| 8612 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8613 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8614 | "$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] | 8615 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8616 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8617 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8618 | 0 \ |
| 8619 | -c "session hash for extended master secret"\ |
| 8620 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8621 | -S "SSL - The handshake negotiation failed" \ |
| 8622 | -S "SSL - Unknown identity received" \ |
| 8623 | -S "SSL - Verification of the message MAC failed" |
| 8624 | |
| 8625 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8626 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8627 | "$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] | 8628 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8629 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8630 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8631 | 0 \ |
| 8632 | -c "session hash for extended master secret"\ |
| 8633 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8634 | -S "SSL - The handshake negotiation failed" \ |
| 8635 | -S "SSL - Unknown identity received" \ |
| 8636 | -S "SSL - Verification of the message MAC failed" |
| 8637 | |
| 8638 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8639 | 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] | 8640 | "$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" \ |
| 8641 | "$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] | 8642 | psk_identity=def psk=beef" \ |
| 8643 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8644 | -C "session hash for extended master secret"\ |
| 8645 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8646 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8647 | -S "SSL - Unknown identity received" \ |
| 8648 | -S "SSL - Verification of the message MAC failed" |
| 8649 | |
| 8650 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8651 | 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] | 8652 | "$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" \ |
| 8653 | "$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] | 8654 | psk_identity=def psk=beef" \ |
| 8655 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8656 | -C "session hash for extended master secret"\ |
| 8657 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8658 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8659 | -S "SSL - Unknown identity received" \ |
| 8660 | -S "SSL - Verification of the message MAC failed" |
| 8661 | |
| 8662 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8663 | 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] | 8664 | "$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] | 8665 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8666 | "$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] | 8667 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8668 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8669 | -c "session hash for extended master secret"\ |
| 8670 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8671 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8672 | -S "SSL - Unknown identity received" \ |
| 8673 | -S "SSL - Verification of the message MAC failed" |
| 8674 | |
| 8675 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8676 | 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] | 8677 | "$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] | 8678 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8679 | "$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] | 8680 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8681 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8682 | -c "session hash for extended master secret"\ |
| 8683 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8684 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8685 | -S "SSL - Unknown identity received" \ |
| 8686 | -S "SSL - Verification of the message MAC failed" |
| 8687 | |
| 8688 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8689 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ |
| 8690 | "$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" \ |
| 8691 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 8692 | psk_identity=def psk=beef" \ |
| 8693 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8694 | -C "session hash for extended master secret"\ |
| 8695 | -S "session hash for extended master secret"\ |
| 8696 | -S "SSL - The handshake negotiation failed" \ |
| 8697 | -S "SSL - Unknown identity received" \ |
| 8698 | -S "SSL - Verification of the message MAC failed" |
| 8699 | |
| 8700 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8701 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ |
| 8702 | "$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" \ |
| 8703 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 8704 | psk_identity=def psk=beef" \ |
| 8705 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8706 | -C "session hash for extended master secret"\ |
| 8707 | -S "session hash for extended master secret"\ |
| 8708 | -S "SSL - The handshake negotiation failed" \ |
| 8709 | -S "SSL - Unknown identity received" \ |
| 8710 | -S "SSL - Verification of the message MAC failed" |
| 8711 | |
| 8712 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8713 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ |
| 8714 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 8715 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8716 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 8717 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8718 | 0 \ |
| 8719 | -c "session hash for extended master secret"\ |
| 8720 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8721 | -S "SSL - The handshake negotiation failed" \ |
| 8722 | -S "SSL - Unknown identity received" \ |
| 8723 | -S "SSL - Verification of the message MAC failed" |
| 8724 | |
| 8725 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8726 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \ |
| 8727 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 8728 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8729 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 8730 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8731 | 0 \ |
| 8732 | -c "session hash for extended master secret"\ |
| 8733 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8734 | -S "SSL - The handshake negotiation failed" \ |
| 8735 | -S "SSL - Unknown identity received" \ |
| 8736 | -S "SSL - Verification of the message MAC failed" |
| 8737 | |
| 8738 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8739 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 8740 | "$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" \ |
| 8741 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 8742 | psk_identity=def psk=beef" \ |
| 8743 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8744 | -C "session hash for extended master secret"\ |
| 8745 | -S "session hash for extended master secret"\ |
| 8746 | -S "SSL - The handshake negotiation failed" \ |
| 8747 | -S "SSL - Unknown identity received" \ |
| 8748 | -S "SSL - Verification of the message MAC failed" |
| 8749 | |
| 8750 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8751 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 8752 | "$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" \ |
| 8753 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 8754 | psk_identity=def psk=beef" \ |
| 8755 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8756 | -C "session hash for extended master secret"\ |
| 8757 | -S "session hash for extended master secret"\ |
| 8758 | -S "SSL - The handshake negotiation failed" \ |
| 8759 | -S "SSL - Unknown identity received" \ |
| 8760 | -S "SSL - Verification of the message MAC failed" |
| 8761 | |
| 8762 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8763 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 8764 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 8765 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8766 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 8767 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8768 | 0 \ |
| 8769 | -c "session hash for extended master secret"\ |
| 8770 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8771 | -S "SSL - The handshake negotiation failed" \ |
| 8772 | -S "SSL - Unknown identity received" \ |
| 8773 | -S "SSL - Verification of the message MAC failed" |
| 8774 | |
| 8775 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8776 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 8777 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 8778 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8779 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 8780 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8781 | 0 \ |
| 8782 | -c "session hash for extended master secret"\ |
| 8783 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8784 | -S "SSL - The handshake negotiation failed" \ |
| 8785 | -S "SSL - Unknown identity received" \ |
| 8786 | -S "SSL - Verification of the message MAC failed" |
| 8787 | |
| 8788 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8789 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ |
| 8790 | "$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" \ |
| 8791 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 8792 | psk_identity=def psk=beef" \ |
| 8793 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8794 | -C "session hash for extended master secret"\ |
| 8795 | -S "session hash for extended master secret"\ |
| 8796 | -S "SSL - The handshake negotiation failed" \ |
| 8797 | -S "SSL - Unknown identity received" \ |
| 8798 | -S "SSL - Verification of the message MAC failed" |
| 8799 | |
| 8800 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8801 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ |
| 8802 | "$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" \ |
| 8803 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 8804 | psk_identity=def psk=beef" \ |
| 8805 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8806 | -C "session hash for extended master secret"\ |
| 8807 | -S "session hash for extended master secret"\ |
| 8808 | -S "SSL - The handshake negotiation failed" \ |
| 8809 | -S "SSL - Unknown identity received" \ |
| 8810 | -S "SSL - Verification of the message MAC failed" |
| 8811 | |
| 8812 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8813 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \ |
| 8814 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 8815 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8816 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 8817 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8818 | 0 \ |
| 8819 | -c "session hash for extended master secret"\ |
| 8820 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8821 | -S "SSL - The handshake negotiation failed" \ |
| 8822 | -S "SSL - Unknown identity received" \ |
| 8823 | -S "SSL - Verification of the message MAC failed" |
| 8824 | |
| 8825 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8826 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \ |
| 8827 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 8828 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8829 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 8830 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8831 | 0 \ |
| 8832 | -c "session hash for extended master secret"\ |
| 8833 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8834 | -S "SSL - The handshake negotiation failed" \ |
| 8835 | -S "SSL - Unknown identity received" \ |
| 8836 | -S "SSL - Verification of the message MAC failed" |
| 8837 | |
| 8838 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8839 | run_test "PSK callback: raw psk on client, mismatching static raw PSK on server, opaque PSK from callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8840 | "$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] | 8841 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8842 | psk_identity=def psk=beef" \ |
| 8843 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8844 | -C "session hash for extended master secret"\ |
| 8845 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8846 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8847 | -S "SSL - Unknown identity received" \ |
| 8848 | -S "SSL - Verification of the message MAC failed" |
| 8849 | |
| 8850 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8851 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, opaque PSK from callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8852 | "$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] | 8853 | "$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] | 8854 | psk_identity=def psk=beef" \ |
| 8855 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8856 | -C "session hash for extended master secret"\ |
| 8857 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8858 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8859 | -S "SSL - Unknown identity received" \ |
| 8860 | -S "SSL - Verification of the message MAC failed" |
| 8861 | |
| 8862 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8863 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, raw PSK from callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8864 | "$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] | 8865 | "$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] | 8866 | psk_identity=def psk=beef" \ |
| 8867 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8868 | -C "session hash for extended master secret"\ |
| 8869 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8870 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8871 | -S "SSL - Unknown identity received" \ |
| 8872 | -S "SSL - Verification of the message MAC failed" |
| 8873 | |
| 8874 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8875 | run_test "PSK callback: raw psk on client, id-matching but wrong raw PSK on server, opaque PSK from callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8876 | "$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] | 8877 | "$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] | 8878 | psk_identity=def psk=beef" \ |
| 8879 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8880 | -C "session hash for extended master secret"\ |
| 8881 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8882 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8883 | -S "SSL - Unknown identity received" \ |
| 8884 | -S "SSL - Verification of the message MAC failed" |
| 8885 | |
| 8886 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8887 | run_test "PSK callback: raw psk on client, matching opaque PSK on server, wrong opaque PSK from callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8888 | "$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] | 8889 | "$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] | 8890 | psk_identity=def psk=beef" \ |
| 8891 | 1 \ |
| 8892 | -s "SSL - Verification of the message MAC failed" |
| 8893 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8894 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 8895 | "$P_SRV" \ |
| 8896 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8897 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 8898 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 8899 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8900 | -S "SSL - Unknown identity received" \ |
| 8901 | -S "SSL - Verification of the message MAC failed" |
| 8902 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8903 | run_test "PSK callback: callback overrides other settings" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8904 | "$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] | 8905 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8906 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8907 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8908 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8909 | -s "SSL - Unknown identity received" \ |
| 8910 | -S "SSL - Verification of the message MAC failed" |
| 8911 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8912 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8913 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 8914 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 8915 | psk_identity=abc psk=dead" \ |
| 8916 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8917 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8918 | -S "SSL - Unknown identity received" \ |
| 8919 | -S "SSL - Verification of the message MAC failed" |
| 8920 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8921 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8922 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 8923 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 8924 | psk_identity=def psk=beef" \ |
| 8925 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8926 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8927 | -S "SSL - Unknown identity received" \ |
| 8928 | -S "SSL - Verification of the message MAC failed" |
| 8929 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8930 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8931 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 8932 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 8933 | psk_identity=ghi psk=beef" \ |
| 8934 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8935 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8936 | -s "SSL - Unknown identity received" \ |
| 8937 | -S "SSL - Verification of the message MAC failed" |
| 8938 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8939 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8940 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 8941 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 8942 | psk_identity=abc psk=beef" \ |
| 8943 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8944 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8945 | -S "SSL - Unknown identity received" \ |
| 8946 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8947 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8948 | # Tests for EC J-PAKE |
| 8949 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 8950 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8951 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8952 | run_test "ECJPAKE: client not configured" \ |
| 8953 | "$P_SRV debug_level=3" \ |
| 8954 | "$P_CLI debug_level=3" \ |
| 8955 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 8956 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8957 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8958 | -S "found ecjpake kkpp extension" \ |
| 8959 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8960 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 8961 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 8962 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 8963 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8964 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 8965 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8966 | run_test "ECJPAKE: server not configured" \ |
| 8967 | "$P_SRV debug_level=3" \ |
| 8968 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 8969 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8970 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 8971 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8972 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8973 | -s "found ecjpake kkpp extension" \ |
| 8974 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8975 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 8976 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 8977 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 8978 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8979 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 8980 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 8981 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 8982 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8983 | run_test "ECJPAKE: working, TLS" \ |
| 8984 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 8985 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 8986 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 8987 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 8988 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8989 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8990 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8991 | -s "found ecjpake kkpp extension" \ |
| 8992 | -S "skip ecjpake kkpp extension" \ |
| 8993 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 8994 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 8995 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 8996 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8997 | -S "SSL - Verification of the message MAC failed" |
| 8998 | |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8999 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | a6b69da | 2022-11-30 16:44:49 +0100 | [diff] [blame] | 9000 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9001 | run_test "ECJPAKE: opaque password client+server, working, TLS" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9002 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9003 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 9004 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9005 | 0 \ |
| 9006 | -c "add ciphersuite: c0ff" \ |
| 9007 | -c "adding ecjpake_kkpp extension" \ |
Valerio Setti | 661b9bc | 2022-11-29 17:19:25 +0100 | [diff] [blame] | 9008 | -c "using opaque password" \ |
| 9009 | -s "using opaque password" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9010 | -C "re-using cached ecjpake parameters" \ |
| 9011 | -s "found ecjpake kkpp extension" \ |
| 9012 | -S "skip ecjpake kkpp extension" \ |
| 9013 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9014 | -s "server hello, ecjpake kkpp extension" \ |
| 9015 | -c "found ecjpake_kkpp extension" \ |
| 9016 | -S "SSL - The handshake negotiation failed" \ |
| 9017 | -S "SSL - Verification of the message MAC failed" |
| 9018 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9019 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9020 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9021 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9022 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9023 | run_test "ECJPAKE: opaque password client only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9024 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9025 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 9026 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9027 | 0 \ |
| 9028 | -c "add ciphersuite: c0ff" \ |
| 9029 | -c "adding ecjpake_kkpp extension" \ |
| 9030 | -c "using opaque password" \ |
| 9031 | -S "using opaque password" \ |
| 9032 | -C "re-using cached ecjpake parameters" \ |
| 9033 | -s "found ecjpake kkpp extension" \ |
| 9034 | -S "skip ecjpake kkpp extension" \ |
| 9035 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9036 | -s "server hello, ecjpake kkpp extension" \ |
| 9037 | -c "found ecjpake_kkpp extension" \ |
| 9038 | -S "SSL - The handshake negotiation failed" \ |
| 9039 | -S "SSL - Verification of the message MAC failed" |
| 9040 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9041 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9042 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9043 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9044 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9045 | run_test "ECJPAKE: opaque password server only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9046 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9047 | "$P_CLI debug_level=3 ecjpake_pw=bla\ |
| 9048 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9049 | 0 \ |
| 9050 | -c "add ciphersuite: c0ff" \ |
| 9051 | -c "adding ecjpake_kkpp extension" \ |
| 9052 | -C "using opaque password" \ |
| 9053 | -s "using opaque password" \ |
| 9054 | -C "re-using cached ecjpake parameters" \ |
| 9055 | -s "found ecjpake kkpp extension" \ |
| 9056 | -S "skip ecjpake kkpp extension" \ |
| 9057 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9058 | -s "server hello, ecjpake kkpp extension" \ |
| 9059 | -c "found ecjpake_kkpp extension" \ |
| 9060 | -S "SSL - The handshake negotiation failed" \ |
| 9061 | -S "SSL - Verification of the message MAC failed" |
| 9062 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9063 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9064 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9065 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 9066 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9067 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 9068 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9069 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9070 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9071 | -s "SSL - Verification of the message MAC failed" |
| 9072 | |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9073 | server_needs_more_time 1 |
| 9074 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9075 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9076 | run_test "ECJPAKE_OPAQUE_PW: opaque password mismatch, TLS" \ |
| 9077 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9078 | "$P_CLI debug_level=3 ecjpake_pw=bad ecjpake_pw_opaque=1 \ |
| 9079 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9080 | 1 \ |
| 9081 | -c "using opaque password" \ |
| 9082 | -s "using opaque password" \ |
| 9083 | -C "re-using cached ecjpake parameters" \ |
| 9084 | -s "SSL - Verification of the message MAC failed" |
| 9085 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9086 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9087 | run_test "ECJPAKE: working, DTLS" \ |
| 9088 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 9089 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 9090 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9091 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9092 | -c "re-using cached ecjpake parameters" \ |
| 9093 | -S "SSL - Verification of the message MAC failed" |
| 9094 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9095 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9096 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 9097 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 9098 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 9099 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9100 | 0 \ |
| 9101 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9102 | -S "SSL - Verification of the message MAC failed" |
| 9103 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9104 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9105 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9106 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 9107 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 9108 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 9109 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9110 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9111 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9112 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9113 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 9114 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9115 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 9116 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 9117 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 9118 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 9119 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9120 | 0 |
| 9121 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 9122 | # Test for ClientHello without extensions |
| 9123 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9124 | # Without extensions, ECC is impossible (no curve negotiation). |
| 9125 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 9126 | requires_gnutls |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9127 | run_test "ClientHello without extensions: RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 9128 | "$P_SRV force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9129 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 9130 | 0 \ |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9131 | -s "Ciphersuite is .*-RSA-WITH-.*" \ |
| 9132 | -S "Ciphersuite is .*-EC.*" \ |
| 9133 | -s "dumping 'client hello extensions' (0 bytes)" |
| 9134 | |
Gilles Peskine | f287691 | 2024-05-13 21:18:41 +0200 | [diff] [blame] | 9135 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_PSK_ENABLED |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9136 | requires_gnutls |
| 9137 | run_test "ClientHello without extensions: PSK" \ |
| 9138 | "$P_SRV force_version=tls12 debug_level=3 psk=73776f726466697368" \ |
| 9139 | "$G_CLI --priority=NORMAL:+PSK:-RSA:-DHE-RSA:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION --pskusername=Client_identity --pskkey=73776f726466697368 localhost" \ |
| 9140 | 0 \ |
| 9141 | -s "Ciphersuite is .*-PSK-.*" \ |
| 9142 | -S "Ciphersuite is .*-EC.*" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 9143 | -s "dumping 'client hello extensions' (0 bytes)" |
| 9144 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9145 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9146 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9147 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9148 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9149 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9150 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9151 | "$P_CLI request_size=100" \ |
| 9152 | 0 \ |
| 9153 | -s "Read from client: 100 bytes read$" |
| 9154 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9155 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9156 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 9157 | "$P_SRV buffer_size=100" \ |
| 9158 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9159 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9160 | -s "Read from client: 101 bytes read (100 + 1)" |
| 9161 | |
| 9162 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9163 | requires_max_content_len 200 |
| 9164 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 9165 | "$P_SRV buffer_size=100" \ |
| 9166 | "$P_CLI request_size=200" \ |
| 9167 | 0 \ |
| 9168 | -s "Read from client: 200 bytes read (100 + 100)" |
| 9169 | |
| 9170 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9171 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
Waleed Elmelegy | bae705c | 2024-01-01 14:21:21 +0000 | [diff] [blame] | 9172 | "$P_SRV buffer_size=100 force_version=tls12" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9173 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 9174 | 0 \ |
| 9175 | -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] | 9176 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9177 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9178 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9179 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9180 | "$P_SRV force_version=tls12" \ |
| 9181 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9182 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9183 | 0 \ |
| 9184 | -s "Read from client: 1 bytes read" |
| 9185 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9186 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9187 | "$P_SRV force_version=tls12" \ |
| 9188 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 9189 | 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] | 9190 | 0 \ |
| 9191 | -s "Read from client: 1 bytes read" |
| 9192 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9193 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9194 | "$P_SRV force_version=tls12" \ |
| 9195 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 9196 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9197 | 0 \ |
| 9198 | -s "Read from client: 1 bytes read" |
| 9199 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9200 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9201 | "$P_SRV force_version=tls12" \ |
| 9202 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9203 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 9204 | 0 \ |
| 9205 | -s "Read from client: 1 bytes read" |
| 9206 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9207 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9208 | "$P_SRV force_version=tls12" \ |
| 9209 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9210 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 9211 | 0 \ |
| 9212 | -s "Read from client: 1 bytes read" |
| 9213 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9214 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9215 | run_test "Small client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9216 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9217 | "$P_CLI request_size=1 \ |
| 9218 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9219 | 0 \ |
| 9220 | -s "Read from client: 1 bytes read" |
| 9221 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9222 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9223 | run_test "Small client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9224 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9225 | "$P_CLI request_size=1 \ |
| 9226 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9227 | 0 \ |
| 9228 | -s "Read from client: 1 bytes read" |
| 9229 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9230 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9231 | |
| 9232 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9233 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9234 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9235 | "$P_CLI dtls=1 request_size=1 \ |
| 9236 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9237 | 0 \ |
| 9238 | -s "Read from client: 1 bytes read" |
| 9239 | |
| 9240 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9241 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9242 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9243 | "$P_CLI dtls=1 request_size=1 \ |
| 9244 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9245 | 0 \ |
| 9246 | -s "Read from client: 1 bytes read" |
| 9247 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9248 | # Tests for small server packets |
| 9249 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9250 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9251 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9252 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9253 | 0 \ |
| 9254 | -c "Read from server: 1 bytes read" |
| 9255 | |
| 9256 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9257 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9258 | "$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] | 9259 | 0 \ |
| 9260 | -c "Read from server: 1 bytes read" |
| 9261 | |
| 9262 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9263 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9264 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9265 | 0 \ |
| 9266 | -c "Read from server: 1 bytes read" |
| 9267 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9268 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9269 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9270 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9271 | 0 \ |
| 9272 | -c "Read from server: 1 bytes read" |
| 9273 | |
| 9274 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9275 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9276 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9277 | 0 \ |
| 9278 | -c "Read from server: 1 bytes read" |
| 9279 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9280 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9281 | run_test "Small server packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9282 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9283 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9284 | 0 \ |
| 9285 | -c "Read from server: 1 bytes read" |
| 9286 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9287 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9288 | run_test "Small server packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9289 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9290 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9291 | 0 \ |
| 9292 | -c "Read from server: 1 bytes read" |
| 9293 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9294 | # Tests for small server packets in DTLS |
| 9295 | |
| 9296 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9297 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9298 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9299 | "$P_CLI dtls=1 \ |
| 9300 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9301 | 0 \ |
| 9302 | -c "Read from server: 1 bytes read" |
| 9303 | |
| 9304 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9305 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9306 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9307 | "$P_CLI dtls=1 \ |
| 9308 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9309 | 0 \ |
| 9310 | -c "Read from server: 1 bytes read" |
| 9311 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9312 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9313 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9314 | # How many fragments do we expect to write $1 bytes? |
| 9315 | fragments_for_write() { |
| 9316 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 9317 | } |
| 9318 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9319 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9320 | "$P_SRV force_version=tls12" \ |
| 9321 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9322 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9323 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9324 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9325 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9326 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9327 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9328 | "$P_SRV force_version=tls12" \ |
| 9329 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 9330 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9331 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9332 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 9333 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9334 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9335 | "$P_SRV force_version=tls12" \ |
| 9336 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 9337 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9338 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9339 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9340 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9341 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9342 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9343 | "$P_SRV force_version=tls12" \ |
| 9344 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9345 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 9346 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9347 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9348 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9349 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9350 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9351 | "$P_SRV force_version=tls12" \ |
| 9352 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9353 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 9354 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9355 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9356 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9357 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9358 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9359 | run_test "Large client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9360 | "$P_SRV" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9361 | "$P_CLI request_size=16383 \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9362 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9363 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9364 | -c "16383 bytes written in $(fragments_for_write 16383) fragments" \ |
| 9365 | -s "Read from client: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9366 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9367 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9368 | run_test "Large client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9369 | "$P_SRV" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9370 | "$P_CLI request_size=16383 \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9371 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9372 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9373 | -c "16383 bytes written in $(fragments_for_write 16383) fragments" \ |
| 9374 | -s "Read from client: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9375 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9376 | # 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] | 9377 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9378 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9379 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9380 | 0 \ |
| 9381 | -c "Read from server: 16384 bytes read" |
| 9382 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9383 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9384 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9385 | "$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] | 9386 | 0 \ |
| 9387 | -s "16384 bytes written in 1 fragments" \ |
| 9388 | -c "Read from server: 16384 bytes read" |
| 9389 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9390 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9391 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9392 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9393 | 0 \ |
| 9394 | -c "Read from server: 16384 bytes read" |
| 9395 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9396 | 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] | 9397 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 9398 | "$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] | 9399 | 0 \ |
| 9400 | -s "16384 bytes written in 1 fragments" \ |
| 9401 | -c "Read from server: 16384 bytes read" |
| 9402 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9403 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9404 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9405 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9406 | 0 \ |
| 9407 | -c "Read from server: 16384 bytes read" |
| 9408 | |
| 9409 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9410 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9411 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9412 | 0 \ |
| 9413 | -c "Read from server: 16384 bytes read" |
| 9414 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9415 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9416 | run_test "Large server packet TLS 1.3 AEAD" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9417 | "$P_SRV response_size=16383" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9418 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9419 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9420 | -c "Read from server: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9421 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9422 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9423 | run_test "Large server packet TLS 1.3 AEAD shorter tag" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9424 | "$P_SRV response_size=16383" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9425 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9426 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9427 | -c "Read from server: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9428 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9429 | # Tests for restartable ECC |
| 9430 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9431 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 9432 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9433 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9434 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9435 | run_test "EC restart: TLS, default" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9436 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9437 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 9438 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9439 | debug_level=1" \ |
| 9440 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9441 | -C "x509_verify_cert.*4b00" \ |
| 9442 | -C "mbedtls_pk_verify.*4b00" \ |
| 9443 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9444 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9445 | |
| 9446 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9447 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9448 | run_test "EC restart: TLS, max_ops=0" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9449 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9450 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 9451 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9452 | debug_level=1 ec_max_ops=0" \ |
| 9453 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9454 | -C "x509_verify_cert.*4b00" \ |
| 9455 | -C "mbedtls_pk_verify.*4b00" \ |
| 9456 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9457 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9458 | |
| 9459 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9460 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9461 | run_test "EC restart: TLS, max_ops=65535" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9462 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9463 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 9464 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9465 | debug_level=1 ec_max_ops=65535" \ |
| 9466 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9467 | -C "x509_verify_cert.*4b00" \ |
| 9468 | -C "mbedtls_pk_verify.*4b00" \ |
| 9469 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9470 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9471 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9472 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9473 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9474 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9475 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9476 | run_test "EC restart: TLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9477 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9478 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 9479 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9480 | debug_level=1 ec_max_ops=1000" \ |
| 9481 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9482 | -c "x509_verify_cert.*4b00" \ |
| 9483 | -c "mbedtls_pk_verify.*4b00" \ |
| 9484 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9485 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9486 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9487 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9488 | # everything except ECDH (where TLS calls PSA directly). |
| 9489 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9490 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9491 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9492 | run_test "EC restart: TLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9493 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9494 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9495 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 9496 | debug_level=1 ec_max_ops=1000" \ |
| 9497 | 0 \ |
| 9498 | -c "x509_verify_cert.*4b00" \ |
| 9499 | -c "mbedtls_pk_verify.*4b00" \ |
| 9500 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9501 | -c "mbedtls_pk_sign.*4b00" |
| 9502 | |
| 9503 | # This works the same with & without USE_PSA as we never get to ECDH: |
| 9504 | # 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] | 9505 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9506 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9507 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9508 | "$P_SRV groups=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9509 | crt_file=data_files/server5-badsign.crt \ |
| 9510 | key_file=data_files/server5.key" \ |
| 9511 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9512 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 9513 | debug_level=1 ec_max_ops=1000" \ |
| 9514 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9515 | -c "x509_verify_cert.*4b00" \ |
| 9516 | -C "mbedtls_pk_verify.*4b00" \ |
| 9517 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9518 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9519 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9520 | -c "! mbedtls_ssl_handshake returned" \ |
| 9521 | -c "X509 - Certificate verification failed" |
| 9522 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9523 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9524 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9525 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9526 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9527 | 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] | 9528 | "$P_SRV groups=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9529 | crt_file=data_files/server5-badsign.crt \ |
| 9530 | key_file=data_files/server5.key" \ |
| 9531 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9532 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 9533 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 9534 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9535 | -c "x509_verify_cert.*4b00" \ |
| 9536 | -c "mbedtls_pk_verify.*4b00" \ |
| 9537 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9538 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9539 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9540 | -C "! mbedtls_ssl_handshake returned" \ |
| 9541 | -C "X509 - Certificate verification failed" |
| 9542 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9543 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9544 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9545 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9546 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9547 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9548 | 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] | 9549 | "$P_SRV groups=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9550 | crt_file=data_files/server5-badsign.crt \ |
| 9551 | key_file=data_files/server5.key" \ |
| 9552 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9553 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 9554 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 9555 | 0 \ |
| 9556 | -c "x509_verify_cert.*4b00" \ |
| 9557 | -c "mbedtls_pk_verify.*4b00" \ |
| 9558 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9559 | -c "mbedtls_pk_sign.*4b00" \ |
| 9560 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9561 | -C "! mbedtls_ssl_handshake returned" \ |
| 9562 | -C "X509 - Certificate verification failed" |
| 9563 | |
| 9564 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9565 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9566 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9567 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9568 | 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] | 9569 | "$P_SRV groups=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9570 | crt_file=data_files/server5-badsign.crt \ |
| 9571 | key_file=data_files/server5.key" \ |
| 9572 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9573 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 9574 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 9575 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9576 | -C "x509_verify_cert.*4b00" \ |
| 9577 | -c "mbedtls_pk_verify.*4b00" \ |
| 9578 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9579 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9580 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 9581 | -C "! mbedtls_ssl_handshake returned" \ |
| 9582 | -C "X509 - Certificate verification failed" |
| 9583 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9584 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9585 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9586 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9587 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9588 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9589 | 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] | 9590 | "$P_SRV groups=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9591 | crt_file=data_files/server5-badsign.crt \ |
| 9592 | key_file=data_files/server5.key" \ |
| 9593 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9594 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 9595 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 9596 | 0 \ |
| 9597 | -C "x509_verify_cert.*4b00" \ |
| 9598 | -c "mbedtls_pk_verify.*4b00" \ |
| 9599 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9600 | -c "mbedtls_pk_sign.*4b00" \ |
| 9601 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 9602 | -C "! mbedtls_ssl_handshake returned" \ |
| 9603 | -C "X509 - Certificate verification failed" |
| 9604 | |
| 9605 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9606 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9607 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9608 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9609 | run_test "EC restart: DTLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9610 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9611 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 9612 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9613 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 9614 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9615 | -c "x509_verify_cert.*4b00" \ |
| 9616 | -c "mbedtls_pk_verify.*4b00" \ |
| 9617 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9618 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9619 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9620 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9621 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9622 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9623 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9624 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9625 | run_test "EC restart: DTLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9626 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9627 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9628 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 9629 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 9630 | 0 \ |
| 9631 | -c "x509_verify_cert.*4b00" \ |
| 9632 | -c "mbedtls_pk_verify.*4b00" \ |
| 9633 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9634 | -c "mbedtls_pk_sign.*4b00" |
| 9635 | |
| 9636 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9637 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9638 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9639 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9640 | 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] | 9641 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9642 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9643 | debug_level=1 ec_max_ops=1000" \ |
| 9644 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9645 | -c "x509_verify_cert.*4b00" \ |
| 9646 | -c "mbedtls_pk_verify.*4b00" \ |
| 9647 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9648 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9649 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9650 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9651 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9652 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9653 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9654 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9655 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9656 | 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] | 9657 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9658 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9659 | debug_level=1 ec_max_ops=1000" \ |
| 9660 | 0 \ |
| 9661 | -c "x509_verify_cert.*4b00" \ |
| 9662 | -c "mbedtls_pk_verify.*4b00" \ |
| 9663 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9664 | -C "mbedtls_pk_sign.*4b00" |
| 9665 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9666 | # Restartable is only for ECDHE-ECDSA, with another ciphersuite we expect no |
| 9667 | # restartable behaviour at all (not even client auth). |
| 9668 | # This is the same as "EC restart: TLS, max_ops=1000" except with ECDHE-RSA, |
| 9669 | # and all 4 assertions negated. |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9670 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9671 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9672 | run_test "EC restart: TLS, max_ops=1000, ECDHE-RSA" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9673 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9674 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 \ |
| 9675 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 9676 | debug_level=1 ec_max_ops=1000" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9677 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9678 | -C "x509_verify_cert.*4b00" \ |
| 9679 | -C "mbedtls_pk_verify.*4b00" \ |
| 9680 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9681 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9682 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9683 | # Tests of asynchronous private key support in SSL |
| 9684 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9685 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9686 | run_test "SSL async private: sign, delay=0" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9687 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9688 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9689 | "$P_CLI" \ |
| 9690 | 0 \ |
| 9691 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9692 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9693 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9694 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9695 | run_test "SSL async private: sign, delay=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9696 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9697 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9698 | "$P_CLI" \ |
| 9699 | 0 \ |
| 9700 | -s "Async sign callback: using key slot " \ |
| 9701 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9702 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 9703 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 9704 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 9705 | run_test "SSL async private: sign, delay=2" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9706 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 9707 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 9708 | "$P_CLI" \ |
| 9709 | 0 \ |
| 9710 | -s "Async sign callback: using key slot " \ |
| 9711 | -U "Async sign callback: using key slot " \ |
| 9712 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 9713 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 9714 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 9715 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9716 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 9717 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 9718 | run_test "SSL async private: sign, SNI" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9719 | "$P_SRV force_version=tls12 debug_level=3 \ |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 9720 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 9721 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 9722 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 9723 | "$P_CLI server_name=polarssl.example" \ |
| 9724 | 0 \ |
| 9725 | -s "Async sign callback: using key slot " \ |
| 9726 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 9727 | -s "parse ServerName extension" \ |
| 9728 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 9729 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 9730 | |
| 9731 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9732 | run_test "SSL async private: decrypt, delay=0" \ |
| 9733 | "$P_SRV \ |
| 9734 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 9735 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9736 | 0 \ |
| 9737 | -s "Async decrypt callback: using key slot " \ |
| 9738 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 9739 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9740 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9741 | run_test "SSL async private: decrypt, delay=1" \ |
| 9742 | "$P_SRV \ |
| 9743 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 9744 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9745 | 0 \ |
| 9746 | -s "Async decrypt callback: using key slot " \ |
| 9747 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 9748 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 9749 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9750 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9751 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9752 | "$P_SRV psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9753 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9754 | "$P_CLI psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9755 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 9756 | 0 \ |
| 9757 | -s "Async decrypt callback: using key slot " \ |
| 9758 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 9759 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9760 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9761 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9762 | "$P_SRV psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9763 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9764 | "$P_CLI psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9765 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 9766 | 0 \ |
| 9767 | -s "Async decrypt callback: using key slot " \ |
| 9768 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 9769 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 9770 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9771 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9772 | run_test "SSL async private: sign callback not present" \ |
| 9773 | "$P_SRV \ |
| 9774 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9775 | "$P_CLI force_version=tls12; [ \$? -eq 1 ] && |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9776 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9777 | 0 \ |
| 9778 | -S "Async sign callback" \ |
| 9779 | -s "! mbedtls_ssl_handshake returned" \ |
| 9780 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 9781 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 9782 | -s "Successful connection" |
| 9783 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9784 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9785 | run_test "SSL async private: decrypt callback not present" \ |
| 9786 | "$P_SRV debug_level=1 \ |
| 9787 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 9788 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 9789 | [ \$? -eq 1 ] && $P_CLI force_version=tls12" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9790 | 0 \ |
| 9791 | -S "Async decrypt callback" \ |
| 9792 | -s "! mbedtls_ssl_handshake returned" \ |
| 9793 | -s "got no RSA private key" \ |
| 9794 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 9795 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9796 | |
| 9797 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9798 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9799 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9800 | "$P_SRV \ |
| 9801 | async_operations=s async_private_delay1=1 \ |
| 9802 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 9803 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9804 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 9805 | 0 \ |
| 9806 | -s "Async sign callback: using key slot 0," \ |
| 9807 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9808 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9809 | |
| 9810 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9811 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9812 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9813 | "$P_SRV \ |
| 9814 | async_operations=s async_private_delay2=1 \ |
| 9815 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 9816 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9817 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9818 | 0 \ |
| 9819 | -s "Async sign callback: using key slot 0," \ |
| 9820 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9821 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9822 | |
| 9823 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9824 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 9825 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9826 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 9827 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9828 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 9829 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9830 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9831 | 0 \ |
| 9832 | -s "Async sign callback: using key slot 1," \ |
| 9833 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9834 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9835 | |
| 9836 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9837 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9838 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9839 | "$P_SRV \ |
| 9840 | async_operations=s async_private_delay1=1 \ |
| 9841 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 9842 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9843 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9844 | 0 \ |
| 9845 | -s "Async sign callback: no key matches this certificate." |
| 9846 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9847 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 9848 | run_test "SSL async private: sign, error in start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9849 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9850 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 9851 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9852 | "$P_CLI" \ |
| 9853 | 1 \ |
| 9854 | -s "Async sign callback: injected error" \ |
| 9855 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 9856 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9857 | -s "! mbedtls_ssl_handshake returned" |
| 9858 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9859 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 9860 | run_test "SSL async private: sign, cancel after start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9861 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9862 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 9863 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9864 | "$P_CLI" \ |
| 9865 | 1 \ |
| 9866 | -s "Async sign callback: using key slot " \ |
| 9867 | -S "Async resume" \ |
| 9868 | -s "Async cancel" |
| 9869 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9870 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 9871 | run_test "SSL async private: sign, error in resume" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9872 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9873 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 9874 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9875 | "$P_CLI" \ |
| 9876 | 1 \ |
| 9877 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9878 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 9879 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9880 | -s "! mbedtls_ssl_handshake returned" |
| 9881 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9882 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 9883 | run_test "SSL async private: decrypt, error in start" \ |
| 9884 | "$P_SRV \ |
| 9885 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 9886 | async_private_error=1" \ |
| 9887 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9888 | 1 \ |
| 9889 | -s "Async decrypt callback: injected error" \ |
| 9890 | -S "Async resume" \ |
| 9891 | -S "Async cancel" \ |
| 9892 | -s "! mbedtls_ssl_handshake returned" |
| 9893 | |
| 9894 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 9895 | run_test "SSL async private: decrypt, cancel after start" \ |
| 9896 | "$P_SRV \ |
| 9897 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 9898 | async_private_error=2" \ |
| 9899 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9900 | 1 \ |
| 9901 | -s "Async decrypt callback: using key slot " \ |
| 9902 | -S "Async resume" \ |
| 9903 | -s "Async cancel" |
| 9904 | |
| 9905 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 9906 | run_test "SSL async private: decrypt, error in resume" \ |
| 9907 | "$P_SRV \ |
| 9908 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 9909 | async_private_error=3" \ |
| 9910 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9911 | 1 \ |
| 9912 | -s "Async decrypt callback: using key slot " \ |
| 9913 | -s "Async resume callback: decrypt done but injected error" \ |
| 9914 | -S "Async cancel" \ |
| 9915 | -s "! mbedtls_ssl_handshake returned" |
| 9916 | |
| 9917 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9918 | run_test "SSL async private: cancel after start then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9919 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9920 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 9921 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9922 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 9923 | 0 \ |
| 9924 | -s "Async cancel" \ |
| 9925 | -s "! mbedtls_ssl_handshake returned" \ |
| 9926 | -s "Async resume" \ |
| 9927 | -s "Successful connection" |
| 9928 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9929 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9930 | run_test "SSL async private: error in resume then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9931 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9932 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 9933 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9934 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 9935 | 0 \ |
| 9936 | -s "! mbedtls_ssl_handshake returned" \ |
| 9937 | -s "Async resume" \ |
| 9938 | -s "Successful connection" |
| 9939 | |
| 9940 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9941 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 9942 | # Note: the function "detect_required_features()" is not able to detect more than |
| 9943 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 9944 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 9945 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9946 | 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] | 9947 | "$P_SRV \ |
| 9948 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 9949 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 9950 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9951 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 9952 | [ \$? -eq 1 ] && |
| 9953 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9954 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 9955 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9956 | -S "Async resume" \ |
| 9957 | -s "Async cancel" \ |
| 9958 | -s "! mbedtls_ssl_handshake returned" \ |
| 9959 | -s "Async sign callback: no key matches this certificate." \ |
| 9960 | -s "Successful connection" |
| 9961 | |
| 9962 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9963 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 9964 | # Note: the function "detect_required_features()" is not able to detect more than |
| 9965 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 9966 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 9967 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 9968 | 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] | 9969 | "$P_SRV \ |
| 9970 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 9971 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 9972 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9973 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 9974 | [ \$? -eq 1 ] && |
| 9975 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9976 | 0 \ |
| 9977 | -s "Async resume" \ |
| 9978 | -s "! mbedtls_ssl_handshake returned" \ |
| 9979 | -s "Async sign callback: no key matches this certificate." \ |
| 9980 | -s "Successful connection" |
| 9981 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9982 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9983 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9984 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9985 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9986 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9987 | exchanges=2 renegotiation=1" \ |
| 9988 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 9989 | 0 \ |
| 9990 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9991 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9992 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9993 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9994 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9995 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9996 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9997 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9998 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 9999 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 10000 | 0 \ |
| 10001 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10002 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 10003 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10004 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10005 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10006 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10007 | "$P_SRV \ |
| 10008 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10009 | exchanges=2 renegotiation=1" \ |
| 10010 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 10011 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10012 | 0 \ |
| 10013 | -s "Async decrypt callback: using key slot " \ |
| 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 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10018 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10019 | "$P_SRV \ |
| 10020 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10021 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10022 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 10023 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10024 | 0 \ |
| 10025 | -s "Async decrypt callback: using key slot " \ |
| 10026 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10027 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10028 | # Tests for ECC extensions (rfc 4492) |
| 10029 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10030 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10031 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10032 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 10033 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10034 | "$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] | 10035 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 10036 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10037 | -C "client hello, adding supported_point_formats extension" \ |
| 10038 | -S "found supported elliptic curves extension" \ |
| 10039 | -S "found supported point formats extension" |
| 10040 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10041 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10042 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10043 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10044 | "$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] | 10045 | "$P_CLI debug_level=3" \ |
| 10046 | 0 \ |
| 10047 | -C "found supported_point_formats extension" \ |
| 10048 | -S "server hello, supported_point_formats extension" |
| 10049 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10050 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10051 | run_test "Force an ECC ciphersuite in the client side" \ |
| 10052 | "$P_SRV debug_level=3" \ |
| 10053 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10054 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 10055 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10056 | -c "client hello, adding supported_point_formats extension" \ |
| 10057 | -s "found supported elliptic curves extension" \ |
| 10058 | -s "found supported point formats extension" |
| 10059 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10060 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10061 | run_test "Force an ECC ciphersuite in the server side" \ |
| 10062 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10063 | "$P_CLI debug_level=3" \ |
| 10064 | 0 \ |
| 10065 | -c "found supported_point_formats extension" \ |
| 10066 | -s "server hello, supported_point_formats extension" |
| 10067 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10068 | # Tests for DTLS HelloVerifyRequest |
| 10069 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10070 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10071 | run_test "DTLS cookie: enabled" \ |
| 10072 | "$P_SRV dtls=1 debug_level=2" \ |
| 10073 | "$P_CLI dtls=1 debug_level=2" \ |
| 10074 | 0 \ |
| 10075 | -s "cookie verification failed" \ |
| 10076 | -s "cookie verification passed" \ |
| 10077 | -S "cookie verification skipped" \ |
| 10078 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10079 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10080 | -S "SSL - The requested feature is not available" |
| 10081 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10082 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10083 | run_test "DTLS cookie: disabled" \ |
| 10084 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 10085 | "$P_CLI dtls=1 debug_level=2" \ |
| 10086 | 0 \ |
| 10087 | -S "cookie verification failed" \ |
| 10088 | -S "cookie verification passed" \ |
| 10089 | -s "cookie verification skipped" \ |
| 10090 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10091 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10092 | -S "SSL - The requested feature is not available" |
| 10093 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10094 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10095 | run_test "DTLS cookie: default (failing)" \ |
| 10096 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 10097 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 10098 | 1 \ |
| 10099 | -s "cookie verification failed" \ |
| 10100 | -S "cookie verification passed" \ |
| 10101 | -S "cookie verification skipped" \ |
| 10102 | -C "received hello verify request" \ |
| 10103 | -S "hello verification requested" \ |
| 10104 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10105 | |
| 10106 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10107 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10108 | run_test "DTLS cookie: enabled, IPv6" \ |
| 10109 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 10110 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 10111 | 0 \ |
| 10112 | -s "cookie verification failed" \ |
| 10113 | -s "cookie verification passed" \ |
| 10114 | -S "cookie verification skipped" \ |
| 10115 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10116 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10117 | -S "SSL - The requested feature is not available" |
| 10118 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10119 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 10120 | run_test "DTLS cookie: enabled, nbio" \ |
| 10121 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 10122 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10123 | 0 \ |
| 10124 | -s "cookie verification failed" \ |
| 10125 | -s "cookie verification passed" \ |
| 10126 | -S "cookie verification skipped" \ |
| 10127 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10128 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 10129 | -S "SSL - The requested feature is not available" |
| 10130 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10131 | # Tests for client reconnecting from the same port with DTLS |
| 10132 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10133 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10134 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10135 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10136 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 10137 | "$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] | 10138 | 0 \ |
| 10139 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10140 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10141 | -S "Client initiated reconnection from same port" |
| 10142 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10143 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10145 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10146 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 10147 | "$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] | 10148 | 0 \ |
| 10149 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10150 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10151 | -s "Client initiated reconnection from same port" |
| 10152 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10153 | 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] | 10154 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10155 | 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] | 10156 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 10157 | "$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] | 10158 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10159 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10160 | -s "Client initiated reconnection from same port" |
| 10161 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10162 | 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] | 10163 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10164 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 10165 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 10166 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 10167 | 0 \ |
| 10168 | -S "The operation timed out" \ |
| 10169 | -s "Client initiated reconnection from same port" |
| 10170 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10171 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10172 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 10173 | "$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] | 10174 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 10175 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10176 | -s "The operation timed out" \ |
| 10177 | -S "Client initiated reconnection from same port" |
| 10178 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10179 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 10180 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 10181 | -p "$P_PXY inject_clihlo=1" \ |
| 10182 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 10183 | "$P_CLI dtls=1 exchanges=2" \ |
| 10184 | 0 \ |
| 10185 | -s "possible client reconnect from the same port" \ |
| 10186 | -S "Client initiated reconnection from same port" |
| 10187 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10188 | # Tests for various cases of client authentication with DTLS |
| 10189 | # (focused on handshake flows and message parsing) |
| 10190 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10191 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10192 | run_test "DTLS client auth: required" \ |
| 10193 | "$P_SRV dtls=1 auth_mode=required" \ |
| 10194 | "$P_CLI dtls=1" \ |
| 10195 | 0 \ |
| 10196 | -s "Verifying peer X.509 certificate... ok" |
| 10197 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10198 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10199 | run_test "DTLS client auth: optional, client has no cert" \ |
| 10200 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 10201 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 10202 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10203 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10204 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10205 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10206 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10207 | "$P_SRV dtls=1 auth_mode=none" \ |
| 10208 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 10209 | 0 \ |
| 10210 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10211 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10212 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 10213 | run_test "DTLS wrong PSK: badmac alert" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10214 | "$P_SRV dtls=1 psk=73776f726466697368 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
Gilles Peskine | abb1c22 | 2024-05-13 21:06:26 +0200 | [diff] [blame] | 10215 | "$P_CLI dtls=1 psk=73776f726466697374" \ |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 10216 | 1 \ |
| 10217 | -s "SSL - Verification of the message MAC failed" \ |
| 10218 | -c "SSL - A fatal alert message was received from our peer" |
| 10219 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10220 | # Tests for receiving fragmented handshake messages with DTLS |
| 10221 | |
| 10222 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10223 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10224 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 10225 | "$G_SRV -u --mtu 2048 -a" \ |
| 10226 | "$P_CLI dtls=1 debug_level=2" \ |
| 10227 | 0 \ |
| 10228 | -C "found fragmented DTLS handshake message" \ |
| 10229 | -C "error" |
| 10230 | |
| 10231 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10232 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10233 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 10234 | "$G_SRV -u --mtu 512" \ |
| 10235 | "$P_CLI dtls=1 debug_level=2" \ |
| 10236 | 0 \ |
| 10237 | -c "found fragmented DTLS handshake message" \ |
| 10238 | -C "error" |
| 10239 | |
| 10240 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10241 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10242 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 10243 | "$G_SRV -u --mtu 128" \ |
| 10244 | "$P_CLI dtls=1 debug_level=2" \ |
| 10245 | 0 \ |
| 10246 | -c "found fragmented DTLS handshake message" \ |
| 10247 | -C "error" |
| 10248 | |
| 10249 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10250 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10251 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 10252 | "$G_SRV -u --mtu 128" \ |
| 10253 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10254 | 0 \ |
| 10255 | -c "found fragmented DTLS handshake message" \ |
| 10256 | -C "error" |
| 10257 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10258 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10259 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10260 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10261 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 10262 | "$G_SRV -u --mtu 256" \ |
| 10263 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 10264 | 0 \ |
| 10265 | -c "found fragmented DTLS handshake message" \ |
| 10266 | -c "client hello, adding renegotiation extension" \ |
| 10267 | -c "found renegotiation extension" \ |
| 10268 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 10269 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10270 | -C "error" \ |
| 10271 | -s "Extra-header:" |
| 10272 | |
| 10273 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10274 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10275 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10276 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 10277 | "$G_SRV -u --mtu 256" \ |
| 10278 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 10279 | 0 \ |
| 10280 | -c "found fragmented DTLS handshake message" \ |
| 10281 | -c "client hello, adding renegotiation extension" \ |
| 10282 | -c "found renegotiation extension" \ |
| 10283 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 10284 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10285 | -C "error" \ |
| 10286 | -s "Extra-header:" |
| 10287 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10288 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10289 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 10290 | "$O_SRV -dtls -mtu 2048" \ |
| 10291 | "$P_CLI dtls=1 debug_level=2" \ |
| 10292 | 0 \ |
| 10293 | -C "found fragmented DTLS handshake message" \ |
| 10294 | -C "error" |
| 10295 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10296 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10297 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 10298 | "$O_SRV -dtls -mtu 256" \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10299 | "$P_CLI dtls=1 debug_level=2" \ |
| 10300 | 0 \ |
| 10301 | -c "found fragmented DTLS handshake message" \ |
| 10302 | -C "error" |
| 10303 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10304 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10305 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 10306 | "$O_SRV -dtls -mtu 256" \ |
| 10307 | "$P_CLI dtls=1 debug_level=2" \ |
| 10308 | 0 \ |
| 10309 | -c "found fragmented DTLS handshake message" \ |
| 10310 | -C "error" |
| 10311 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10312 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10313 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 10314 | "$O_SRV -dtls -mtu 256" \ |
| 10315 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10316 | 0 \ |
| 10317 | -c "found fragmented DTLS handshake message" \ |
| 10318 | -C "error" |
| 10319 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10320 | # Tests for sending fragmented handshake messages with DTLS |
| 10321 | # |
| 10322 | # Use client auth when we need the client to send large messages, |
| 10323 | # and use large cert chains on both sides too (the long chains we have all use |
| 10324 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 10325 | # Sizes reached (UDP payload): |
| 10326 | # - 2037B for server certificate |
| 10327 | # - 1542B for client certificate |
| 10328 | # - 1013B for newsessionticket |
| 10329 | # - all others below 512B |
| 10330 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 10331 | |
| 10332 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10333 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10334 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10335 | requires_max_content_len 4096 |
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 | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10337 | run_test "DTLS fragmenting: none (for reference)" \ |
| 10338 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10339 | crt_file=data_files/server7_int-ca.crt \ |
| 10340 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10341 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10342 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10343 | "$P_CLI dtls=1 debug_level=2 \ |
| 10344 | crt_file=data_files/server8_int-ca2.crt \ |
| 10345 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10346 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10347 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10348 | 0 \ |
| 10349 | -S "found fragmented DTLS handshake message" \ |
| 10350 | -C "found fragmented DTLS handshake message" \ |
| 10351 | -C "error" |
| 10352 | |
| 10353 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10354 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10355 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10356 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10357 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10358 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10359 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10360 | crt_file=data_files/server7_int-ca.crt \ |
| 10361 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10362 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10363 | max_frag_len=1024" \ |
| 10364 | "$P_CLI dtls=1 debug_level=2 \ |
| 10365 | crt_file=data_files/server8_int-ca2.crt \ |
| 10366 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10367 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10368 | max_frag_len=2048" \ |
| 10369 | 0 \ |
| 10370 | -S "found fragmented DTLS handshake message" \ |
| 10371 | -c "found fragmented DTLS handshake message" \ |
| 10372 | -C "error" |
| 10373 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 10374 | # With the MFL extension, the server has no way of forcing |
| 10375 | # the client to not exceed a certain MTU; hence, the following |
| 10376 | # test can't be replicated with an MTU proxy such as the one |
| 10377 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10378 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10379 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10380 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10381 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10382 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10383 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10384 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10385 | crt_file=data_files/server7_int-ca.crt \ |
| 10386 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10387 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10388 | max_frag_len=512" \ |
| 10389 | "$P_CLI dtls=1 debug_level=2 \ |
| 10390 | crt_file=data_files/server8_int-ca2.crt \ |
| 10391 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10392 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 10393 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10394 | 0 \ |
| 10395 | -S "found fragmented DTLS handshake message" \ |
| 10396 | -c "found fragmented DTLS handshake message" \ |
| 10397 | -C "error" |
| 10398 | |
| 10399 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10400 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10401 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10402 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10403 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10404 | 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] | 10405 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 10406 | crt_file=data_files/server7_int-ca.crt \ |
| 10407 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10408 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10409 | max_frag_len=2048" \ |
| 10410 | "$P_CLI dtls=1 debug_level=2 \ |
| 10411 | crt_file=data_files/server8_int-ca2.crt \ |
| 10412 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10413 | hs_timeout=2500-60000 \ |
| 10414 | max_frag_len=1024" \ |
| 10415 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10416 | -S "found fragmented DTLS handshake message" \ |
| 10417 | -c "found fragmented DTLS handshake message" \ |
| 10418 | -C "error" |
| 10419 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10420 | # While not required by the standard defining the MFL extension |
| 10421 | # (according to which it only applies to records, not to datagrams), |
| 10422 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 10423 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 10424 | # to the peer. |
| 10425 | # The next test checks that no datagrams significantly larger than the |
| 10426 | # negotiated MFL are sent. |
| 10427 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10428 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10429 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10430 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10431 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10432 | 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] | 10433 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10434 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 10435 | crt_file=data_files/server7_int-ca.crt \ |
| 10436 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10437 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10438 | max_frag_len=2048" \ |
| 10439 | "$P_CLI dtls=1 debug_level=2 \ |
| 10440 | crt_file=data_files/server8_int-ca2.crt \ |
| 10441 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10442 | hs_timeout=2500-60000 \ |
| 10443 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10444 | 0 \ |
| 10445 | -S "found fragmented DTLS handshake message" \ |
| 10446 | -c "found fragmented DTLS handshake message" \ |
| 10447 | -C "error" |
| 10448 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10449 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10450 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10451 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10452 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10453 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10454 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10455 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10456 | crt_file=data_files/server7_int-ca.crt \ |
| 10457 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10458 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10459 | max_frag_len=2048" \ |
| 10460 | "$P_CLI dtls=1 debug_level=2 \ |
| 10461 | crt_file=data_files/server8_int-ca2.crt \ |
| 10462 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10463 | hs_timeout=2500-60000 \ |
| 10464 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10465 | 0 \ |
| 10466 | -s "found fragmented DTLS handshake message" \ |
| 10467 | -c "found fragmented DTLS handshake message" \ |
| 10468 | -C "error" |
| 10469 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10470 | # While not required by the standard defining the MFL extension |
| 10471 | # (according to which it only applies to records, not to datagrams), |
| 10472 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 10473 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 10474 | # to the peer. |
| 10475 | # The next test checks that no datagrams significantly larger than the |
| 10476 | # negotiated MFL are sent. |
| 10477 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10478 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10479 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10480 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10481 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10482 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 10483 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10484 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10485 | crt_file=data_files/server7_int-ca.crt \ |
| 10486 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10487 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10488 | max_frag_len=2048" \ |
| 10489 | "$P_CLI dtls=1 debug_level=2 \ |
| 10490 | crt_file=data_files/server8_int-ca2.crt \ |
| 10491 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10492 | hs_timeout=2500-60000 \ |
| 10493 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10494 | 0 \ |
| 10495 | -s "found fragmented DTLS handshake message" \ |
| 10496 | -c "found fragmented DTLS handshake message" \ |
| 10497 | -C "error" |
| 10498 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10499 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10500 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10501 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10502 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10503 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 10504 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10505 | crt_file=data_files/server7_int-ca.crt \ |
| 10506 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10507 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10508 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10509 | "$P_CLI dtls=1 debug_level=2 \ |
| 10510 | crt_file=data_files/server8_int-ca2.crt \ |
| 10511 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10512 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10513 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10514 | 0 \ |
| 10515 | -S "found fragmented DTLS handshake message" \ |
| 10516 | -C "found fragmented DTLS handshake message" \ |
| 10517 | -C "error" |
| 10518 | |
| 10519 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10520 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10521 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10522 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10523 | run_test "DTLS fragmenting: client (MTU)" \ |
| 10524 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10525 | crt_file=data_files/server7_int-ca.crt \ |
| 10526 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10527 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10528 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10529 | "$P_CLI dtls=1 debug_level=2 \ |
| 10530 | crt_file=data_files/server8_int-ca2.crt \ |
| 10531 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10532 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10533 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10534 | 0 \ |
| 10535 | -s "found fragmented DTLS handshake message" \ |
| 10536 | -C "found fragmented DTLS handshake message" \ |
| 10537 | -C "error" |
| 10538 | |
| 10539 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10540 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10541 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10542 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10543 | run_test "DTLS fragmenting: server (MTU)" \ |
| 10544 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10545 | crt_file=data_files/server7_int-ca.crt \ |
| 10546 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10547 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10548 | mtu=512" \ |
| 10549 | "$P_CLI dtls=1 debug_level=2 \ |
| 10550 | crt_file=data_files/server8_int-ca2.crt \ |
| 10551 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10552 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10553 | mtu=2048" \ |
| 10554 | 0 \ |
| 10555 | -S "found fragmented DTLS handshake message" \ |
| 10556 | -c "found fragmented DTLS handshake message" \ |
| 10557 | -C "error" |
| 10558 | |
| 10559 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10560 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10561 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10562 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10563 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10564 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10565 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10566 | crt_file=data_files/server7_int-ca.crt \ |
| 10567 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10568 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 10569 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10570 | "$P_CLI dtls=1 debug_level=2 \ |
| 10571 | crt_file=data_files/server8_int-ca2.crt \ |
| 10572 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10573 | hs_timeout=2500-60000 \ |
| 10574 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10575 | 0 \ |
| 10576 | -s "found fragmented DTLS handshake message" \ |
| 10577 | -c "found fragmented DTLS handshake message" \ |
| 10578 | -C "error" |
| 10579 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10580 | # 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] | 10581 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10582 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10583 | requires_hash_alg SHA_256 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10584 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10585 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 10586 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 10587 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10588 | crt_file=data_files/server7_int-ca.crt \ |
| 10589 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10590 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 10591 | mtu=512" \ |
| 10592 | "$P_CLI dtls=1 debug_level=2 \ |
| 10593 | crt_file=data_files/server8_int-ca2.crt \ |
| 10594 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10595 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10596 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10597 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10598 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10599 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10600 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10601 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10602 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10603 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10604 | # 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] | 10605 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 10606 | # retransmissions, but in some cases (like both the server and client using |
| 10607 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 10608 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 10609 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10610 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10611 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10612 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 10613 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10614 | -p "$P_PXY mtu=508" \ |
| 10615 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10616 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10617 | key_file=data_files/server7.key \ |
| 10618 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10619 | "$P_CLI dtls=1 debug_level=2 \ |
| 10620 | crt_file=data_files/server8_int-ca2.crt \ |
| 10621 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10622 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10623 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10624 | 0 \ |
| 10625 | -s "found fragmented DTLS handshake message" \ |
| 10626 | -c "found fragmented DTLS handshake message" \ |
| 10627 | -C "error" |
| 10628 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10629 | # 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] | 10630 | only_with_valgrind |
| 10631 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10632 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10633 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 10634 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10635 | -p "$P_PXY mtu=508" \ |
| 10636 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10637 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10638 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10639 | hs_timeout=250-10000" \ |
| 10640 | "$P_CLI dtls=1 debug_level=2 \ |
| 10641 | crt_file=data_files/server8_int-ca2.crt \ |
| 10642 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10643 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10644 | hs_timeout=250-10000" \ |
| 10645 | 0 \ |
| 10646 | -s "found fragmented DTLS handshake message" \ |
| 10647 | -c "found fragmented DTLS handshake message" \ |
| 10648 | -C "error" |
| 10649 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10650 | # 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] | 10651 | # OTOH the client might resend if the server is to slow to reset after sending |
| 10652 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10653 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10654 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10655 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10656 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10657 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10658 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10659 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10660 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10661 | crt_file=data_files/server7_int-ca.crt \ |
| 10662 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10663 | hs_timeout=10000-60000 \ |
| 10664 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10665 | "$P_CLI dtls=1 debug_level=2 \ |
| 10666 | crt_file=data_files/server8_int-ca2.crt \ |
| 10667 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10668 | hs_timeout=10000-60000 \ |
| 10669 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10670 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10671 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10672 | -s "found fragmented DTLS handshake message" \ |
| 10673 | -c "found fragmented DTLS handshake message" \ |
| 10674 | -C "error" |
| 10675 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10676 | # 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] | 10677 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 10678 | # OTOH the client might resend if the server is to slow to reset after sending |
| 10679 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10680 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10681 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10682 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10683 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10684 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10685 | -p "$P_PXY mtu=512" \ |
| 10686 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10687 | crt_file=data_files/server7_int-ca.crt \ |
| 10688 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10689 | hs_timeout=10000-60000 \ |
| 10690 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10691 | "$P_CLI dtls=1 debug_level=2 \ |
| 10692 | crt_file=data_files/server8_int-ca2.crt \ |
| 10693 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10694 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10695 | hs_timeout=10000-60000 \ |
| 10696 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10697 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10698 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10699 | -s "found fragmented DTLS handshake message" \ |
| 10700 | -c "found fragmented DTLS handshake message" \ |
| 10701 | -C "error" |
| 10702 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10703 | not_with_valgrind # spurious autoreduction due to timeout |
| 10704 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10705 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10706 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10707 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10708 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10709 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10710 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10711 | crt_file=data_files/server7_int-ca.crt \ |
| 10712 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10713 | hs_timeout=10000-60000 \ |
| 10714 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10715 | "$P_CLI dtls=1 debug_level=2 \ |
| 10716 | crt_file=data_files/server8_int-ca2.crt \ |
| 10717 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10718 | hs_timeout=10000-60000 \ |
| 10719 | mtu=1024 nbio=2" \ |
| 10720 | 0 \ |
| 10721 | -S "autoreduction" \ |
| 10722 | -s "found fragmented DTLS handshake message" \ |
| 10723 | -c "found fragmented DTLS handshake message" \ |
| 10724 | -C "error" |
| 10725 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10726 | # 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] | 10727 | not_with_valgrind # spurious autoreduction due to timeout |
| 10728 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10729 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10730 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10731 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 10732 | -p "$P_PXY mtu=512" \ |
| 10733 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10734 | crt_file=data_files/server7_int-ca.crt \ |
| 10735 | key_file=data_files/server7.key \ |
| 10736 | hs_timeout=10000-60000 \ |
| 10737 | mtu=512 nbio=2" \ |
| 10738 | "$P_CLI dtls=1 debug_level=2 \ |
| 10739 | crt_file=data_files/server8_int-ca2.crt \ |
| 10740 | key_file=data_files/server8.key \ |
| 10741 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10742 | hs_timeout=10000-60000 \ |
| 10743 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10744 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10745 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10746 | -s "found fragmented DTLS handshake message" \ |
| 10747 | -c "found fragmented DTLS handshake message" \ |
| 10748 | -C "error" |
| 10749 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10750 | # 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] | 10751 | # This ensures things still work after session_reset(). |
| 10752 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 10753 | # Since we don't support reading fragmented ClientHello yet, |
| 10754 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 10755 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10756 | # An autoreduction on the client-side might happen if the server is |
| 10757 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 10758 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10759 | # resumed listening, which would result in a spurious autoreduction. |
| 10760 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 10761 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10762 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10763 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 10764 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 10765 | -p "$P_PXY mtu=1450" \ |
| 10766 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10767 | crt_file=data_files/server7_int-ca.crt \ |
| 10768 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10769 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 10770 | mtu=1450" \ |
| 10771 | "$P_CLI dtls=1 debug_level=2 \ |
| 10772 | crt_file=data_files/server8_int-ca2.crt \ |
| 10773 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10774 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10775 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 10776 | 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] | 10777 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10778 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 10779 | -s "found fragmented DTLS handshake message" \ |
| 10780 | -c "found fragmented DTLS handshake message" \ |
| 10781 | -C "error" |
| 10782 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10783 | # An autoreduction on the client-side might happen if the server is |
| 10784 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10785 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10786 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10787 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10788 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10789 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10790 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10791 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 10792 | -p "$P_PXY mtu=512" \ |
| 10793 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10794 | crt_file=data_files/server7_int-ca.crt \ |
| 10795 | key_file=data_files/server7.key \ |
| 10796 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10797 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10798 | mtu=512" \ |
| 10799 | "$P_CLI dtls=1 debug_level=2 \ |
| 10800 | crt_file=data_files/server8_int-ca2.crt \ |
| 10801 | key_file=data_files/server8.key \ |
| 10802 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Ronald Cron | 60f7666 | 2023-11-28 17:52:42 +0100 | [diff] [blame] | 10803 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10804 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10805 | mtu=512" \ |
| 10806 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10807 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10808 | -s "found fragmented DTLS handshake message" \ |
| 10809 | -c "found fragmented DTLS handshake message" \ |
| 10810 | -C "error" |
| 10811 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10812 | # An autoreduction on the client-side might happen if the server is |
| 10813 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10814 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10815 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10816 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10817 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10818 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10819 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10820 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 10821 | -p "$P_PXY mtu=512" \ |
| 10822 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10823 | crt_file=data_files/server7_int-ca.crt \ |
| 10824 | key_file=data_files/server7.key \ |
| 10825 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10826 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10827 | mtu=512" \ |
| 10828 | "$P_CLI dtls=1 debug_level=2 \ |
| 10829 | crt_file=data_files/server8_int-ca2.crt \ |
| 10830 | key_file=data_files/server8.key \ |
| 10831 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10832 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10833 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10834 | mtu=512" \ |
| 10835 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10836 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10837 | -s "found fragmented DTLS handshake message" \ |
| 10838 | -c "found fragmented DTLS handshake message" \ |
| 10839 | -C "error" |
| 10840 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10841 | # An autoreduction on the client-side might happen if the server is |
| 10842 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10843 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10844 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10845 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10846 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10847 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10848 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10849 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10850 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10851 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10852 | crt_file=data_files/server7_int-ca.crt \ |
| 10853 | key_file=data_files/server7.key \ |
| 10854 | exchanges=2 renegotiation=1 \ |
| 10855 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10856 | hs_timeout=10000-60000 \ |
| 10857 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10858 | "$P_CLI dtls=1 debug_level=2 \ |
| 10859 | crt_file=data_files/server8_int-ca2.crt \ |
| 10860 | key_file=data_files/server8.key \ |
| 10861 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10862 | hs_timeout=10000-60000 \ |
| 10863 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10864 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10865 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10866 | -s "found fragmented DTLS handshake message" \ |
| 10867 | -c "found fragmented DTLS handshake message" \ |
| 10868 | -C "error" |
| 10869 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10870 | # An autoreduction on the client-side might happen if the server is |
| 10871 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10872 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10873 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10874 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10875 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10876 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10877 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10878 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10879 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10880 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10881 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10882 | crt_file=data_files/server7_int-ca.crt \ |
| 10883 | key_file=data_files/server7.key \ |
| 10884 | exchanges=2 renegotiation=1 \ |
| 10885 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10886 | hs_timeout=10000-60000 \ |
| 10887 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10888 | "$P_CLI dtls=1 debug_level=2 \ |
| 10889 | crt_file=data_files/server8_int-ca2.crt \ |
| 10890 | key_file=data_files/server8.key \ |
| 10891 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10892 | hs_timeout=10000-60000 \ |
| 10893 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10894 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10895 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10896 | -s "found fragmented DTLS handshake message" \ |
| 10897 | -c "found fragmented DTLS handshake message" \ |
| 10898 | -C "error" |
| 10899 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10900 | # An autoreduction on the client-side might happen if the server is |
| 10901 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10902 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10903 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10904 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10905 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10906 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10907 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10908 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10909 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10910 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10911 | crt_file=data_files/server7_int-ca.crt \ |
| 10912 | key_file=data_files/server7.key \ |
| 10913 | exchanges=2 renegotiation=1 \ |
| 10914 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10915 | hs_timeout=10000-60000 \ |
| 10916 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10917 | "$P_CLI dtls=1 debug_level=2 \ |
| 10918 | crt_file=data_files/server8_int-ca2.crt \ |
| 10919 | key_file=data_files/server8.key \ |
| 10920 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10921 | hs_timeout=10000-60000 \ |
| 10922 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10923 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10924 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10925 | -s "found fragmented DTLS handshake message" \ |
| 10926 | -c "found fragmented DTLS handshake message" \ |
| 10927 | -C "error" |
| 10928 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10929 | # 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] | 10930 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10931 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10932 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10933 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10934 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 10935 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10936 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 auth_mode=required \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10937 | crt_file=data_files/server7_int-ca.crt \ |
| 10938 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 10939 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10940 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10941 | crt_file=data_files/server8_int-ca2.crt \ |
| 10942 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10943 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 10944 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10945 | 0 \ |
| 10946 | -s "found fragmented DTLS handshake message" \ |
| 10947 | -c "found fragmented DTLS handshake message" \ |
| 10948 | -C "error" |
| 10949 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10950 | # 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] | 10951 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10952 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10953 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10954 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10955 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 10956 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 10957 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10958 | crt_file=data_files/server7_int-ca.crt \ |
| 10959 | key_file=data_files/server7.key \ |
| 10960 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 10961 | "$P_CLI dtls=1 debug_level=2 \ |
| 10962 | crt_file=data_files/server8_int-ca2.crt \ |
| 10963 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10964 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10965 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 10966 | 0 \ |
| 10967 | -s "found fragmented DTLS handshake message" \ |
| 10968 | -c "found fragmented DTLS handshake message" \ |
| 10969 | -C "error" |
| 10970 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10971 | # interop tests for DTLS fragmentating with reliable connection |
| 10972 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10973 | # here and below we just want to test that the we fragment in a way that |
| 10974 | # pleases other implementations, so we don't need the peer to fragment |
| 10975 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10976 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 10977 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10978 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10979 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 10980 | "$G_SRV -u" \ |
| 10981 | "$P_CLI dtls=1 debug_level=2 \ |
| 10982 | crt_file=data_files/server8_int-ca2.crt \ |
| 10983 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10984 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10985 | 0 \ |
| 10986 | -c "fragmenting handshake message" \ |
| 10987 | -C "error" |
| 10988 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 10989 | # We use --insecure for the GnuTLS client because it expects |
| 10990 | # the hostname / IP it connects to to be the name used in the |
| 10991 | # certificate obtained from the server. Here, however, it |
| 10992 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 10993 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 10994 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 10995 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10996 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10997 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 10998 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 10999 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11000 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11001 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Valerio Setti | 3b2c028 | 2023-03-08 10:22:29 +0100 | [diff] [blame] | 11002 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11003 | crt_file=data_files/server7_int-ca.crt \ |
| 11004 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11005 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 11006 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11007 | 0 \ |
| 11008 | -s "fragmenting handshake message" |
| 11009 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11010 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11011 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11012 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11013 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 11014 | "$O_SRV -dtls1_2 -verify 10" \ |
| 11015 | "$P_CLI dtls=1 debug_level=2 \ |
| 11016 | crt_file=data_files/server8_int-ca2.crt \ |
| 11017 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11018 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11019 | 0 \ |
| 11020 | -c "fragmenting handshake message" \ |
| 11021 | -C "error" |
| 11022 | |
| 11023 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11024 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11025 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11026 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 11027 | "$P_SRV dtls=1 debug_level=2 \ |
| 11028 | crt_file=data_files/server7_int-ca.crt \ |
| 11029 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11030 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11031 | "$O_CLI -dtls1_2" \ |
| 11032 | 0 \ |
| 11033 | -s "fragmenting handshake message" |
| 11034 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11035 | # interop tests for DTLS fragmentating with unreliable connection |
| 11036 | # |
| 11037 | # again we just want to test that the we fragment in a way that |
| 11038 | # pleases other implementations, so we don't need the peer to fragment |
| 11039 | requires_gnutls_next |
| 11040 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11041 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11042 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11043 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11044 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 11045 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11046 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11047 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11048 | crt_file=data_files/server8_int-ca2.crt \ |
| 11049 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11050 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11051 | 0 \ |
| 11052 | -c "fragmenting handshake message" \ |
| 11053 | -C "error" |
| 11054 | |
| 11055 | requires_gnutls_next |
| 11056 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11057 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11058 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11059 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11060 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 11061 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11062 | "$P_SRV dtls=1 debug_level=2 \ |
| 11063 | crt_file=data_files/server7_int-ca.crt \ |
| 11064 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11065 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11066 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11067 | 0 \ |
| 11068 | -s "fragmenting handshake message" |
| 11069 | |
Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 11070 | ## The test below requires 1.1.1a or higher version of openssl, otherwise |
| 11071 | ## 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] | 11072 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11073 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11074 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11075 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11076 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11077 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 11078 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11079 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11080 | "$P_CLI dtls=1 debug_level=2 \ |
| 11081 | crt_file=data_files/server8_int-ca2.crt \ |
| 11082 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11083 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11084 | 0 \ |
| 11085 | -c "fragmenting handshake message" \ |
| 11086 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11087 | |
Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 11088 | ## the test below will time out with certain seed. |
Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 11089 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 11090 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11091 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11092 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11093 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11094 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11095 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 11096 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11097 | "$P_SRV dtls=1 debug_level=2 \ |
| 11098 | crt_file=data_files/server7_int-ca.crt \ |
| 11099 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11100 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11101 | "$O_CLI -dtls1_2" \ |
| 11102 | 0 \ |
| 11103 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11104 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11105 | # Tests for DTLS-SRTP (RFC 5764) |
| 11106 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11107 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11108 | run_test "DTLS-SRTP all profiles supported" \ |
| 11109 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11110 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11111 | 0 \ |
| 11112 | -s "found use_srtp extension" \ |
| 11113 | -s "found srtp profile" \ |
| 11114 | -s "selected srtp profile" \ |
| 11115 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11116 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11117 | -c "client hello, adding use_srtp extension" \ |
| 11118 | -c "found use_srtp extension" \ |
| 11119 | -c "found srtp profile" \ |
| 11120 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11121 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11122 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11123 | -C "error" |
| 11124 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11125 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11126 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11127 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11128 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 11129 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11130 | "$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] | 11131 | 0 \ |
| 11132 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11133 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 11134 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11135 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11136 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11137 | -c "client hello, adding use_srtp extension" \ |
| 11138 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11139 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11140 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11141 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11142 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11143 | -C "error" |
| 11144 | |
| 11145 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11147 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11148 | "$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] | 11149 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11150 | 0 \ |
| 11151 | -s "found use_srtp extension" \ |
| 11152 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11153 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11154 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11155 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11156 | -c "client hello, adding use_srtp extension" \ |
| 11157 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11158 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11159 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11160 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11161 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11162 | -C "error" |
| 11163 | |
| 11164 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11165 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11166 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 11167 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11168 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11169 | 0 \ |
| 11170 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11171 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11172 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11173 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11174 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11175 | -c "client hello, adding use_srtp extension" \ |
| 11176 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11177 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11178 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11179 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11180 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11181 | -C "error" |
| 11182 | |
| 11183 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11184 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11185 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 11186 | "$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] | 11187 | "$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] | 11188 | 0 \ |
| 11189 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11190 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11191 | -S "selected srtp profile" \ |
| 11192 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11193 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11194 | -c "client hello, adding use_srtp extension" \ |
| 11195 | -C "found use_srtp extension" \ |
| 11196 | -C "found srtp profile" \ |
| 11197 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11198 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11199 | -C "error" |
| 11200 | |
| 11201 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11202 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11203 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 11204 | "$P_SRV dtls=1 debug_level=3" \ |
| 11205 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11206 | 0 \ |
| 11207 | -s "found use_srtp extension" \ |
| 11208 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11209 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11210 | -c "client hello, adding use_srtp extension" \ |
| 11211 | -C "found use_srtp extension" \ |
| 11212 | -C "found srtp profile" \ |
| 11213 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11214 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11215 | -C "error" |
| 11216 | |
| 11217 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11218 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11219 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 11220 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 11221 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11222 | 0 \ |
| 11223 | -s "found use_srtp extension" \ |
| 11224 | -s "found srtp profile" \ |
| 11225 | -s "selected srtp profile" \ |
| 11226 | -s "server hello, adding use_srtp extension" \ |
| 11227 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11228 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11229 | -c "client hello, adding use_srtp extension" \ |
| 11230 | -c "found use_srtp extension" \ |
| 11231 | -c "found srtp profile" \ |
| 11232 | -c "selected srtp profile" \ |
| 11233 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11234 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11235 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11236 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 11237 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11238 | -C "error" |
| 11239 | |
| 11240 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11241 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11242 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 11243 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11244 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11245 | 0 \ |
| 11246 | -s "found use_srtp extension" \ |
| 11247 | -s "found srtp profile" \ |
| 11248 | -s "selected srtp profile" \ |
| 11249 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11250 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 11251 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11252 | -S "dumping 'using mki' (8 bytes)" \ |
| 11253 | -c "client hello, adding use_srtp extension" \ |
| 11254 | -c "found use_srtp extension" \ |
| 11255 | -c "found srtp profile" \ |
| 11256 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11257 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 11258 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11259 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11260 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11261 | -C "dumping 'received mki' (8 bytes)" \ |
| 11262 | -C "error" |
| 11263 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11264 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11265 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11266 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 11267 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11268 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11269 | 0 \ |
| 11270 | -s "found use_srtp extension" \ |
| 11271 | -s "found srtp profile" \ |
| 11272 | -s "selected srtp profile" \ |
| 11273 | -s "server hello, adding use_srtp extension" \ |
| 11274 | -s "DTLS-SRTP key material is"\ |
| 11275 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11276 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 11277 | |
| 11278 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11279 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11280 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 11281 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11282 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11283 | 0 \ |
| 11284 | -s "found use_srtp extension" \ |
| 11285 | -s "found srtp profile" \ |
| 11286 | -s "selected srtp profile" \ |
| 11287 | -s "server hello, adding use_srtp extension" \ |
| 11288 | -s "DTLS-SRTP key material is"\ |
| 11289 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11290 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11291 | |
| 11292 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11293 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11294 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 11295 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11296 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11297 | 0 \ |
| 11298 | -s "found use_srtp extension" \ |
| 11299 | -s "found srtp profile" \ |
| 11300 | -s "selected srtp profile" \ |
| 11301 | -s "server hello, adding use_srtp extension" \ |
| 11302 | -s "DTLS-SRTP key material is"\ |
| 11303 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11304 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11305 | |
| 11306 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11307 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11308 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 11309 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11310 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11311 | 0 \ |
| 11312 | -s "found use_srtp extension" \ |
| 11313 | -s "found srtp profile" \ |
| 11314 | -s "selected srtp profile" \ |
| 11315 | -s "server hello, adding use_srtp extension" \ |
| 11316 | -s "DTLS-SRTP key material is"\ |
| 11317 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11318 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11319 | |
| 11320 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11321 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11322 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 11323 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11324 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11325 | 0 \ |
| 11326 | -s "found use_srtp extension" \ |
| 11327 | -s "found srtp profile" \ |
| 11328 | -s "selected srtp profile" \ |
| 11329 | -s "server hello, adding use_srtp extension" \ |
| 11330 | -s "DTLS-SRTP key material is"\ |
| 11331 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11332 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11333 | |
| 11334 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11335 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11336 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 11337 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 11338 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11339 | 0 \ |
| 11340 | -s "found use_srtp extension" \ |
| 11341 | -s "found srtp profile" \ |
| 11342 | -S "selected srtp profile" \ |
| 11343 | -S "server hello, adding use_srtp extension" \ |
| 11344 | -S "DTLS-SRTP key material is"\ |
| 11345 | -C "SRTP Extension negotiated, profile" |
| 11346 | |
| 11347 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11348 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11349 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 11350 | "$P_SRV dtls=1 debug_level=3" \ |
| 11351 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11352 | 0 \ |
| 11353 | -s "found use_srtp extension" \ |
| 11354 | -S "server hello, adding use_srtp extension" \ |
| 11355 | -S "DTLS-SRTP key material is"\ |
| 11356 | -C "SRTP Extension negotiated, profile" |
| 11357 | |
| 11358 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11359 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11360 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 11361 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11362 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11363 | 0 \ |
| 11364 | -c "client hello, adding use_srtp extension" \ |
| 11365 | -c "found use_srtp extension" \ |
| 11366 | -c "found srtp profile" \ |
| 11367 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 11368 | -c "DTLS-SRTP key material is"\ |
| 11369 | -C "error" |
| 11370 | |
| 11371 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11372 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11373 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 11374 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11375 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11376 | 0 \ |
| 11377 | -c "client hello, adding use_srtp extension" \ |
| 11378 | -c "found use_srtp extension" \ |
| 11379 | -c "found srtp profile" \ |
| 11380 | -c "selected srtp profile" \ |
| 11381 | -c "DTLS-SRTP key material is"\ |
| 11382 | -C "error" |
| 11383 | |
| 11384 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11385 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11386 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 11387 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11388 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11389 | 0 \ |
| 11390 | -c "client hello, adding use_srtp extension" \ |
| 11391 | -c "found use_srtp extension" \ |
| 11392 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11393 | -c "selected srtp profile" \ |
| 11394 | -c "DTLS-SRTP key material is"\ |
| 11395 | -C "error" |
| 11396 | |
| 11397 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11398 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11399 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 11400 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11401 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11402 | 0 \ |
| 11403 | -c "client hello, adding use_srtp extension" \ |
| 11404 | -c "found use_srtp extension" \ |
| 11405 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11406 | -c "selected srtp profile" \ |
| 11407 | -c "DTLS-SRTP key material is"\ |
| 11408 | -C "error" |
| 11409 | |
| 11410 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11411 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11412 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 11413 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11414 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11415 | 0 \ |
| 11416 | -c "client hello, adding use_srtp extension" \ |
| 11417 | -c "found use_srtp extension" \ |
| 11418 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11419 | -c "selected srtp profile" \ |
| 11420 | -c "DTLS-SRTP key material is"\ |
| 11421 | -C "error" |
| 11422 | |
| 11423 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11424 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11425 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 11426 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11427 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 11428 | 0 \ |
| 11429 | -c "client hello, adding use_srtp extension" \ |
| 11430 | -C "found use_srtp extension" \ |
| 11431 | -C "found srtp profile" \ |
| 11432 | -C "selected srtp profile" \ |
| 11433 | -C "DTLS-SRTP key material is"\ |
| 11434 | -C "error" |
| 11435 | |
| 11436 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11437 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11438 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 11439 | "$O_SRV -dtls" \ |
| 11440 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11441 | 0 \ |
| 11442 | -c "client hello, adding use_srtp extension" \ |
| 11443 | -C "found use_srtp extension" \ |
| 11444 | -C "found srtp profile" \ |
| 11445 | -C "selected srtp profile" \ |
| 11446 | -C "DTLS-SRTP key material is"\ |
| 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 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11451 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 11452 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11453 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11454 | 0 \ |
| 11455 | -c "client hello, adding use_srtp extension" \ |
| 11456 | -c "found use_srtp extension" \ |
| 11457 | -c "found srtp profile" \ |
| 11458 | -c "selected srtp profile" \ |
| 11459 | -c "DTLS-SRTP key material is"\ |
| 11460 | -c "DTLS-SRTP no mki value negotiated"\ |
| 11461 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11462 | -C "dumping 'received mki' (8 bytes)" \ |
| 11463 | -C "error" |
| 11464 | |
| 11465 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11466 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11467 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11468 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11469 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11470 | "$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] | 11471 | 0 \ |
| 11472 | -s "found use_srtp extension" \ |
| 11473 | -s "found srtp profile" \ |
| 11474 | -s "selected srtp profile" \ |
| 11475 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11476 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11477 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 11478 | |
| 11479 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11480 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11481 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11482 | 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] | 11483 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11484 | "$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] | 11485 | 0 \ |
| 11486 | -s "found use_srtp extension" \ |
| 11487 | -s "found srtp profile" \ |
| 11488 | -s "selected srtp profile" \ |
| 11489 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11490 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11491 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 11492 | |
| 11493 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11494 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11496 | 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] | 11497 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11498 | "$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] | 11499 | 0 \ |
| 11500 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11501 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11502 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11503 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11504 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11505 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 11506 | |
| 11507 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11508 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11509 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11510 | 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] | 11511 | "$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] | 11512 | "$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] | 11513 | 0 \ |
| 11514 | -s "found use_srtp extension" \ |
| 11515 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11516 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11517 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11518 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11519 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 11520 | |
| 11521 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11522 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11524 | 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] | 11525 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11526 | "$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] | 11527 | 0 \ |
| 11528 | -s "found use_srtp extension" \ |
| 11529 | -s "found srtp profile" \ |
| 11530 | -s "selected srtp profile" \ |
| 11531 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11532 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11533 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 11534 | |
| 11535 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11536 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11537 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11538 | 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] | 11539 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 11540 | "$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] | 11541 | 0 \ |
| 11542 | -s "found use_srtp extension" \ |
| 11543 | -s "found srtp profile" \ |
| 11544 | -S "selected srtp profile" \ |
| 11545 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11546 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11547 | -C "SRTP profile:" |
| 11548 | |
| 11549 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11550 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11551 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11552 | 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] | 11553 | "$P_SRV dtls=1 debug_level=3" \ |
| 11554 | "$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] | 11555 | 0 \ |
| 11556 | -s "found use_srtp extension" \ |
| 11557 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11558 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11559 | -C "SRTP profile:" |
| 11560 | |
| 11561 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11562 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11563 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11564 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 11565 | "$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" \ |
| 11566 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11567 | 0 \ |
| 11568 | -c "client hello, adding use_srtp extension" \ |
| 11569 | -c "found use_srtp extension" \ |
| 11570 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11571 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11572 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11573 | -C "error" |
| 11574 | |
| 11575 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11576 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11577 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11578 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 11579 | "$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" \ |
| 11580 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11581 | 0 \ |
| 11582 | -c "client hello, adding use_srtp extension" \ |
| 11583 | -c "found use_srtp extension" \ |
| 11584 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11585 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11586 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11587 | -C "error" |
| 11588 | |
| 11589 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11590 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11591 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11592 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 11593 | "$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" \ |
| 11594 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11595 | 0 \ |
| 11596 | -c "client hello, adding use_srtp extension" \ |
| 11597 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11598 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11599 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11600 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11601 | -C "error" |
| 11602 | |
| 11603 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11604 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11605 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11606 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 11607 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11608 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11609 | 0 \ |
| 11610 | -c "client hello, adding use_srtp extension" \ |
| 11611 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11612 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11613 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11614 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11615 | -C "error" |
| 11616 | |
| 11617 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11618 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11619 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11620 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 11621 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11622 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11623 | 0 \ |
| 11624 | -c "client hello, adding use_srtp extension" \ |
| 11625 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11626 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11627 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11628 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11629 | -C "error" |
| 11630 | |
| 11631 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11632 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11633 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11634 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 11635 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11636 | "$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] | 11637 | 0 \ |
| 11638 | -c "client hello, adding use_srtp extension" \ |
| 11639 | -C "found use_srtp extension" \ |
| 11640 | -C "found srtp profile" \ |
| 11641 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11642 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11643 | -C "error" |
| 11644 | |
| 11645 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11646 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11647 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11648 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 11649 | "$G_SRV -u" \ |
| 11650 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11651 | 0 \ |
| 11652 | -c "client hello, adding use_srtp extension" \ |
| 11653 | -C "found use_srtp extension" \ |
| 11654 | -C "found srtp profile" \ |
| 11655 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11656 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11657 | -C "error" |
| 11658 | |
| 11659 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11660 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11661 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11662 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 11663 | "$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" \ |
| 11664 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11665 | 0 \ |
| 11666 | -c "client hello, adding use_srtp extension" \ |
| 11667 | -c "found use_srtp extension" \ |
| 11668 | -c "found srtp profile" \ |
| 11669 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11670 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 11671 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11672 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11673 | -c "dumping 'received mki' (8 bytes)" \ |
| 11674 | -C "error" |
| 11675 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 11676 | # Tests for specific things with "unreliable" UDP connection |
| 11677 | |
| 11678 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11679 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 11680 | run_test "DTLS proxy: reference" \ |
| 11681 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 11682 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 11683 | "$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] | 11684 | 0 \ |
| 11685 | -C "replayed record" \ |
| 11686 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 11687 | -C "Buffer record from epoch" \ |
| 11688 | -S "Buffer record from epoch" \ |
| 11689 | -C "ssl_buffer_message" \ |
| 11690 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 11691 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11692 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 11693 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11694 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 11695 | -c "HTTP/1.0 200 OK" |
| 11696 | |
| 11697 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11698 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11699 | run_test "DTLS proxy: duplicate every packet" \ |
| 11700 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 11701 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 11702 | "$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] | 11703 | 0 \ |
| 11704 | -c "replayed record" \ |
| 11705 | -s "replayed record" \ |
| 11706 | -c "record from another epoch" \ |
| 11707 | -s "record from another epoch" \ |
| 11708 | -S "resend" \ |
| 11709 | -s "Extra-header:" \ |
| 11710 | -c "HTTP/1.0 200 OK" |
| 11711 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11712 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11713 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 11714 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11715 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 11716 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 11717 | 0 \ |
| 11718 | -c "replayed record" \ |
| 11719 | -S "replayed record" \ |
| 11720 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11721 | -s "record from another epoch" \ |
| 11722 | -c "resend" \ |
| 11723 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11724 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11725 | -c "HTTP/1.0 200 OK" |
| 11726 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11727 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11728 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 11729 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11730 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 11731 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 11732 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11733 | -c "next record in same datagram" \ |
| 11734 | -s "next record in same datagram" |
| 11735 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11736 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11737 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 11738 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11739 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 11740 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11741 | 0 \ |
| 11742 | -c "next record in same datagram" \ |
| 11743 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11744 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11745 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 11746 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 11747 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11748 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 11749 | "$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] | 11750 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 11751 | -c "discarding invalid record (mac)" \ |
| 11752 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11753 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11754 | -c "HTTP/1.0 200 OK" \ |
| 11755 | -S "too many records with bad MAC" \ |
| 11756 | -S "Verification of the message MAC failed" |
| 11757 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11758 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11759 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 11760 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11761 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 11762 | "$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] | 11763 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 11764 | -C "discarding invalid record (mac)" \ |
| 11765 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11766 | -S "Extra-header:" \ |
| 11767 | -C "HTTP/1.0 200 OK" \ |
| 11768 | -s "too many records with bad MAC" \ |
| 11769 | -s "Verification of the message MAC failed" |
| 11770 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11771 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11772 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 11773 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11774 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 11775 | "$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] | 11776 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 11777 | -c "discarding invalid record (mac)" \ |
| 11778 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11779 | -s "Extra-header:" \ |
| 11780 | -c "HTTP/1.0 200 OK" \ |
| 11781 | -S "too many records with bad MAC" \ |
| 11782 | -S "Verification of the message MAC failed" |
| 11783 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11784 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11785 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 11786 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11787 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 11788 | "$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] | 11789 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 11790 | -c "discarding invalid record (mac)" \ |
| 11791 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11792 | -s "Extra-header:" \ |
| 11793 | -c "HTTP/1.0 200 OK" \ |
| 11794 | -s "too many records with bad MAC" \ |
| 11795 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11796 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11797 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11798 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 11799 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 11800 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 11801 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11802 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11803 | -c "record from another epoch" \ |
| 11804 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11805 | -s "Extra-header:" \ |
| 11806 | -c "HTTP/1.0 200 OK" |
| 11807 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 11808 | # Tests for reordering support with DTLS |
| 11809 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11810 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11811 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11812 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 11813 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11814 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11815 | hs_timeout=2500-60000" \ |
| 11816 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11817 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 11818 | 0 \ |
| 11819 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11820 | -c "Next handshake message has been buffered - load"\ |
| 11821 | -S "Buffering HS message" \ |
| 11822 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11823 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11824 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11825 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11826 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 11827 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11828 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11829 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 11830 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 11831 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11832 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11833 | hs_timeout=2500-60000" \ |
| 11834 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11835 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 11836 | 0 \ |
| 11837 | -c "Buffering HS message" \ |
| 11838 | -c "found fragmented DTLS handshake message"\ |
| 11839 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 11840 | -c "Next handshake message has been buffered - load"\ |
| 11841 | -S "Buffering HS message" \ |
| 11842 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11843 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 11844 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11845 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 11846 | -S "Remember CCS message" |
| 11847 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11848 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 11849 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 11850 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 11851 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11852 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11853 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11854 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11855 | 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] | 11856 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11857 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11858 | hs_timeout=2500-60000" \ |
| 11859 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11860 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 11861 | 0 \ |
| 11862 | -c "Buffering HS message" \ |
| 11863 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11864 | -C "attempt to make space by freeing buffered messages" \ |
| 11865 | -S "Buffering HS message" \ |
| 11866 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11867 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11868 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11869 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11870 | -S "Remember CCS message" |
| 11871 | |
| 11872 | # The size constraints ensure that the delayed certificate message can't |
| 11873 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 11874 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11875 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11876 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 11877 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11878 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11879 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 11880 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11881 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11882 | hs_timeout=2500-60000" \ |
| 11883 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11884 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11885 | 0 \ |
| 11886 | -c "Buffering HS message" \ |
| 11887 | -c "attempt to make space by freeing buffered future messages" \ |
| 11888 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 11889 | -S "Buffering HS message" \ |
| 11890 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11891 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 11892 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11893 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 11894 | -S "Remember CCS message" |
| 11895 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11896 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11897 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11898 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 11899 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11900 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 11901 | hs_timeout=2500-60000" \ |
| 11902 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11903 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11904 | 0 \ |
| 11905 | -C "Buffering HS message" \ |
| 11906 | -C "Next handshake message has been buffered - load"\ |
| 11907 | -s "Buffering HS message" \ |
| 11908 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11909 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11910 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11911 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11912 | -S "Remember CCS message" |
| 11913 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11914 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11915 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 11916 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11917 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 11918 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11919 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11920 | hs_timeout=2500-60000" \ |
| 11921 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11922 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11923 | 0 \ |
| 11924 | -C "Buffering HS message" \ |
| 11925 | -C "Next handshake message has been buffered - load"\ |
| 11926 | -S "Buffering HS message" \ |
| 11927 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11928 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11929 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11930 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11931 | -S "Remember CCS message" |
| 11932 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11933 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11934 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11935 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 11936 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11937 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11938 | hs_timeout=2500-60000" \ |
| 11939 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11940 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11941 | 0 \ |
| 11942 | -C "Buffering HS message" \ |
| 11943 | -C "Next handshake message has been buffered - load"\ |
| 11944 | -S "Buffering HS message" \ |
| 11945 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11946 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11947 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11948 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11949 | -s "Remember CCS message" |
| 11950 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11951 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11952 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11953 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11954 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11955 | hs_timeout=2500-60000" \ |
| 11956 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11957 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 11958 | 0 \ |
| 11959 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11960 | -s "Found buffered record from current epoch - load" \ |
| 11961 | -c "Buffer record from epoch 1" \ |
| 11962 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11963 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11964 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 11965 | # from the server are delayed, so that the encrypted Finished message |
| 11966 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 11967 | # in afterwards, the encrypted Finished message must be freed in order |
| 11968 | # to make space for the NewSessionTicket to be reassembled. |
| 11969 | # This works only in very particular circumstances: |
| 11970 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 11971 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 11972 | # the encrypted Finished message. |
| 11973 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 11974 | # needs to be fragmented. |
| 11975 | # - All messages sent by the server must be small enough to be either sent |
| 11976 | # without fragmentation or be reassembled within the bounds of |
| 11977 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 11978 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 11979 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 11980 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11981 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 11982 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 11983 | "$P_SRV mtu=140 response_size=90 dgram_packing=0 psk=73776f726466697368 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 11984 | "$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] | 11985 | 0 \ |
| 11986 | -s "Buffer record from epoch 1" \ |
| 11987 | -s "Found buffered record from current epoch - load" \ |
| 11988 | -c "Buffer record from epoch 1" \ |
| 11989 | -C "Found buffered record from current epoch - load" \ |
| 11990 | -c "Enough space available after freeing future epoch record" |
| 11991 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 11992 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 11993 | |
| 11994 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11995 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 11996 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11997 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 11998 | psk=73776f726466697368" \ |
| 11999 | "$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] | 12000 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12001 | 0 \ |
| 12002 | -s "Extra-header:" \ |
| 12003 | -c "HTTP/1.0 200 OK" |
| 12004 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12005 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12006 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 12007 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12008 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 12009 | "$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] | 12010 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 12011 | 0 \ |
| 12012 | -s "Extra-header:" \ |
| 12013 | -c "HTTP/1.0 200 OK" |
| 12014 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12015 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12017 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 12018 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12019 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 12020 | "$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] | 12021 | 0 \ |
| 12022 | -s "Extra-header:" \ |
| 12023 | -c "HTTP/1.0 200 OK" |
| 12024 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12025 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12026 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12027 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 12028 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12029 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 12030 | "$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] | 12031 | 0 \ |
| 12032 | -s "Extra-header:" \ |
| 12033 | -c "HTTP/1.0 200 OK" |
| 12034 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12035 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12037 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12038 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 12039 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12040 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 12041 | "$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] | 12042 | 0 \ |
| 12043 | -s "Extra-header:" \ |
| 12044 | -c "HTTP/1.0 200 OK" |
| 12045 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12046 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12047 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12048 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12049 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 12050 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12051 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 12052 | "$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] | 12053 | 0 \ |
| 12054 | -s "Extra-header:" \ |
| 12055 | -c "HTTP/1.0 200 OK" |
| 12056 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12057 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12058 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12059 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12060 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 12061 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12062 | "$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] | 12063 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12064 | "$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] | 12065 | 0 \ |
| 12066 | -s "Extra-header:" \ |
| 12067 | -c "HTTP/1.0 200 OK" |
| 12068 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12069 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 12070 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 12071 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 12072 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12073 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12074 | psk=73776f726466697368 debug_level=3" \ |
| 12075 | "$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] | 12076 | 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] | 12077 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12078 | 0 \ |
| 12079 | -s "a session has been resumed" \ |
| 12080 | -c "a session has been resumed" \ |
| 12081 | -s "Extra-header:" \ |
| 12082 | -c "HTTP/1.0 200 OK" |
| 12083 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12084 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 12085 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 12086 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 12087 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12088 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12089 | psk=73776f726466697368 debug_level=3 nbio=2" \ |
| 12090 | "$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] | 12091 | 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] | 12092 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 12093 | 0 \ |
| 12094 | -s "a session has been resumed" \ |
| 12095 | -c "a session has been resumed" \ |
| 12096 | -s "Extra-header:" \ |
| 12097 | -c "HTTP/1.0 200 OK" |
| 12098 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12099 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12100 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12101 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 12102 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12103 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12104 | psk=73776f726466697368 renegotiation=1 debug_level=2" \ |
| 12105 | "$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] | 12106 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 12107 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12108 | 0 \ |
| 12109 | -c "=> renegotiate" \ |
| 12110 | -s "=> renegotiate" \ |
| 12111 | -s "Extra-header:" \ |
| 12112 | -c "HTTP/1.0 200 OK" |
| 12113 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12114 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12115 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12116 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 12117 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12118 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12119 | psk=73776f726466697368 renegotiation=1 debug_level=2" \ |
| 12120 | "$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] | 12121 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12122 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12123 | 0 \ |
| 12124 | -c "=> renegotiate" \ |
| 12125 | -s "=> renegotiate" \ |
| 12126 | -s "Extra-header:" \ |
| 12127 | -c "HTTP/1.0 200 OK" |
| 12128 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12129 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12130 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12131 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 12132 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12133 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12134 | psk=73776f726466697368 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12135 | debug_level=2" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12136 | "$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] | 12137 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12138 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12139 | 0 \ |
| 12140 | -c "=> renegotiate" \ |
| 12141 | -s "=> renegotiate" \ |
| 12142 | -s "Extra-header:" \ |
| 12143 | -c "HTTP/1.0 200 OK" |
| 12144 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12145 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12146 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12147 | 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] | 12148 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12149 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12150 | psk=73776f726466697368 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12151 | debug_level=2 nbio=2" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12152 | "$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] | 12153 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12154 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12155 | 0 \ |
| 12156 | -c "=> renegotiate" \ |
| 12157 | -s "=> renegotiate" \ |
| 12158 | -s "Extra-header:" \ |
| 12159 | -c "HTTP/1.0 200 OK" |
| 12160 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12161 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 12162 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 12163 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error |
| 12164 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12165 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12166 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12167 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12168 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 12169 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 12170 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ |
| 12171 | "$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] | 12172 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 12173 | -c "HTTP/1.0 200 OK" |
| 12174 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12175 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12176 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12177 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12178 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12179 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 12180 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12181 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12182 | "$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] | 12183 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12184 | -c "HTTP/1.0 200 OK" |
| 12185 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12186 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12187 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12188 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12189 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12190 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 12191 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12192 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12193 | "$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] | 12194 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12195 | -c "HTTP/1.0 200 OK" |
| 12196 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 12197 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12198 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12199 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12201 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 12202 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 12203 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12204 | "$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] | 12205 | 0 \ |
| 12206 | -s "Extra-header:" \ |
| 12207 | -c "Extra-header:" |
| 12208 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12209 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12210 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12211 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12213 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 12214 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12215 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12216 | "$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] | 12217 | 0 \ |
| 12218 | -s "Extra-header:" \ |
| 12219 | -c "Extra-header:" |
| 12220 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12221 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12222 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12223 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12224 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12225 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 12226 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12227 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12228 | "$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] | 12229 | 0 \ |
| 12230 | -s "Extra-header:" \ |
| 12231 | -c "Extra-header:" |
| 12232 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12233 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12234 | run_test "export keys functionality" \ |
| 12235 | "$P_SRV eap_tls=1 debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 12236 | "$P_CLI force_version=tls12 eap_tls=1 debug_level=3" \ |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12237 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 12238 | -c "EAP-TLS key material is:"\ |
| 12239 | -s "EAP-TLS key material is:"\ |
| 12240 | -c "EAP-TLS IV is:" \ |
| 12241 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12242 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 12243 | # openssl feature tests: check if tls1.3 exists. |
| 12244 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12245 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 12246 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 12247 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 12248 | 0 \ |
| 12249 | -c "TLS 1.3" \ |
| 12250 | -s "TLS 1.3" |
| 12251 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 12252 | # 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] | 12253 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 12254 | requires_gnutls_next_no_ticket |
| 12255 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12256 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 12257 | "$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] | 12258 | "$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] | 12259 | 0 \ |
| 12260 | -s "Version: TLS1.3" \ |
| 12261 | -c "Version: TLS1.3" |
| 12262 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 12263 | # TLS1.3 test cases |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12264 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12265 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12266 | requires_ciphersuite_enabled TLS1-3-CHACHA20-POLY1305-SHA256 |
Valerio Setti | cf29c5d | 2023-09-01 09:03:41 +0200 | [diff] [blame] | 12267 | requires_any_configs_enabled "PSA_WANT_ECC_MONTGOMERY_255" |
| 12268 | requires_any_configs_enabled "PSA_WANT_ECC_SECP_R1_256" |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12269 | run_test "TLS 1.3: Default" \ |
| 12270 | "$P_SRV allow_sha1=0 debug_level=3 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13" \ |
| 12271 | "$P_CLI allow_sha1=0" \ |
| 12272 | 0 \ |
| 12273 | -s "Protocol is TLSv1.3" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12274 | -s "Ciphersuite is TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12275 | -s "ECDH/FFDH group: " \ |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12276 | -s "selected signature algorithm ecdsa_secp256r1_sha256" |
| 12277 | |
Ronald Cron | 587cfe6 | 2024-02-08 08:56:09 +0100 | [diff] [blame] | 12278 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12279 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12280 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 12281 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 12282 | run_test "Establish TLS 1.2 then TLS 1.3 session" \ |
| 12283 | "$P_SRV" \ |
| 12284 | "( $P_CLI force_version=tls12; \ |
| 12285 | $P_CLI force_version=tls13 )" \ |
| 12286 | 0 \ |
| 12287 | -s "Protocol is TLSv1.2" \ |
| 12288 | -s "Protocol is TLSv1.3" \ |
| 12289 | |
Ronald Cron | 90abb22 | 2024-02-08 09:02:49 +0100 | [diff] [blame] | 12290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12291 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12292 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 12293 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 12294 | run_test "Establish TLS 1.3 then TLS 1.2 session" \ |
| 12295 | "$P_SRV" \ |
| 12296 | "( $P_CLI force_version=tls13; \ |
| 12297 | $P_CLI force_version=tls12 )" \ |
| 12298 | 0 \ |
| 12299 | -s "Protocol is TLSv1.3" \ |
| 12300 | -s "Protocol is TLSv1.2" \ |
| 12301 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12302 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12303 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12304 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12305 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12306 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12307 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12308 | "$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] | 12309 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 12310 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12311 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12312 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12313 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12314 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12315 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12316 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12317 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12318 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12319 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12320 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12321 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12322 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12323 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12324 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12325 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 12326 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12327 | -c "=> parse certificate verify" \ |
| 12328 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12329 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12330 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 12331 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12332 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 12333 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 12334 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 12335 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12336 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12337 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12338 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12339 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12340 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12341 | "$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] | 12342 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 12343 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12344 | -s "SERVER HELLO was queued" \ |
| 12345 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12346 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12347 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12348 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12349 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12350 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12351 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12352 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12353 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12354 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12355 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12356 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12357 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12358 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12359 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 12360 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12361 | -c "=> parse certificate verify" \ |
| 12362 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12363 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12364 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 12365 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12366 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12367 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12368 | requires_openssl_tls1_3_with_compatible_ephemeral |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12369 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12370 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12371 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12372 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12373 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12374 | run_test "TLS 1.3: alpn - openssl" \ |
| 12375 | "$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] | 12376 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12377 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12378 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12379 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12380 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12381 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12382 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12383 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12384 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12385 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12386 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12387 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12388 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12389 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12390 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12391 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12392 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12393 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12394 | -c "=> parse certificate verify" \ |
| 12395 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12396 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 12397 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12398 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12399 | -c "HTTP/1.0 200 ok" \ |
| 12400 | -c "Application Layer Protocol is h2" |
| 12401 | |
| 12402 | requires_gnutls_tls1_3 |
| 12403 | requires_gnutls_next_no_ticket |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12404 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12405 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12406 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12407 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12408 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12409 | run_test "TLS 1.3: alpn - gnutls" \ |
| 12410 | "$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] | 12411 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12412 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12413 | -s "SERVER HELLO was queued" \ |
| 12414 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12415 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12416 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12417 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12418 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12419 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12420 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12421 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12422 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12423 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12424 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12425 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12426 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12427 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12428 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12429 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12430 | -c "=> parse certificate verify" \ |
| 12431 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12432 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 12433 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12434 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12435 | -c "HTTP/1.0 200 OK" \ |
| 12436 | -c "Application Layer Protocol is h2" |
| 12437 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12438 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12439 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 12440 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12441 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12442 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12443 | run_test "TLS 1.3: server alpn - openssl" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12444 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key alpn=h2" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12445 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ |
| 12446 | 0 \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12447 | -s "found alpn extension" \ |
| 12448 | -s "server side, adding alpn extension" \ |
| 12449 | -s "Protocol is TLSv1.3" \ |
| 12450 | -s "HTTP/1.0 200 OK" \ |
| 12451 | -s "Application Layer Protocol is h2" |
| 12452 | |
| 12453 | requires_gnutls_tls1_3 |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12454 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 12455 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12456 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12457 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12458 | run_test "TLS 1.3: server alpn - gnutls" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12459 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key alpn=h2" \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12460 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ |
| 12461 | 0 \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12462 | -s "found alpn extension" \ |
| 12463 | -s "server side, adding alpn extension" \ |
| 12464 | -s "Protocol is TLSv1.3" \ |
| 12465 | -s "HTTP/1.0 200 OK" \ |
| 12466 | -s "Application Layer Protocol is h2" |
| 12467 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12468 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12469 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12470 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12471 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12472 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12473 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12474 | "$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] | 12475 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12476 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12477 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12478 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12479 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12480 | -c "HTTP/1.0 200 ok" \ |
| 12481 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12482 | |
| 12483 | requires_gnutls_tls1_3 |
| 12484 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12485 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12486 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12487 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12488 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12489 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12490 | "$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] | 12491 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12492 | 0 \ |
| 12493 | -c "got a certificate request" \ |
| 12494 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 12495 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12496 | -c "HTTP/1.0 200 OK" \ |
| 12497 | -c "Protocol is TLSv1.3" |
| 12498 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12499 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12500 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12501 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12502 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12503 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12504 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12505 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12506 | "$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 12507 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12508 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12509 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12510 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12511 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12512 | |
| 12513 | requires_gnutls_tls1_3 |
| 12514 | requires_gnutls_next_no_ticket |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12515 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12516 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12517 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12518 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12519 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12520 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
Jerry Yu | 25e0ddc | 2022-01-29 10:33:13 +0800 | [diff] [blame] | 12521 | key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 12522 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12523 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12524 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12525 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12526 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12527 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12528 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12529 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12530 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12531 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12532 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12533 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12534 | "$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] | 12535 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12536 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 12537 | 0 \ |
| 12538 | -c "got a certificate request" \ |
| 12539 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12540 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12541 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12542 | |
| 12543 | requires_gnutls_tls1_3 |
| 12544 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12545 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12546 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12547 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12548 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12549 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12550 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12551 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12552 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 12553 | 0 \ |
| 12554 | -c "got a certificate request" \ |
| 12555 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12556 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12557 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12558 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12559 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12560 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12561 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12562 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12563 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12564 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12565 | "$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] | 12566 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12567 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 12568 | 0 \ |
| 12569 | -c "got a certificate request" \ |
| 12570 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12571 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12572 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12573 | |
| 12574 | requires_gnutls_tls1_3 |
| 12575 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12576 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12577 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12578 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12579 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12580 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12581 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12582 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12583 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 12584 | 0 \ |
| 12585 | -c "got a certificate request" \ |
| 12586 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12587 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12588 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12589 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12590 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12591 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12592 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12593 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12594 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12595 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12596 | "$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] | 12597 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12598 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 12599 | 0 \ |
| 12600 | -c "got a certificate request" \ |
| 12601 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12602 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12603 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12604 | |
| 12605 | requires_gnutls_tls1_3 |
| 12606 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12607 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12608 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12609 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12610 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12611 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12612 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12613 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12614 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 12615 | 0 \ |
| 12616 | -c "got a certificate request" \ |
| 12617 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12618 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12619 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12620 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12621 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12622 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12623 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12624 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12625 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12626 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12627 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12628 | "$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] | 12629 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 12630 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12631 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12632 | -c "got a certificate request" \ |
| 12633 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12634 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12635 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12636 | |
| 12637 | requires_gnutls_tls1_3 |
| 12638 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12639 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12640 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12641 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12642 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12643 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12644 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12645 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12646 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 12647 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12648 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12649 | -c "got a certificate request" \ |
| 12650 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12651 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12652 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12653 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12654 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12655 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12656 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12657 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12658 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12659 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12660 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 12661 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12662 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12663 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 12664 | 0 \ |
| 12665 | -c "got a certificate request" \ |
| 12666 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12667 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12668 | -c "Protocol is TLSv1.3" |
| 12669 | |
| 12670 | requires_gnutls_tls1_3 |
| 12671 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12672 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12673 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12674 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12675 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12676 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12677 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 12678 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12679 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12680 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 12681 | 0 \ |
| 12682 | -c "got a certificate request" \ |
| 12683 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12684 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12685 | -c "Protocol is TLSv1.3" |
| 12686 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12687 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12688 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12689 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12690 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12691 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12692 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12693 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 12694 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12695 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12696 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 12697 | 0 \ |
| 12698 | -c "got a certificate request" \ |
| 12699 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12700 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12701 | -c "Protocol is TLSv1.3" |
| 12702 | |
| 12703 | requires_gnutls_tls1_3 |
| 12704 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12705 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12706 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12707 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12708 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12709 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12710 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 12711 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12712 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12713 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 12714 | 0 \ |
| 12715 | -c "got a certificate request" \ |
| 12716 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12717 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12718 | -c "Protocol is TLSv1.3" |
| 12719 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12720 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12721 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12722 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12723 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12724 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12725 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 12726 | 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] | 12727 | "$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] | 12728 | -sigalgs ecdsa_secp256r1_sha256" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12729 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 12730 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512" \ |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12731 | 1 \ |
| 12732 | -c "got a certificate request" \ |
| 12733 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12734 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 12735 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12736 | |
| 12737 | requires_gnutls_tls1_3 |
| 12738 | requires_gnutls_next_no_ticket |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12739 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12740 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12741 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12742 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12743 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12744 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 12745 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12746 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 12747 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512" \ |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12748 | 1 \ |
| 12749 | -c "got a certificate request" \ |
| 12750 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12751 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 12752 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12753 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12754 | # Test using an opaque private key for client authentication |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12755 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12756 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12757 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12758 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12759 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12760 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 12761 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
| 12762 | "$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key key_opaque=1" \ |
| 12763 | 0 \ |
| 12764 | -c "got a certificate request" \ |
| 12765 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12766 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12767 | -c "Protocol is TLSv1.3" |
| 12768 | |
| 12769 | requires_gnutls_tls1_3 |
| 12770 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12771 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12772 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12773 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12774 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12775 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 12776 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
| 12777 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
| 12778 | key_file=data_files/cli2.key key_opaque=1" \ |
| 12779 | 0 \ |
| 12780 | -c "got a certificate request" \ |
| 12781 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12782 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12783 | -c "Protocol is TLSv1.3" |
| 12784 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12785 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12786 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12787 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12788 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12789 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12790 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12791 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 12792 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 12793 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 12794 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 12795 | 0 \ |
| 12796 | -c "got a certificate request" \ |
| 12797 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12798 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12799 | -c "Protocol is TLSv1.3" |
| 12800 | |
| 12801 | requires_gnutls_tls1_3 |
| 12802 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12803 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12804 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12805 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12806 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12807 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12808 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 12809 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 12810 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 12811 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 12812 | 0 \ |
| 12813 | -c "got a certificate request" \ |
| 12814 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12815 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12816 | -c "Protocol is TLSv1.3" |
| 12817 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12818 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12819 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12820 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12821 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12822 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12823 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12824 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 12825 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 12826 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 12827 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 12828 | 0 \ |
| 12829 | -c "got a certificate request" \ |
| 12830 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12831 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12832 | -c "Protocol is TLSv1.3" |
| 12833 | |
| 12834 | requires_gnutls_tls1_3 |
| 12835 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12836 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12837 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12838 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12839 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12840 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12841 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 12842 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 12843 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 12844 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 12845 | 0 \ |
| 12846 | -c "got a certificate request" \ |
| 12847 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12848 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12849 | -c "Protocol is TLSv1.3" |
| 12850 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12851 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12852 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12853 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12854 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12855 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12856 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12857 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 12858 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 12859 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 12860 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 12861 | 0 \ |
| 12862 | -c "got a certificate request" \ |
| 12863 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12864 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12865 | -c "Protocol is TLSv1.3" |
| 12866 | |
| 12867 | requires_gnutls_tls1_3 |
| 12868 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12869 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12870 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12871 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12872 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12873 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12874 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 12875 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 12876 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 12877 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 12878 | 0 \ |
| 12879 | -c "got a certificate request" \ |
| 12880 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12881 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12882 | -c "Protocol is TLSv1.3" |
| 12883 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12884 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12885 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12886 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12887 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12888 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12889 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12890 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12891 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 12892 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 12893 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
| 12894 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 12895 | 0 \ |
| 12896 | -c "got a certificate request" \ |
| 12897 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12898 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12899 | -c "Protocol is TLSv1.3" |
| 12900 | |
| 12901 | requires_gnutls_tls1_3 |
| 12902 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12903 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12904 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12905 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12906 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12907 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12908 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12909 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 12910 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 12911 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
| 12912 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 12913 | 0 \ |
| 12914 | -c "got a certificate request" \ |
| 12915 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12916 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12917 | -c "Protocol is TLSv1.3" |
| 12918 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12919 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12920 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12921 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12922 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12923 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
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 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12926 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 12927 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12928 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12929 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 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 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12938 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12939 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12940 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12941 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12942 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12943 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12944 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 12945 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12946 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12947 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 12948 | 0 \ |
| 12949 | -c "got a certificate request" \ |
| 12950 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12951 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12952 | -c "Protocol is TLSv1.3" |
| 12953 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12954 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12955 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12956 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12957 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12958 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12959 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12960 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12961 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 12962 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12963 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12964 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 12965 | 0 \ |
| 12966 | -c "got a certificate request" \ |
| 12967 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12968 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12969 | -c "Protocol is TLSv1.3" |
| 12970 | |
| 12971 | requires_gnutls_tls1_3 |
| 12972 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12973 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12974 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12975 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12976 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12977 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12978 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12979 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \ |
| 12980 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12981 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12982 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 12983 | 0 \ |
| 12984 | -c "got a certificate request" \ |
| 12985 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12986 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12987 | -c "Protocol is TLSv1.3" |
| 12988 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12989 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12990 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12991 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12992 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12993 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12994 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12995 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12996 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 12997 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 12998 | -sigalgs ecdsa_secp256r1_sha256" \ |
| 12999 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 13000 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 13001 | 1 \ |
| 13002 | -c "got a certificate request" \ |
| 13003 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13004 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13005 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13006 | |
| 13007 | requires_gnutls_tls1_3 |
| 13008 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13009 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13010 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13011 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13012 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13013 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13014 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13015 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 13016 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
| 13017 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 13018 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 13019 | 1 \ |
| 13020 | -c "got a certificate request" \ |
| 13021 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13022 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13023 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13024 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13025 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13026 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13027 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13028 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13029 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13030 | 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] | 13031 | "$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] | 13032 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13033 | 0 \ |
| 13034 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13035 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13036 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13037 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13038 | -c "HTTP/1.0 200 ok" |
| 13039 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13040 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13041 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13042 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13043 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13044 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13045 | 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] | 13046 | "$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] | 13047 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 13048 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13049 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13050 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13051 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13052 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 13053 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13054 | |
| 13055 | requires_gnutls_tls1_3 |
| 13056 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13057 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13058 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13059 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13060 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13061 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13062 | 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] | 13063 | "$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] | 13064 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13065 | 0 \ |
| 13066 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13067 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13068 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13069 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13070 | -c "HTTP/1.0 200 OK" |
| 13071 | |
| 13072 | requires_gnutls_tls1_3 |
| 13073 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13074 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13075 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13076 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13077 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13078 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13079 | 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] | 13080 | "$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] | 13081 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 13082 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13083 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13084 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13085 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13086 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 13087 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13088 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13089 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13090 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 13091 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13092 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 13093 | run_test "TLS 1.3: Server side check - openssl" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13094 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13095 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 13096 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 13097 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13098 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13099 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13100 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 13101 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13102 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13103 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 13104 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13105 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13106 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13107 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13108 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13109 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13110 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13111 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Jerry Yu | 7eaadae | 2022-05-23 14:53:27 +0800 | [diff] [blame] | 13112 | "$O_NEXT_CLI -msg -debug -cert data_files/server5.crt -key data_files/server5.key -tls1_3 -no_middlebox" \ |
XiaokangQian | 9a4e1dd | 2022-05-26 00:58:11 +0000 | [diff] [blame] | 13113 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13114 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13115 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13116 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13117 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13118 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 13119 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13120 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13121 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13122 | -s "=> parse client hello" \ |
| 13123 | -s "<= parse client hello" |
| 13124 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13125 | requires_gnutls_tls1_3 |
| 13126 | requires_gnutls_next_no_ticket |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13127 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 13128 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13129 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 13130 | run_test "TLS 1.3: Server side check - gnutls" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13131 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
XiaokangQian | 3f84d5d | 2022-04-19 06:36:17 +0000 | [diff] [blame] | 13132 | "$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] | 13133 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 13134 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13135 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13136 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13137 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 13138 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13139 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13140 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 13141 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 13142 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13143 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13144 | requires_gnutls_tls1_3 |
| 13145 | requires_gnutls_next_no_ticket |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13146 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13147 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13148 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13149 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13150 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13151 | "$G_NEXT_CLI localhost -d 4 --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 13152 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13153 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13154 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13155 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13156 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13157 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 13158 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13159 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13160 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13161 | -s "=> parse client hello" \ |
| 13162 | -s "<= parse client hello" |
| 13163 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13164 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13165 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 13166 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13167 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13168 | run_test "TLS 1.3: Server side check - mbedtls" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13169 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 13170 | "$P_CLI debug_level=4" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 13171 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13172 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13173 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13174 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13175 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13176 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13177 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13178 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 13179 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 13180 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 13181 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13182 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13183 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13184 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13185 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13186 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13187 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13188 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 13189 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 13190 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13191 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13192 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13193 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13194 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13195 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13196 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13197 | -s "=> parse client hello" \ |
| 13198 | -s "<= parse client hello" |
| 13199 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13200 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13201 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13202 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13203 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13204 | run_test "TLS 1.3: Server side check - mbedtls with client empty certificate" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13205 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 13206 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13207 | 1 \ |
| 13208 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13209 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13210 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13211 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13212 | -s "=> write certificate request" \ |
| 13213 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 13214 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13215 | -s "=> parse client hello" \ |
| 13216 | -s "<= parse client hello" |
| 13217 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13218 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13219 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13220 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13221 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13222 | run_test "TLS 1.3: Server side check - mbedtls with optional client authentication" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13223 | "$P_SRV debug_level=4 auth_mode=optional crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 13224 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13225 | 0 \ |
| 13226 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13227 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13228 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13229 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13230 | -s "=> write certificate request" \ |
| 13231 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13232 | -s "=> parse client hello" \ |
| 13233 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13234 | |
| 13235 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13236 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13237 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13238 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13239 | requires_config_enabled PSA_WANT_ALG_ECDH |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13240 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13241 | "$P_SRV debug_level=4 groups=secp384r1" \ |
| 13242 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 13243 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13244 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13245 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13246 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13247 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 13248 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13249 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13250 | -s "=> write hello retry request" \ |
| 13251 | -s "<= write hello retry request" |
| 13252 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13253 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13254 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13255 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13256 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13257 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13258 | "$P_SRV debug_level=4 crt_file=none key_file=none" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 13259 | "$P_CLI debug_level=4" \ |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13260 | 1 \ |
| 13261 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13262 | -s "No certificate available." |
| 13263 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13264 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13265 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13266 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13267 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13268 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13269 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13270 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0 \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 13271 | sni=localhost,data_files/server5.crt,data_files/server5.key,data_files/test-ca_cat12.crt,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13272 | "$O_NEXT_CLI -msg -debug -servername localhost -CAfile data_files/test-ca_cat12.crt -cert data_files/server5.crt -key data_files/server5.key -tls1_3" \ |
| 13273 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13274 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13275 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13276 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 13277 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13278 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13279 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13280 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13281 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13282 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13283 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0 \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 13284 | sni=localhost,data_files/server5.crt,data_files/server5.key,data_files/test-ca_cat12.crt,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13285 | "$G_NEXT_CLI localhost -d 4 --sni-hostname=localhost --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS -V" \ |
| 13286 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13287 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13288 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13289 | |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 13290 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13291 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13292 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13293 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13294 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13295 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13296 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0 \ |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 13297 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 13298 | "$P_CLI debug_level=4 server_name=localhost crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13299 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13300 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13301 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 13302 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 13303 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 13304 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 13305 | TEST_SUITE_NAME=${i##*/} |
| 13306 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 13307 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 13308 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 13309 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 13310 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13311 | # Test 1.3 compatibility mode |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13312 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13313 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13314 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13315 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13316 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13317 | 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] | 13318 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13319 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13320 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13321 | -s "Protocol is TLSv1.3" \ |
| 13322 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13323 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13324 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13325 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13326 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13327 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13328 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13329 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13330 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13331 | run_test "TLS 1.3 m->m both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13332 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13333 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13334 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13335 | -s "Protocol is TLSv1.3" \ |
| 13336 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13337 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13338 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13339 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13340 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13341 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13342 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13343 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13344 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13345 | 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] | 13346 | "$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] | 13347 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13348 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13349 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13350 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13351 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13352 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13353 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13354 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13355 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13356 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13357 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13358 | 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] | 13359 | "$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] | 13360 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13361 | 1 \ |
| 13362 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 13363 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13364 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13365 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13366 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13367 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13368 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13369 | run_test "TLS 1.3 m->O both with middlebox compat support" \ |
| 13370 | "$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] | 13371 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13372 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13373 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13374 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13375 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13376 | requires_gnutls_tls1_3 |
| 13377 | requires_gnutls_next_no_ticket |
| 13378 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13379 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13380 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13381 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13382 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13383 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 13384 | "$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] | 13385 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13386 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13387 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13388 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13389 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13390 | |
| 13391 | requires_gnutls_tls1_3 |
| 13392 | requires_gnutls_next_no_ticket |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13393 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13394 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13395 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13396 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13397 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 13398 | "$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] | 13399 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13400 | 1 \ |
| 13401 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 13402 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13403 | requires_gnutls_tls1_3 |
| 13404 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13405 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13406 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13407 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13408 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13409 | run_test "TLS 1.3 m->G both with middlebox compat support" \ |
| 13410 | "$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] | 13411 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13412 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13413 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13414 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13415 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13416 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13417 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13418 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13419 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13420 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13421 | run_test "TLS 1.3 O->m both peers do not support middlebox compatibility" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13422 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13423 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13424 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13425 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13426 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13427 | -C "14 03 03 00 01" |
| 13428 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13429 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13430 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13431 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13432 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13433 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13434 | run_test "TLS 1.3 O->m server with middlebox compat support, not client" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13435 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13436 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13437 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13438 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13439 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" |
| 13440 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13441 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13442 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13443 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13444 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13445 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13446 | run_test "TLS 1.3 O->m both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13447 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13448 | "$O_NEXT_CLI -msg -debug" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13449 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13450 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13451 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13452 | -c "14 03 03 00 01" |
| 13453 | |
| 13454 | requires_gnutls_tls1_3 |
| 13455 | requires_gnutls_next_no_ticket |
| 13456 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13457 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13458 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13459 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13460 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13461 | run_test "TLS 1.3 G->m both peers do not support middlebox compatibility" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13462 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13463 | "$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] | 13464 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13465 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13466 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13467 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 13468 | |
| 13469 | requires_gnutls_tls1_3 |
| 13470 | requires_gnutls_next_no_ticket |
| 13471 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13472 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13473 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13474 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13475 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13476 | run_test "TLS 1.3 G->m server with middlebox compat support, not client" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13477 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13478 | "$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] | 13479 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13480 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13481 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13482 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 13483 | -c "discarding change cipher spec in TLS1.3" |
| 13484 | |
| 13485 | requires_gnutls_tls1_3 |
| 13486 | requires_gnutls_next_no_ticket |
| 13487 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13488 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13489 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13490 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13491 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13492 | run_test "TLS 1.3 G->m both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13493 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13494 | "$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] | 13495 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13496 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13497 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13498 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 13499 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13500 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13501 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13502 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13503 | requires_config_enabled MBEDTLS_SSL_CLI_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 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13505 | 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] | 13506 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 13507 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13508 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13509 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13510 | -c "Protocol is TLSv1.3" \ |
| 13511 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13512 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13513 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13514 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13515 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13516 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13517 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13518 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13519 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13520 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13521 | run_test "TLS 1.3 m->m HRR both with middlebox compat support" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13522 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 13523 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13524 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13525 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13526 | -c "Protocol is TLSv1.3" \ |
| 13527 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13528 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13529 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13530 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13531 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13532 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13533 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13534 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13535 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13536 | run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ |
| 13537 | "$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] | 13538 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13539 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13540 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13541 | -c "received HelloRetryRequest message" \ |
| 13542 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13543 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13544 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13545 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13546 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13547 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13548 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13549 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13550 | run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ |
| 13551 | "$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] | 13552 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13553 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13554 | -c "received HelloRetryRequest message" \ |
| 13555 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 13556 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13557 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13558 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13559 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13560 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13561 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13562 | run_test "TLS 1.3 m->O HRR both with middlebox compat support" \ |
| 13563 | "$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] | 13564 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13565 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13566 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13567 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13568 | |
| 13569 | requires_gnutls_tls1_3 |
| 13570 | requires_gnutls_next_no_ticket |
| 13571 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13572 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13573 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13574 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13575 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13576 | run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ |
| 13577 | "$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] | 13578 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13579 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13580 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13581 | -c "received HelloRetryRequest message" \ |
| 13582 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13583 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13584 | |
| 13585 | requires_gnutls_tls1_3 |
| 13586 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13587 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13588 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13589 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13590 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13591 | run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \ |
| 13592 | "$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] | 13593 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13594 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13595 | -c "received HelloRetryRequest message" \ |
| 13596 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 13597 | |
| 13598 | requires_gnutls_tls1_3 |
| 13599 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13600 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13601 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13602 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13603 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13604 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13605 | run_test "TLS 1.3 m->G HRR both with middlebox compat support" \ |
| 13606 | "$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] | 13607 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13608 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13609 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13610 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13611 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13612 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13613 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13614 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13615 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13616 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13617 | run_test "TLS 1.3 O->m HRR both peers do not support middlebox compatibility" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13618 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13619 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13620 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13621 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13622 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13623 | -C "14 03 03 00 01" |
| 13624 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13625 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13626 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13627 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13628 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13629 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13630 | run_test "TLS 1.3 O->m HRR server with middlebox compat support, not client" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13631 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13632 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13633 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13634 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13635 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13636 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13637 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13638 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13639 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13640 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13641 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13642 | run_test "TLS 1.3 O->m HRR both with middlebox compat support" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13643 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13644 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13645 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13646 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13647 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13648 | -c "14 03 03 00 01" |
| 13649 | |
| 13650 | requires_gnutls_tls1_3 |
| 13651 | requires_gnutls_next_no_ticket |
| 13652 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13653 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13654 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13655 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13656 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13657 | run_test "TLS 1.3 G->m HRR both peers do not support middlebox compatibility" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13658 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13659 | "$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] | 13660 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13661 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13662 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13663 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 13664 | |
| 13665 | requires_gnutls_tls1_3 |
| 13666 | requires_gnutls_next_no_ticket |
| 13667 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13668 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13669 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13670 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13671 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13672 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13673 | run_test "TLS 1.3 G->m HRR server with middlebox compat support, not client" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13674 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13675 | "$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] | 13676 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13677 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13678 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13679 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 13680 | -c "discarding change cipher spec in TLS1.3" |
| 13681 | |
| 13682 | requires_gnutls_tls1_3 |
| 13683 | requires_gnutls_next_no_ticket |
| 13684 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13685 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13686 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13687 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13688 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13689 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13690 | run_test "TLS 1.3 G->m HRR both with middlebox compat support" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13691 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13692 | "$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] | 13693 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13694 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13695 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13696 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 13697 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13698 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13699 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13700 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13701 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13702 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13703 | run_test "TLS 1.3: Check signature algorithm order, m->O" \ |
| 13704 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 13705 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 13706 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 13707 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 13708 | 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] | 13709 | 0 \ |
| 13710 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13711 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13712 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13713 | |
| 13714 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13715 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13716 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13717 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13718 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13719 | run_test "TLS 1.3: Check signature algorithm order, m->G" \ |
| 13720 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 13721 | -d 4 |
| 13722 | --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 " \ |
| 13723 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 13724 | 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] | 13725 | 0 \ |
| 13726 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13727 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13728 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13729 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13730 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13731 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13732 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13733 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13734 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13735 | run_test "TLS 1.3: Check signature algorithm order, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13736 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13737 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13738 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13739 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 13740 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 13741 | 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] | 13742 | 0 \ |
| 13743 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13744 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 13745 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13746 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 13747 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13748 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13749 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13750 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13751 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13752 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13753 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13754 | run_test "TLS 1.3: Check signature algorithm order, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13755 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13756 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13757 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13758 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 13759 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 13760 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 13761 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 13762 | 0 \ |
| 13763 | -c "TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13764 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13765 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 13766 | |
| 13767 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13768 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13769 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13770 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13771 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13772 | run_test "TLS 1.3: Check signature algorithm order, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13773 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13774 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13775 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13776 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 13777 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 13778 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 13779 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" \ |
| 13780 | 0 \ |
| 13781 | -c "Negotiated version: 3.4" \ |
| 13782 | -c "HTTP/1.0 200 [Oo][Kk]" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13783 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13784 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 13785 | |
| 13786 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13787 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13788 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13789 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13790 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13791 | 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] | 13792 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13793 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13794 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13795 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 13796 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 13797 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 13798 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512" \ |
| 13799 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 13800 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13801 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13802 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13803 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13804 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13805 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13806 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13807 | 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] | 13808 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13809 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13810 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13811 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ |
| 13812 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 13813 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 13814 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \ |
| 13815 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 13816 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13817 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13818 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13819 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13820 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13821 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13822 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13823 | 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] | 13824 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13825 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13826 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13827 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 13828 | "$P_CLI allow_sha1=0 debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 13829 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13830 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 13831 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13832 | |
| 13833 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13834 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13835 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13836 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13837 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13838 | run_test "TLS 1.3: Check server no suitable certificate, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13839 | "$P_SRV debug_level=4 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13840 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13841 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 13842 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 13843 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \ |
| 13844 | 1 \ |
| 13845 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 13846 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13847 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13848 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13849 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13850 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13851 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13852 | run_test "TLS 1.3: Check server no suitable certificate, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13853 | "$P_SRV debug_level=4 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13854 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13855 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 13856 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 13857 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \ |
| 13858 | 1 \ |
| 13859 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 13860 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13861 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13862 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13863 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13864 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13865 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13866 | run_test "TLS 1.3: Check server no suitable certificate, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13867 | "$P_SRV debug_level=4 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13868 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13869 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 13870 | "$P_CLI allow_sha1=0 debug_level=4 \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 13871 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13872 | 1 \ |
| 13873 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 13874 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13875 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13876 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13877 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13878 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13879 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13880 | run_test "TLS 1.3: Check client no signature algorithm, m->O" \ |
| 13881 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 13882 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 13883 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp521r1_sha512" \ |
| 13884 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 13885 | 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] | 13886 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13887 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13888 | |
| 13889 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13890 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13891 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13892 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13893 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13894 | run_test "TLS 1.3: Check client no signature algorithm, m->G" \ |
| 13895 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 13896 | -d 4 |
| 13897 | --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 " \ |
| 13898 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 13899 | 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] | 13900 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13901 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13902 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13903 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13904 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13905 | requires_config_enabled MBEDTLS_SSL_CLI_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 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13908 | run_test "TLS 1.3: Check client no signature algorithm, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13909 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13910 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13911 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13912 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp521r1_sha512" \ |
| 13913 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 13914 | 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] | 13915 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13916 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13917 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13918 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13919 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13920 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13921 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13922 | run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->O" \ |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13923 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 13924 | -msg -tls1_2 |
| 13925 | -Verify 10 " \ |
| 13926 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13927 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 13928 | min_version=tls12 max_version=tls13 " \ |
| 13929 | 0 \ |
| 13930 | -c "Protocol is TLSv1.2" \ |
| 13931 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13932 | |
| 13933 | |
| 13934 | requires_gnutls_tls1_3 |
| 13935 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13936 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13937 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13938 | run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->G" \ |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13939 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 13940 | -d 4 |
| 13941 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 13942 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13943 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 13944 | min_version=tls12 max_version=tls13 " \ |
| 13945 | 0 \ |
| 13946 | -c "Protocol is TLSv1.2" \ |
| 13947 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13948 | |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13949 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13950 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13951 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 13952 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13953 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13954 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 13955 | requires_config_enabled PSA_WANT_DH_RFC7919_3072 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13956 | requires_gnutls_tls1_3 |
| 13957 | requires_gnutls_next_no_ticket |
| 13958 | requires_gnutls_next_disable_tls13_compat |
| 13959 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe3072,rsa_pss_rsae_sha256" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13960 | "$P_SRV crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe3072 tls13_kex_modes=ephemeral cookies=0 tickets=0" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13961 | "$G_NEXT_CLI_NO_CERT --debug=4 --single-key-share --x509cafile data_files/test-ca_cat12.crt --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE3072:+VERS-TLS1.3:%NO_TICKETS" \ |
| 13962 | 0 \ |
| 13963 | -s "Protocol is TLSv1.3" \ |
| 13964 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 13965 | -s "received signature algorithm: 0x804" \ |
| 13966 | -s "got named group: ffdhe3072(0101)" \ |
| 13967 | -s "Certificate verification was skipped" \ |
| 13968 | -C "received HelloRetryRequest message" |
| 13969 | |
| 13970 | |
| 13971 | requires_gnutls_tls1_3 |
| 13972 | requires_gnutls_next_no_ticket |
| 13973 | requires_gnutls_next_disable_tls13_compat |
| 13974 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13975 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13976 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 13977 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13978 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13979 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 13980 | requires_config_enabled PSA_WANT_DH_RFC7919_3072 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13981 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe3072,rsa_pss_rsae_sha256" \ |
| 13982 | "$G_NEXT_SRV_NO_CERT --http --disable-client-cert --debug=4 --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE3072:+VERS-TLS1.3:%NO_TICKETS" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13983 | "$P_CLI ca_file=data_files/test-ca_cat12.crt debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe3072" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13984 | 0 \ |
| 13985 | -c "HTTP/1.0 200 OK" \ |
| 13986 | -c "Protocol is TLSv1.3" \ |
| 13987 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 13988 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 13989 | -c "NamedGroup: ffdhe3072 ( 101 )" \ |
| 13990 | -c "Verifying peer X.509 certificate... ok" \ |
| 13991 | -C "received HelloRetryRequest message" |
| 13992 | |
| 13993 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13994 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13995 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 13996 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13997 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13998 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 13999 | requires_config_enabled PSA_WANT_DH_RFC7919_4096 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14000 | requires_gnutls_tls1_3 |
| 14001 | requires_gnutls_next_no_ticket |
| 14002 | requires_gnutls_next_disable_tls13_compat |
| 14003 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe4096,rsa_pss_rsae_sha256" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 14004 | "$P_SRV crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe4096 tls13_kex_modes=ephemeral cookies=0 tickets=0" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14005 | "$G_NEXT_CLI_NO_CERT --debug=4 --single-key-share --x509cafile data_files/test-ca_cat12.crt --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE4096:+VERS-TLS1.3:%NO_TICKETS" \ |
| 14006 | 0 \ |
| 14007 | -s "Protocol is TLSv1.3" \ |
| 14008 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14009 | -s "received signature algorithm: 0x804" \ |
| 14010 | -s "got named group: ffdhe4096(0102)" \ |
| 14011 | -s "Certificate verification was skipped" \ |
| 14012 | -C "received HelloRetryRequest message" |
| 14013 | |
| 14014 | |
| 14015 | requires_gnutls_tls1_3 |
| 14016 | requires_gnutls_next_no_ticket |
| 14017 | requires_gnutls_next_disable_tls13_compat |
| 14018 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14019 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14020 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14021 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14022 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14023 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14024 | requires_config_enabled PSA_WANT_DH_RFC7919_4096 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14025 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe4096,rsa_pss_rsae_sha256" \ |
| 14026 | "$G_NEXT_SRV_NO_CERT --http --disable-client-cert --debug=4 --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE4096:+VERS-TLS1.3:%NO_TICKETS" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 14027 | "$P_CLI ca_file=data_files/test-ca_cat12.crt debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe4096" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14028 | 0 \ |
| 14029 | -c "HTTP/1.0 200 OK" \ |
| 14030 | -c "Protocol is TLSv1.3" \ |
| 14031 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14032 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14033 | -c "NamedGroup: ffdhe4096 ( 102 )" \ |
| 14034 | -c "Verifying peer X.509 certificate... ok" \ |
| 14035 | -C "received HelloRetryRequest message" |
| 14036 | |
| 14037 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14038 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14039 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14040 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14041 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14042 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14043 | requires_config_enabled PSA_WANT_DH_RFC7919_6144 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14044 | requires_gnutls_tls1_3 |
| 14045 | requires_gnutls_next_no_ticket |
| 14046 | requires_gnutls_next_disable_tls13_compat |
| 14047 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe6144,rsa_pss_rsae_sha256" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 14048 | "$P_SRV crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe6144 tls13_kex_modes=ephemeral cookies=0 tickets=0" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14049 | "$G_NEXT_CLI_NO_CERT --debug=4 --single-key-share --x509cafile data_files/test-ca_cat12.crt --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE6144:+VERS-TLS1.3:%NO_TICKETS" \ |
| 14050 | 0 \ |
| 14051 | -s "Protocol is TLSv1.3" \ |
| 14052 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14053 | -s "received signature algorithm: 0x804" \ |
| 14054 | -s "got named group: ffdhe6144(0103)" \ |
| 14055 | -s "Certificate verification was skipped" \ |
| 14056 | -C "received HelloRetryRequest message" |
| 14057 | |
| 14058 | requires_gnutls_tls1_3 |
| 14059 | requires_gnutls_next_no_ticket |
| 14060 | requires_gnutls_next_disable_tls13_compat |
| 14061 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14062 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14063 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14064 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14065 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14066 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14067 | requires_config_enabled PSA_WANT_DH_RFC7919_6144 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14068 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe6144,rsa_pss_rsae_sha256" \ |
| 14069 | "$G_NEXT_SRV_NO_CERT --http --disable-client-cert --debug=4 --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE6144:+VERS-TLS1.3:%NO_TICKETS" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 14070 | "$P_CLI ca_file=data_files/test-ca_cat12.crt debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe6144" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14071 | 0 \ |
| 14072 | -c "HTTP/1.0 200 OK" \ |
| 14073 | -c "Protocol is TLSv1.3" \ |
| 14074 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14075 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14076 | -c "NamedGroup: ffdhe6144 ( 103 )" \ |
| 14077 | -c "Verifying peer X.509 certificate... ok" \ |
| 14078 | -C "received HelloRetryRequest message" |
| 14079 | |
| 14080 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14081 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14082 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14083 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14084 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14085 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14086 | requires_config_enabled PSA_WANT_DH_RFC7919_8192 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14087 | requires_gnutls_tls1_3 |
| 14088 | requires_gnutls_next_no_ticket |
| 14089 | requires_gnutls_next_disable_tls13_compat |
| 14090 | client_needs_more_time 4 |
| 14091 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe8192,rsa_pss_rsae_sha256" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 14092 | "$P_SRV crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe8192 tls13_kex_modes=ephemeral cookies=0 tickets=0" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14093 | "$G_NEXT_CLI_NO_CERT --debug=4 --single-key-share --x509cafile data_files/test-ca_cat12.crt --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE8192:+VERS-TLS1.3:%NO_TICKETS" \ |
| 14094 | 0 \ |
| 14095 | -s "Protocol is TLSv1.3" \ |
| 14096 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14097 | -s "received signature algorithm: 0x804" \ |
| 14098 | -s "got named group: ffdhe8192(0104)" \ |
| 14099 | -s "Certificate verification was skipped" \ |
| 14100 | -C "received HelloRetryRequest message" |
| 14101 | |
| 14102 | requires_gnutls_tls1_3 |
| 14103 | requires_gnutls_next_no_ticket |
| 14104 | requires_gnutls_next_disable_tls13_compat |
| 14105 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14106 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14107 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14108 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14109 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14110 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14111 | requires_config_enabled PSA_WANT_DH_RFC7919_8192 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14112 | client_needs_more_time 4 |
| 14113 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe8192,rsa_pss_rsae_sha256" \ |
| 14114 | "$G_NEXT_SRV_NO_CERT --http --disable-client-cert --debug=4 --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE8192:+VERS-TLS1.3:%NO_TICKETS" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 14115 | "$P_CLI ca_file=data_files/test-ca_cat12.crt debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe8192" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14116 | 0 \ |
| 14117 | -c "HTTP/1.0 200 OK" \ |
| 14118 | -c "Protocol is TLSv1.3" \ |
| 14119 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14120 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14121 | -c "NamedGroup: ffdhe8192 ( 104 )" \ |
| 14122 | -c "Verifying peer X.509 certificate... ok" \ |
| 14123 | -C "received HelloRetryRequest message" |
| 14124 | |
Ronald Cron | 8a74f07 | 2023-06-14 17:59:29 +0200 | [diff] [blame] | 14125 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 14126 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14127 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14128 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 14129 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14130 | run_test "TLS 1.3: no HRR in case of PSK key exchange mode" \ |
Gilles Peskine | abb1c22 | 2024-05-13 21:06:26 +0200 | [diff] [blame] | 14131 | "$P_SRV nbio=2 psk=73776f726466697368 psk_identity=0a0b0c tls13_kex_modes=psk groups=none" \ |
| 14132 | "$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] | 14133 | 0 \ |
| 14134 | -C "received HelloRetryRequest message" \ |
| 14135 | -c "Selected key exchange mode: psk$" \ |
| 14136 | -c "HTTP/1.0 200 OK" |
| 14137 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14138 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 14139 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14140 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 14141 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 14142 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 14143 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14144 | run_tests_memory_after_hanshake |
| 14145 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14146 | if [ "$LIST_TESTS" -eq 0 ]; then |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 14147 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14148 | # Final report |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 14149 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14150 | echo "------------------------------------------------------------------------" |
| 14151 | |
| 14152 | if [ $FAILS = 0 ]; then |
| 14153 | printf "PASSED" |
| 14154 | else |
| 14155 | printf "FAILED" |
| 14156 | fi |
| 14157 | PASSES=$(( $TESTS - $FAILS )) |
| 14158 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
| 14159 | |
Gilles Peskine | c75048c | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 14160 | if [ $((TESTS - SKIPS)) -lt $MIN_TESTS ]; then |
| 14161 | cat <<EOF |
| 14162 | Error: Expected to run at least $MIN_TESTS, but only ran $((TESTS - SKIPS)). |
| 14163 | Maybe a bad filter ('$FILTER') or a bad configuration? |
| 14164 | EOF |
| 14165 | if [ $FAILS -eq 0 ]; then |
| 14166 | FAILS=1 |
| 14167 | fi |
| 14168 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 14169 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 14170 | |
Tom Cosgrove | fc0e79e | 2023-01-13 12:13:41 +0000 | [diff] [blame] | 14171 | if [ $FAILS -gt 255 ]; then |
| 14172 | # Clamp at 255 as caller gets exit code & 0xFF |
| 14173 | # (so 256 would be 0, or success, etc) |
| 14174 | FAILS=255 |
| 14175 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 14176 | exit $FAILS |