Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # |
Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 5 | # Copyright The Mbed TLS Contributors |
Dave Rodgman | 16799db | 2023-11-02 19:47:20 +0000 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
Bence Szépkúti | c7da1fe | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 7 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 8 | # Purpose |
| 9 | # |
| 10 | # Executes tests to prove various TLS/SSL options and extensions. |
| 11 | # |
| 12 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 13 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 14 | # (session resumption from cache or ticket, renego, etc). |
| 15 | # |
| 16 | # The tests assume a build with default options, with exceptions expressed |
| 17 | # with a dependency. The tests focus on functionality and do not consider |
| 18 | # performance. |
| 19 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 20 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 21 | set -u |
| 22 | |
Jaeden Amero | 6e70eb2 | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 23 | # Limit the size of each log to 10 GiB, in case of failures with this script |
| 24 | # where it may output seemingly unlimited length error logs. |
| 25 | ulimit -f 20971520 |
| 26 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 27 | ORIGINAL_PWD=$PWD |
| 28 | if ! cd "$(dirname "$0")"; then |
| 29 | exit 125 |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 30 | fi |
| 31 | |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 32 | DATA_FILES_PATH=../framework/data_files |
| 33 | |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 34 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 35 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 36 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 37 | : ${P_PXY:=../programs/test/udp_proxy} |
Jerry Yu | d04fd35 | 2021-12-06 16:52:57 +0800 | [diff] [blame] | 38 | : ${P_QUERY:=../programs/test/query_compile_time_config} |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 39 | : ${OPENSSL:=openssl} |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 40 | : ${GNUTLS_CLI:=gnutls-cli} |
| 41 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 42 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 43 | |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 44 | # The OPENSSL variable used to be OPENSSL_CMD for historical reasons. |
| 45 | # To help the migration, error out if the old variable is set, |
| 46 | # but only if it has a different value than the new one. |
| 47 | if [ "${OPENSSL_CMD+set}" = set ]; then |
| 48 | # the variable is set, we can now check its value |
| 49 | if [ "$OPENSSL_CMD" != "$OPENSSL" ]; then |
| 50 | echo "Please use OPENSSL instead of OPENSSL_CMD." >&2 |
| 51 | exit 125 |
| 52 | fi |
| 53 | fi |
| 54 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 55 | guess_config_name() { |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 56 | if git diff --quiet ../include/mbedtls/mbedtls_config.h 2>/dev/null; then |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 57 | echo "default" |
| 58 | else |
| 59 | echo "unknown" |
| 60 | fi |
| 61 | } |
| 62 | : ${MBEDTLS_TEST_OUTCOME_FILE=} |
| 63 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} |
| 64 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 65 | : ${EARLY_DATA_INPUT:="$DATA_FILES_PATH/tls13_early_data.txt"} |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 66 | |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 67 | O_SRV="$OPENSSL s_server -www -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 68 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL s_client" |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 69 | G_SRV="$GNUTLS_SERV --x509certfile $DATA_FILES_PATH/server5.crt --x509keyfile $DATA_FILES_PATH/server5.key" |
| 70 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt" |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 71 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 72 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 73 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 74 | |
Gilles Peskine | f9c798c | 2024-04-29 17:46:24 +0200 | [diff] [blame] | 75 | # If $OPENSSL is at least 1.1.1, use it as OPENSSL_NEXT as well. |
| 76 | if [ -z "${OPENSSL_NEXT:-}" ]; then |
| 77 | case $($OPENSSL version) in |
| 78 | OpenSSL\ 1.1.[1-9]*) OPENSSL_NEXT=$OPENSSL;; |
| 79 | OpenSSL\ [3-9]*) OPENSSL_NEXT=$OPENSSL;; |
| 80 | esac |
| 81 | fi |
| 82 | |
| 83 | # If $GNUTLS_CLI is at least 3.7, use it as GNUTLS_NEXT_CLI as well. |
| 84 | if [ -z "${GNUTLS_NEXT_CLI:-}" ]; then |
| 85 | case $($GNUTLS_CLI --version) in |
| 86 | gnutls-cli\ 3.[1-9][0-9]*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 87 | gnutls-cli\ 3.[7-9].*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 88 | gnutls-cli\ [4-9]*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 89 | esac |
| 90 | fi |
| 91 | |
| 92 | # If $GNUTLS_SERV is at least 3.7, use it as GNUTLS_NEXT_SERV as well. |
| 93 | if [ -z "${GNUTLS_NEXT_SERV:-}" ]; then |
| 94 | case $($GNUTLS_SERV --version) in |
| 95 | gnutls-cli\ 3.[1-9][0-9]*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 96 | gnutls-cli\ 3.[7-9].*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 97 | gnutls-cli\ [4-9]*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 98 | esac |
| 99 | fi |
| 100 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 101 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 102 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" |
| 103 | O_NEXT_SRV_EARLY_DATA="$OPENSSL_NEXT s_server -early_data -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 104 | O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www " |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 105 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client -CAfile $DATA_FILES_PATH/test-ca_cat12.crt" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 106 | O_NEXT_CLI_NO_CERT="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 107 | else |
| 108 | O_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 109 | O_NEXT_SRV_NO_CERT=false |
Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 110 | O_NEXT_SRV_EARLY_DATA=false |
XiaokangQian | b1847a2 | 2022-06-08 07:49:31 +0000 | [diff] [blame] | 111 | O_NEXT_CLI_NO_CERT=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 112 | O_NEXT_CLI=false |
| 113 | fi |
| 114 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 115 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 116 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile $DATA_FILES_PATH/server5.crt --x509keyfile $DATA_FILES_PATH/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 117 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 118 | else |
| 119 | G_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 120 | G_NEXT_SRV_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 121 | fi |
| 122 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 123 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 124 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 125 | G_NEXT_CLI_NO_CERT="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 126 | else |
| 127 | G_NEXT_CLI=false |
XiaokangQian | fb1a3fe | 2022-06-09 06:37:33 +0000 | [diff] [blame] | 128 | G_NEXT_CLI_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 129 | fi |
| 130 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 131 | TESTS=0 |
| 132 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 133 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 134 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 135 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 136 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 137 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 138 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 139 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 140 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 141 | SHOW_TEST_NUMBER=0 |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 142 | LIST_TESTS=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 143 | RUN_TEST_NUMBER='' |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 144 | RUN_TEST_SUITE='' |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 145 | |
Gilles Peskine | c75048c | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 146 | MIN_TESTS=1 |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 147 | PRESERVE_LOGS=0 |
| 148 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 149 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 150 | # port which is this plus 10000. Each port number may be independently |
| 151 | # overridden by a command line option. |
| 152 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 153 | PXY_PORT=$((SRV_PORT + 10000)) |
| 154 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 155 | print_usage() { |
| 156 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 157 | printf " -h|--help\tPrint this help.\n" |
| 158 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 159 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 160 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 161 | printf " -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 162 | printf " -s|--show-numbers\tShow test numbers in front of test names\n" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 163 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Tomás González | 12787c9 | 2023-09-04 10:26:00 +0100 | [diff] [blame] | 164 | printf " --list-test-cases\tList all potential test cases (No Execution)\n" |
Gilles Peskine | c75048c | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 165 | printf " --min \tMinimum number of non-skipped tests (default 1)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 166 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 167 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 168 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 169 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 170 | printf " --seed \tInteger seed value to use for this test run\n" |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 171 | printf " --test-suite\tOnly matching test suites are executed\n" |
| 172 | printf " \t(comma-separated, e.g. 'ssl-opt,tls13-compat')\n\n" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 173 | } |
| 174 | |
| 175 | get_options() { |
| 176 | while [ $# -gt 0 ]; do |
| 177 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 178 | -f|--filter) |
| 179 | shift; FILTER=$1 |
| 180 | ;; |
| 181 | -e|--exclude) |
| 182 | shift; EXCLUDE=$1 |
| 183 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 184 | -m|--memcheck) |
| 185 | MEMCHECK=1 |
| 186 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 187 | -n|--number) |
| 188 | shift; RUN_TEST_NUMBER=$1 |
| 189 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 190 | -s|--show-numbers) |
| 191 | SHOW_TEST_NUMBER=1 |
| 192 | ;; |
Tomás González | 4a86da2 | 2023-09-01 17:41:16 +0100 | [diff] [blame] | 193 | -l|--list-test-cases) |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 194 | LIST_TESTS=1 |
| 195 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 196 | -p|--preserve-logs) |
| 197 | PRESERVE_LOGS=1 |
| 198 | ;; |
Gilles Peskine | c75048c | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 199 | --min) |
| 200 | shift; MIN_TESTS=$1 |
| 201 | ;; |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 202 | --outcome-file) |
| 203 | shift; MBEDTLS_TEST_OUTCOME_FILE=$1 |
| 204 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 205 | --port) |
| 206 | shift; SRV_PORT=$1 |
| 207 | ;; |
| 208 | --proxy-port) |
| 209 | shift; PXY_PORT=$1 |
| 210 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 211 | --seed) |
| 212 | shift; SEED="$1" |
| 213 | ;; |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 214 | --test-suite) |
| 215 | shift; RUN_TEST_SUITE="$1" |
| 216 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 217 | -h|--help) |
| 218 | print_usage |
| 219 | exit 0 |
| 220 | ;; |
| 221 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 222 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 223 | print_usage |
| 224 | exit 1 |
| 225 | ;; |
| 226 | esac |
| 227 | shift |
| 228 | done |
| 229 | } |
| 230 | |
Tomás González | 0e8a08a | 2023-08-23 15:29:57 +0100 | [diff] [blame] | 231 | get_options "$@" |
| 232 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 233 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 234 | # testing. Skip non-boolean options (with something other than spaces |
| 235 | # and a comment after "#define SYMBOL"). The variable contains a |
| 236 | # space-separated list of symbols. |
Tomás González | f162b4f | 2023-08-23 15:31:12 +0100 | [diff] [blame] | 237 | if [ "$LIST_TESTS" -eq 0 ];then |
| 238 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
| 239 | else |
Tomás González | be2c66e | 2023-09-01 10:34:49 +0100 | [diff] [blame] | 240 | P_QUERY=":" |
Tomás González | f162b4f | 2023-08-23 15:31:12 +0100 | [diff] [blame] | 241 | CONFIGS_ENABLED="" |
| 242 | fi |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 243 | # Skip next test; use this macro to skip tests which are legitimate |
| 244 | # in theory and expected to be re-introduced at some point, but |
| 245 | # aren't expected to succeed at the moment due to problems outside |
| 246 | # our control (such as bugs in other TLS implementations). |
| 247 | skip_next_test() { |
| 248 | SKIP_NEXT="YES" |
| 249 | } |
| 250 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 251 | # Check if the required configuration ($1) is enabled |
| 252 | is_config_enabled() |
| 253 | { |
| 254 | case $CONFIGS_ENABLED in |
| 255 | *" $1"[\ =]*) return 0;; |
| 256 | *) return 1;; |
| 257 | esac |
| 258 | } |
| 259 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 260 | # skip next test if the flag is not enabled in mbedtls_config.h |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 261 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 262 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 263 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 264 | *) SKIP_NEXT="YES";; |
| 265 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 266 | } |
| 267 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 268 | # skip next test if the flag is enabled in mbedtls_config.h |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 269 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 270 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 271 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 272 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 273 | } |
| 274 | |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 275 | requires_all_configs_enabled() { |
Gilles Peskine | 0bc5729 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 276 | for x in "$@"; do |
| 277 | if ! is_config_enabled "$x"; then |
| 278 | SKIP_NEXT="YES" |
| 279 | return |
| 280 | fi |
| 281 | done |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 282 | } |
| 283 | |
| 284 | requires_all_configs_disabled() { |
Gilles Peskine | 0bc5729 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 285 | for x in "$@"; do |
| 286 | if is_config_enabled "$x"; then |
| 287 | SKIP_NEXT="YES" |
| 288 | return |
| 289 | fi |
| 290 | done |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 291 | } |
| 292 | |
| 293 | requires_any_configs_enabled() { |
Gilles Peskine | 0bc5729 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 294 | for x in "$@"; do |
| 295 | if is_config_enabled "$x"; then |
| 296 | return |
| 297 | fi |
| 298 | done |
| 299 | SKIP_NEXT="YES" |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 300 | } |
| 301 | |
| 302 | requires_any_configs_disabled() { |
Gilles Peskine | 0bc5729 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 303 | for x in "$@"; do |
| 304 | if ! is_config_enabled "$x"; then |
| 305 | return |
| 306 | fi |
| 307 | done |
| 308 | SKIP_NEXT="YES" |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 309 | } |
| 310 | |
Ronald Cron | 454eb91 | 2022-10-21 08:56:04 +0200 | [diff] [blame] | 311 | TLS1_2_KEY_EXCHANGES_WITH_CERT="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 312 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 313 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 314 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 315 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED \ |
| 316 | MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED \ |
| 317 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 318 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 319 | TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT="MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 320 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 321 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 322 | TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
| 323 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 324 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 325 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 326 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED" |
| 327 | |
Gilles Peskine | 0a9f9d6 | 2024-09-06 15:38:47 +0200 | [diff] [blame] | 328 | requires_certificate_authentication () { |
Gilles Peskine | cfbaffd | 2024-09-10 12:24:23 +0200 | [diff] [blame^] | 329 | if is_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 330 | then |
Gilles Peskine | cfbaffd | 2024-09-10 12:24:23 +0200 | [diff] [blame^] | 331 | # TLS 1.3 is negotiated by default, so check whether it supports |
| 332 | # certificate-based authentication. |
| 333 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 334 | else # Only TLS 1.2 is enabled. |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 335 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 336 | fi |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 337 | } |
| 338 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 339 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 340 | # This function uses the query_config command line option to query the |
| 341 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 342 | # program. The command will always return a success value if the |
| 343 | # configuration is defined and the value will be printed to stdout. |
| 344 | # |
| 345 | # Note that if the configuration is not defined or is defined to nothing, |
| 346 | # the output of this function will be an empty string. |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 347 | if [ "$LIST_TESTS" -eq 0 ];then |
| 348 | ${P_SRV} "query_config=${1}" |
| 349 | else |
| 350 | echo "1" |
| 351 | fi |
| 352 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 353 | } |
| 354 | |
| 355 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 356 | VAL="$( get_config_value_or_default "$1" )" |
| 357 | if [ -z "$VAL" ]; then |
| 358 | # Should never happen |
| 359 | echo "Mbed TLS configuration $1 is not defined" |
| 360 | exit 1 |
| 361 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 362 | SKIP_NEXT="YES" |
| 363 | fi |
| 364 | } |
| 365 | |
| 366 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 367 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 368 | if [ -z "$VAL" ]; then |
| 369 | # Should never happen |
| 370 | echo "Mbed TLS configuration $1 is not defined" |
| 371 | exit 1 |
| 372 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 373 | SKIP_NEXT="YES" |
| 374 | fi |
| 375 | } |
| 376 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 377 | requires_config_value_equals() { |
| 378 | VAL=$( get_config_value_or_default "$1" ) |
| 379 | if [ -z "$VAL" ]; then |
| 380 | # Should never happen |
| 381 | echo "Mbed TLS configuration $1 is not defined" |
| 382 | exit 1 |
| 383 | elif [ "$VAL" -ne "$2" ]; then |
| 384 | SKIP_NEXT="YES" |
| 385 | fi |
| 386 | } |
| 387 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 388 | # Require Mbed TLS to support the given protocol version. |
| 389 | # |
| 390 | # Inputs: |
| 391 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 392 | requires_protocol_version() { |
| 393 | # Support for DTLS is detected separately in detect_dtls(). |
| 394 | case "$1" in |
| 395 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 396 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; |
| 397 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 398 | esac |
| 399 | } |
| 400 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 401 | # Space-separated list of ciphersuites supported by this build of |
| 402 | # Mbed TLS. |
Ronald Cron | 5b73de8 | 2023-11-28 15:49:25 +0100 | [diff] [blame] | 403 | P_CIPHERSUITES="" |
| 404 | if [ "$LIST_TESTS" -eq 0 ]; then |
| 405 | P_CIPHERSUITES=" $($P_CLI help_ciphersuites 2>/dev/null | |
| 406 | grep 'TLS-\|TLS1-3' | |
| 407 | tr -s ' \n' ' ')" |
| 408 | |
| 409 | if [ -z "${P_CIPHERSUITES# }" ]; then |
| 410 | echo >&2 "$0: fatal error: no cipher suites found!" |
| 411 | exit 125 |
| 412 | fi |
| 413 | fi |
| 414 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 415 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 416 | case $P_CIPHERSUITES in |
| 417 | *" $1 "*) :;; |
| 418 | *) SKIP_NEXT="YES";; |
| 419 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 420 | } |
| 421 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 422 | requires_cipher_enabled() { |
| 423 | KEY_TYPE=$1 |
| 424 | MODE=${2:-} |
| 425 | if is_config_enabled MBEDTLS_USE_PSA_CRYPTO; then |
| 426 | case "$KEY_TYPE" in |
| 427 | CHACHA20) |
| 428 | requires_config_enabled PSA_WANT_ALG_CHACHA20_POLY1305 |
| 429 | requires_config_enabled PSA_WANT_KEY_TYPE_CHACHA20 |
| 430 | ;; |
| 431 | *) |
| 432 | requires_config_enabled PSA_WANT_ALG_${MODE} |
| 433 | requires_config_enabled PSA_WANT_KEY_TYPE_${KEY_TYPE} |
| 434 | ;; |
| 435 | esac |
| 436 | else |
| 437 | case "$KEY_TYPE" in |
| 438 | CHACHA20) |
| 439 | requires_config_enabled MBEDTLS_CHACHA20_C |
| 440 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 441 | ;; |
| 442 | *) |
| 443 | requires_config_enabled MBEDTLS_${MODE}_C |
| 444 | requires_config_enabled MBEDTLS_${KEY_TYPE}_C |
| 445 | ;; |
| 446 | esac |
| 447 | fi |
| 448 | } |
| 449 | |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 450 | # Automatically detect required features based on command line parameters. |
| 451 | # Parameters are: |
| 452 | # - $1 = command line (call to a TLS client or server program) |
| 453 | # - $2 = client/server |
| 454 | # - $3 = TLS version (TLS12 or TLS13) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 455 | # - $4 = Use an external tool without ECDH support |
| 456 | # - $5 = run test options |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 457 | detect_required_features() { |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 458 | CMD_LINE=$1 |
| 459 | ROLE=$2 |
| 460 | TLS_VERSION=$3 |
| 461 | EXT_WO_ECDH=$4 |
| 462 | TEST_OPTIONS=${5:-} |
| 463 | |
| 464 | case "$CMD_LINE" in |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 465 | *\ force_version=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 466 | tmp="${CMD_LINE##*\ force_version=}" |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 467 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 468 | requires_protocol_version "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 469 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 470 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 471 | case "$CMD_LINE" in |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 472 | *\ force_ciphersuite=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 473 | tmp="${CMD_LINE##*\ force_ciphersuite=}" |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 474 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 475 | requires_ciphersuite_enabled "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 476 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 477 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 478 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 479 | *[-_\ =]tickets=[^0]*) |
| 480 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 481 | esac |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 482 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 483 | *[-_\ =]alpn=*) |
| 484 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 485 | esac |
| 486 | |
Gilles Peskine | 6eff90f | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 487 | case " $CMD_LINE " in |
| 488 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
Gilles Peskine | d57212e | 2024-09-10 12:06:33 +0200 | [diff] [blame] | 489 | # The test case involves certificates (crt), or a relevant |
| 490 | # aspect of it is the (certificate-based) authentication mode. |
Gilles Peskine | 6eff90f | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 491 | requires_certificate_authentication;; |
| 492 | esac |
| 493 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 494 | case "$CMD_LINE" in |
Gilles Peskine | 5c766dc | 2024-09-06 15:35:58 +0200 | [diff] [blame] | 495 | *[-_\ =]psk*|*[-_\ =]PSK*) :;; # No certificate requirement with PSK |
Gilles Peskine | 1bc28fe | 2024-04-26 21:28:49 +0200 | [diff] [blame] | 496 | */server5*|\ |
| 497 | */server7*|\ |
| 498 | */dir-maxpath*) |
Gilles Peskine | 6eff90f | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 499 | requires_certificate_authentication |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 500 | if [ "$TLS_VERSION" = "TLS13" ]; then |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 501 | # In case of TLS13 the support for ECDSA is enough |
| 502 | requires_pk_alg "ECDSA" |
| 503 | else |
| 504 | # For TLS12 requirements are different between server and client |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 505 | if [ "$ROLE" = "server" ]; then |
Valerio Setti | 194e2bd | 2023-03-02 17:18:10 +0100 | [diff] [blame] | 506 | # If the server uses "server5*" certificates, then an ECDSA based |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 507 | # key exchange is required. However gnutls also does not |
| 508 | # support ECDH, so this limit the choice to ECDHE-ECDSA |
| 509 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 510 | requires_any_configs_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
| 511 | else |
| 512 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT |
| 513 | fi |
| 514 | elif [ "$ROLE" = "client" ]; then |
| 515 | # On the client side it is enough to have any certificate |
| 516 | # based authentication together with support for ECDSA. |
| 517 | # Of course the GnuTLS limitation mentioned above applies |
| 518 | # also here. |
| 519 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 520 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH |
| 521 | else |
| 522 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 523 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 524 | requires_pk_alg "ECDSA" |
| 525 | fi |
| 526 | fi |
| 527 | ;; |
| 528 | esac |
| 529 | |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 530 | case "$CMD_LINE" in |
Gilles Peskine | 5c766dc | 2024-09-06 15:35:58 +0200 | [diff] [blame] | 531 | *[-_\ =]psk*|*[-_\ =]PSK*) :;; # No certificate requirement with PSK |
Gilles Peskine | 121a7bf | 2024-04-29 16:03:02 +0200 | [diff] [blame] | 532 | */server1*|\ |
Gilles Peskine | 1bc28fe | 2024-04-26 21:28:49 +0200 | [diff] [blame] | 533 | */server2*|\ |
| 534 | */server7*) |
Gilles Peskine | 6eff90f | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 535 | requires_certificate_authentication |
Gilles Peskine | 121a7bf | 2024-04-29 16:03:02 +0200 | [diff] [blame] | 536 | # Certificates with an RSA key. The algorithm requirement is |
| 537 | # some subset of {PKCS#1v1.5 encryption, PKCS#1v1.5 signature, |
| 538 | # PSS signature}. We can't easily tell which subset works, and |
| 539 | # we aren't currently running ssl-opt.sh in configurations |
| 540 | # where partial RSA support is a problem, so generically, we |
| 541 | # just require RSA and it works out for our tests so far. |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 542 | requires_config_enabled "MBEDTLS_RSA_C" |
| 543 | esac |
| 544 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 545 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 546 | } |
| 547 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 548 | adapt_cmd_for_psk () { |
| 549 | case "$2" in |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 550 | *openssl*s_server*) s='-psk 73776f726466697368 -nocert';; |
| 551 | *openssl*) s='-psk 73776f726466697368';; |
Gilles Peskine | 9cd5848 | 2024-09-06 15:27:57 +0200 | [diff] [blame] | 552 | *gnutls-cli*) s='--pskusername=Client_identity --pskkey=73776f726466697368';; |
| 553 | *gnutls-serv*) s='--pskpasswd=../framework/data_files/simplepass.psk';; |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 554 | *) s='psk=73776f726466697368';; |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 555 | esac |
| 556 | eval $1='"$2 $s"' |
| 557 | unset s |
| 558 | } |
| 559 | |
| 560 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 561 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 562 | # |
| 563 | # If not running in a PSK-only build, do nothing. |
| 564 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 565 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 566 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 567 | # a pre-shared key, do nothing. |
| 568 | # |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 569 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 570 | # |
| 571 | # Inputs: |
| 572 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 573 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 574 | # * "$@": options passed to run_test. |
| 575 | # |
| 576 | # Outputs: |
| 577 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 578 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 579 | maybe_adapt_for_psk() { |
| 580 | if [ "$PSK_ONLY" != "YES" ]; then |
| 581 | return |
| 582 | fi |
| 583 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 584 | return |
| 585 | fi |
| 586 | case "$CLI_CMD $SRV_CMD" in |
| 587 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 588 | return;; |
| 589 | *force_ciphersuite*) |
| 590 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 591 | # PSK cipher suite could be substituted, but we're not ready for |
| 592 | # that yet. |
| 593 | SKIP_NEXT="YES" |
| 594 | return;; |
| 595 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 596 | # The test case involves certificates. PSK won't do. |
| 597 | SKIP_NEXT="YES" |
| 598 | return;; |
| 599 | esac |
| 600 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 601 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 602 | } |
| 603 | |
Gilles Peskine | d98b363 | 2024-09-06 19:08:41 +0200 | [diff] [blame] | 604 | # PSK_PRESENT="YES" if at least one protocol versions supports at least |
| 605 | # one PSK key exchange mode. |
Gilles Peskine | bbdc1a3 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 606 | PSK_PRESENT="NO" |
Gilles Peskine | d98b363 | 2024-09-06 19:08:41 +0200 | [diff] [blame] | 607 | # PSK_ONLY="YES" if all the available key exchange modes are PSK-based |
| 608 | # (pure-PSK or PSK-ephemeral, possibly both). |
Gilles Peskine | bbdc1a3 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 609 | PSK_ONLY="" |
| 610 | for c in $CONFIGS_ENABLED; do |
| 611 | case $c in |
| 612 | MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | 19c60d2 | 2024-09-09 11:24:17 +0200 | [diff] [blame] | 613 | MBEDTLS_KEY_EXCHANGE_*_PSK_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | bbdc1a3 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 614 | MBEDTLS_KEY_EXCHANGE_*_ENABLED) PSK_ONLY="NO";; |
| 615 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | d98b363 | 2024-09-06 19:08:41 +0200 | [diff] [blame] | 616 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_*_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | bbdc1a3 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 617 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_*_ENABLED) PSK_ONLY="NO";; |
| 618 | esac |
| 619 | done |
Gilles Peskine | 5838a64 | 2024-09-09 10:57:01 +0200 | [diff] [blame] | 620 | # At this stage, $PSK_ONLY is empty if we haven't detected a non-PSK |
| 621 | # key exchange, i.e. if we're in a PSK-only build or a build with no |
| 622 | # key exchanges at all. We avoid triggering PSK-only adaptation code in |
Gilles Peskine | d57212e | 2024-09-10 12:06:33 +0200 | [diff] [blame] | 623 | # the edge case of no key exchanges. |
Gilles Peskine | bbdc1a3 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 624 | : ${PSK_ONLY:=$PSK_PRESENT} |
| 625 | unset c |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 626 | |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 627 | HAS_ALG_MD5="NO" |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 628 | HAS_ALG_SHA_1="NO" |
| 629 | HAS_ALG_SHA_224="NO" |
| 630 | HAS_ALG_SHA_256="NO" |
| 631 | HAS_ALG_SHA_384="NO" |
| 632 | HAS_ALG_SHA_512="NO" |
| 633 | |
| 634 | check_for_hash_alg() |
| 635 | { |
| 636 | CURR_ALG="INVALID"; |
| 637 | USE_PSA="NO" |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 638 | if is_config_enabled "MBEDTLS_USE_PSA_CRYPTO"; then |
| 639 | USE_PSA="YES"; |
| 640 | fi |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 641 | if [ $USE_PSA = "YES" ]; then |
| 642 | CURR_ALG=PSA_WANT_ALG_${1} |
| 643 | else |
| 644 | CURR_ALG=MBEDTLS_${1}_C |
| 645 | # Remove the second underscore to match MBEDTLS_* naming convention |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 646 | # MD5 is an exception to this convention |
| 647 | if [ "${1}" != "MD5" ]; then |
| 648 | CURR_ALG=$(echo "$CURR_ALG" | sed 's/_//2') |
| 649 | fi |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 650 | fi |
| 651 | |
| 652 | case $CONFIGS_ENABLED in |
| 653 | *" $CURR_ALG"[\ =]*) |
| 654 | return 0 |
| 655 | ;; |
| 656 | *) :;; |
| 657 | esac |
| 658 | return 1 |
| 659 | } |
| 660 | |
| 661 | populate_enabled_hash_algs() |
| 662 | { |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 663 | for hash_alg in SHA_1 SHA_224 SHA_256 SHA_384 SHA_512 MD5; do |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 664 | if check_for_hash_alg "$hash_alg"; then |
| 665 | hash_alg_variable=HAS_ALG_${hash_alg} |
| 666 | eval ${hash_alg_variable}=YES |
| 667 | fi |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 668 | done |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 669 | } |
| 670 | |
| 671 | # skip next test if the given hash alg is not supported |
| 672 | requires_hash_alg() { |
| 673 | HASH_DEFINE="Invalid" |
| 674 | HAS_HASH_ALG="NO" |
| 675 | case $1 in |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 676 | MD5):;; |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 677 | SHA_1):;; |
| 678 | SHA_224):;; |
| 679 | SHA_256):;; |
| 680 | SHA_384):;; |
| 681 | SHA_512):;; |
| 682 | *) |
| 683 | echo "Unsupported hash alg - $1" |
| 684 | exit 1 |
| 685 | ;; |
| 686 | esac |
| 687 | |
| 688 | HASH_DEFINE=HAS_ALG_${1} |
| 689 | eval "HAS_HASH_ALG=\${${HASH_DEFINE}}" |
| 690 | if [ "$HAS_HASH_ALG" = "NO" ] |
| 691 | then |
| 692 | SKIP_NEXT="YES" |
| 693 | fi |
| 694 | } |
| 695 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 696 | # Skip next test if the given pk alg is not enabled |
| 697 | requires_pk_alg() { |
| 698 | case $1 in |
| 699 | ECDSA) |
| 700 | if is_config_enabled MBEDTLS_USE_PSA_CRYPTO; then |
| 701 | requires_config_enabled PSA_WANT_ALG_ECDSA |
| 702 | else |
| 703 | requires_config_enabled MBEDTLS_ECDSA_C |
| 704 | fi |
| 705 | ;; |
| 706 | *) |
| 707 | echo "Unknown/unimplemented case $1 in requires_pk_alg" |
| 708 | exit 1 |
| 709 | ;; |
| 710 | esac |
| 711 | } |
| 712 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 713 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 714 | requires_openssl_with_fallback_scsv() { |
| 715 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 716 | 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] | 717 | then |
| 718 | OPENSSL_HAS_FBSCSV="YES" |
| 719 | else |
| 720 | OPENSSL_HAS_FBSCSV="NO" |
| 721 | fi |
| 722 | fi |
| 723 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 724 | SKIP_NEXT="YES" |
| 725 | fi |
| 726 | } |
| 727 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 728 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 729 | requires_max_content_len() { |
| 730 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 731 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 732 | } |
| 733 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 734 | # skip next test if GnuTLS isn't available |
| 735 | requires_gnutls() { |
| 736 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 737 | 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] | 738 | GNUTLS_AVAILABLE="YES" |
| 739 | else |
| 740 | GNUTLS_AVAILABLE="NO" |
| 741 | fi |
| 742 | fi |
| 743 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 744 | SKIP_NEXT="YES" |
| 745 | fi |
| 746 | } |
| 747 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 748 | # skip next test if GnuTLS-next isn't available |
| 749 | requires_gnutls_next() { |
| 750 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 751 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 752 | GNUTLS_NEXT_AVAILABLE="YES" |
| 753 | else |
| 754 | GNUTLS_NEXT_AVAILABLE="NO" |
| 755 | fi |
| 756 | fi |
| 757 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 758 | SKIP_NEXT="YES" |
| 759 | fi |
| 760 | } |
| 761 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 762 | requires_openssl_next() { |
| 763 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 764 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 765 | OPENSSL_NEXT_AVAILABLE="YES" |
| 766 | else |
| 767 | OPENSSL_NEXT_AVAILABLE="NO" |
| 768 | fi |
| 769 | fi |
| 770 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 771 | SKIP_NEXT="YES" |
| 772 | fi |
| 773 | } |
| 774 | |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 775 | # skip next test if openssl version is lower than 3.0 |
| 776 | requires_openssl_3_x() { |
| 777 | requires_openssl_next |
| 778 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 779 | OPENSSL_3_X_AVAILABLE="NO" |
| 780 | fi |
| 781 | if [ -z "${OPENSSL_3_X_AVAILABLE:-}" ]; then |
Przemek Stekiel | a53dca1 | 2023-06-14 20:53:09 +0200 | [diff] [blame] | 782 | if $OPENSSL_NEXT version 2>&1 | grep "OpenSSL 3." >/dev/null |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 783 | then |
| 784 | OPENSSL_3_X_AVAILABLE="YES" |
| 785 | else |
| 786 | OPENSSL_3_X_AVAILABLE="NO" |
| 787 | fi |
| 788 | fi |
| 789 | if [ "$OPENSSL_3_X_AVAILABLE" = "NO" ]; then |
| 790 | SKIP_NEXT="YES" |
| 791 | fi |
| 792 | } |
| 793 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 794 | # skip next test if openssl does not support ffdh keys |
| 795 | requires_openssl_tls1_3_with_ffdh() { |
| 796 | requires_openssl_3_x |
| 797 | } |
| 798 | |
Przemek Stekiel | 7dda271 | 2023-06-27 14:43:33 +0200 | [diff] [blame] | 799 | # skip next test if openssl cannot handle ephemeral key exchange |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 800 | requires_openssl_tls1_3_with_compatible_ephemeral() { |
| 801 | requires_openssl_next |
| 802 | |
| 803 | if !(is_config_enabled "PSA_WANT_ALG_ECDH"); then |
| 804 | requires_openssl_tls1_3_with_ffdh |
| 805 | fi |
| 806 | } |
| 807 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 808 | # skip next test if tls1_3 is not available |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 809 | requires_openssl_tls1_3() { |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 810 | requires_openssl_next |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 811 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 812 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 813 | fi |
| 814 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 815 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 816 | then |
| 817 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 818 | else |
| 819 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 820 | fi |
| 821 | fi |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 822 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 823 | SKIP_NEXT="YES" |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 824 | fi |
| 825 | } |
| 826 | |
Gilles Peskine | 5838a64 | 2024-09-09 10:57:01 +0200 | [diff] [blame] | 827 | # OpenSSL servers forbid client renegotiation by default since OpenSSL 3.0. |
| 828 | # Older versions always allow it and have no command-line option. |
Gilles Peskine | ed8cc46 | 2024-09-06 13:52:14 +0200 | [diff] [blame] | 829 | OPENSSL_S_SERVER_CLIENT_RENEGOTIATION= |
| 830 | case $($OPENSSL s_server -help 2>&1) in |
| 831 | *-client_renegotiation*) |
| 832 | OPENSSL_S_SERVER_CLIENT_RENEGOTIATION=-client_renegotiation;; |
| 833 | esac |
| 834 | |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 835 | # skip next test if tls1_3 is not available |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 836 | requires_gnutls_tls1_3() { |
| 837 | requires_gnutls_next |
| 838 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 839 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 840 | fi |
| 841 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 842 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 843 | then |
| 844 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 845 | else |
| 846 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 847 | fi |
| 848 | fi |
| 849 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 850 | SKIP_NEXT="YES" |
| 851 | fi |
| 852 | } |
| 853 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 854 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 855 | requires_gnutls_next_no_ticket() { |
| 856 | requires_gnutls_next |
| 857 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 858 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 859 | fi |
| 860 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 861 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 862 | then |
| 863 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 864 | else |
| 865 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 866 | fi |
| 867 | fi |
| 868 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 869 | SKIP_NEXT="YES" |
| 870 | fi |
| 871 | } |
| 872 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 873 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 874 | requires_gnutls_next_disable_tls13_compat() { |
| 875 | requires_gnutls_next |
| 876 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 877 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 878 | fi |
| 879 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 880 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 881 | then |
| 882 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 883 | else |
| 884 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 885 | fi |
| 886 | fi |
| 887 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 888 | SKIP_NEXT="YES" |
| 889 | fi |
| 890 | } |
| 891 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 892 | # skip next test if GnuTLS does not support the record size limit extension |
| 893 | requires_gnutls_record_size_limit() { |
| 894 | requires_gnutls_next |
| 895 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 896 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="NO" |
| 897 | else |
| 898 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="YES" |
| 899 | fi |
| 900 | if [ "$GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE" = "NO" ]; then |
| 901 | SKIP_NEXT="YES" |
| 902 | fi |
| 903 | } |
| 904 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 905 | # skip next test if IPv6 isn't available on this host |
| 906 | requires_ipv6() { |
| 907 | if [ -z "${HAS_IPV6:-}" ]; then |
| 908 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 909 | SRV_PID=$! |
| 910 | sleep 1 |
| 911 | kill $SRV_PID >/dev/null 2>&1 |
| 912 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 913 | HAS_IPV6="NO" |
| 914 | else |
| 915 | HAS_IPV6="YES" |
| 916 | fi |
| 917 | rm -r $SRV_OUT |
| 918 | fi |
| 919 | |
| 920 | if [ "$HAS_IPV6" = "NO" ]; then |
| 921 | SKIP_NEXT="YES" |
| 922 | fi |
| 923 | } |
| 924 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 925 | # skip next test if it's i686 or uname is not available |
| 926 | requires_not_i686() { |
| 927 | if [ -z "${IS_I686:-}" ]; then |
| 928 | IS_I686="YES" |
| 929 | if which "uname" >/dev/null 2>&1; then |
| 930 | if [ -z "$(uname -a | grep i686)" ]; then |
| 931 | IS_I686="NO" |
| 932 | fi |
| 933 | fi |
| 934 | fi |
| 935 | if [ "$IS_I686" = "YES" ]; then |
| 936 | SKIP_NEXT="YES" |
| 937 | fi |
| 938 | } |
| 939 | |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 940 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 941 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 942 | 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] | 943 | if [ "$LIST_TESTS" -eq 0 ];then |
| 944 | # Calculate the input & output maximum content lengths set in the config |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 945 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 946 | # Calculate the maximum content length that fits both |
| 947 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 948 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 949 | fi |
| 950 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 951 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 952 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 953 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 954 | # skip the next test if the SSL output buffer is less than 16KB |
| 955 | requires_full_size_output_buffer() { |
| 956 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 957 | SKIP_NEXT="YES" |
| 958 | fi |
| 959 | } |
| 960 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 961 | # skip the next test if valgrind is in use |
| 962 | not_with_valgrind() { |
| 963 | if [ "$MEMCHECK" -gt 0 ]; then |
| 964 | SKIP_NEXT="YES" |
| 965 | fi |
| 966 | } |
| 967 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 968 | # skip the next test if valgrind is NOT in use |
| 969 | only_with_valgrind() { |
| 970 | if [ "$MEMCHECK" -eq 0 ]; then |
| 971 | SKIP_NEXT="YES" |
| 972 | fi |
| 973 | } |
| 974 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 975 | # 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] | 976 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 977 | CLI_DELAY_FACTOR=$1 |
| 978 | } |
| 979 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 980 | # wait for the given seconds after the client finished in the next test |
| 981 | server_needs_more_time() { |
| 982 | SRV_DELAY_SECONDS=$1 |
| 983 | } |
| 984 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 985 | # print_name <name> |
| 986 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 987 | TESTS=$(( $TESTS + 1 )) |
| 988 | LINE="" |
| 989 | |
| 990 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 991 | LINE="$TESTS " |
| 992 | fi |
| 993 | |
| 994 | LINE="$LINE$1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 995 | |
Tomás González | 378e364 | 2023-09-04 10:41:37 +0100 | [diff] [blame] | 996 | printf "%s " "$LINE" |
| 997 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
| 998 | for i in `seq 1 $LEN`; do printf '.'; done |
| 999 | printf ' ' |
| 1000 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1001 | } |
| 1002 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1003 | # record_outcome <outcome> [<failure-reason>] |
| 1004 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 1005 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1006 | record_outcome() { |
| 1007 | echo "$1" |
| 1008 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 1009 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 1010 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Jerry Yu | 9e47b26 | 2023-11-06 10:52:01 +0800 | [diff] [blame] | 1011 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1012 | "$1" "${2-}" \ |
| 1013 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 1014 | fi |
| 1015 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 1016 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1017 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 1018 | # True if the presence of the given pattern in a log definitely indicates |
| 1019 | # that the test has failed. False if the presence is inconclusive. |
| 1020 | # |
| 1021 | # Inputs: |
| 1022 | # * $1: pattern found in the logs |
| 1023 | # * $TIMES_LEFT: >0 if retrying is an option |
| 1024 | # |
| 1025 | # Outputs: |
| 1026 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 1027 | # unchanged otherwise. |
| 1028 | # * Return value: 1 if the pattern is inconclusive, |
| 1029 | # 0 if the failure is definitive. |
| 1030 | log_pattern_presence_is_conclusive() { |
| 1031 | # If we've run out of attempts, then don't retry no matter what. |
| 1032 | if [ $TIMES_LEFT -eq 0 ]; then |
| 1033 | return 0 |
| 1034 | fi |
| 1035 | case $1 in |
| 1036 | "resend") |
| 1037 | # An undesired resend may have been caused by the OS dropping or |
| 1038 | # delaying a packet at an inopportune time. |
| 1039 | outcome="RETRY(resend)" |
| 1040 | return 1;; |
| 1041 | esac |
| 1042 | } |
| 1043 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1044 | # fail <message> |
| 1045 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1046 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 1047 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1048 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 1049 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1050 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1051 | if [ -n "$PXY_CMD" ]; then |
| 1052 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1053 | fi |
| 1054 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1055 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 1056 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1057 | echo " ! server output:" |
| 1058 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1059 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1060 | echo " ! client output:" |
| 1061 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1062 | if [ -n "$PXY_CMD" ]; then |
| 1063 | echo " ! ========================================================" |
| 1064 | echo " ! proxy output:" |
| 1065 | cat o-pxy-${TESTS}.log |
| 1066 | fi |
| 1067 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1068 | fi |
| 1069 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 1070 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1071 | } |
| 1072 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1073 | # is_polar <cmd_line> |
| 1074 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1075 | case "$1" in |
| 1076 | *ssl_client2*) true;; |
| 1077 | *ssl_server2*) true;; |
| 1078 | *) false;; |
| 1079 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1080 | } |
| 1081 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 1082 | # openssl s_server doesn't have -www with DTLS |
| 1083 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1084 | case "$SRV_CMD" in |
| 1085 | *s_server*-dtls*) |
| 1086 | NEEDS_INPUT=1 |
| 1087 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 1088 | *) NEEDS_INPUT=0;; |
| 1089 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 1090 | } |
| 1091 | |
| 1092 | # provide input to commands that need it |
| 1093 | provide_input() { |
| 1094 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 1095 | return |
| 1096 | fi |
| 1097 | |
| 1098 | while true; do |
| 1099 | echo "HTTP/1.0 200 OK" |
| 1100 | sleep 1 |
| 1101 | done |
| 1102 | } |
| 1103 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1104 | # has_mem_err <log_file_name> |
| 1105 | has_mem_err() { |
| 1106 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 1107 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 1108 | then |
| 1109 | return 1 # false: does not have errors |
| 1110 | else |
| 1111 | return 0 # true: has errors |
| 1112 | fi |
| 1113 | } |
| 1114 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1115 | # 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] | 1116 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1117 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1118 | newline=' |
| 1119 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1120 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1121 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1122 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1123 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1124 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1125 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1126 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 1127 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1128 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1129 | # When we use a proxy, it will be listening on the same port we |
| 1130 | # 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] | 1131 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1132 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1133 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1134 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1135 | echo "$3 START TIMEOUT" |
| 1136 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1137 | break |
| 1138 | fi |
| 1139 | # Linux and *BSD support decimal arguments to sleep. On other |
| 1140 | # OSes this may be a tight loop. |
| 1141 | sleep 0.1 2>/dev/null || true |
| 1142 | done |
| 1143 | } |
| 1144 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1145 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 1146 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1147 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1148 | } |
| 1149 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1150 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1151 | # Wait for server process $2 to be listening on port $1. |
| 1152 | wait_server_start() { |
| 1153 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 1154 | } |
| 1155 | |
| 1156 | # Wait for proxy process $2 to be listening on port $1. |
| 1157 | wait_proxy_start() { |
| 1158 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 1159 | } |
| 1160 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1161 | # 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] | 1162 | # 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] | 1163 | # acceptable bounds |
| 1164 | check_server_hello_time() { |
| 1165 | # 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] | 1166 | 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] | 1167 | # Get the Unix timestamp for now |
| 1168 | CUR_TIME=$(date +'%s') |
| 1169 | THRESHOLD_IN_SECS=300 |
| 1170 | |
| 1171 | # Check if the ServerHello time was printed |
| 1172 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 1173 | return 1 |
| 1174 | fi |
| 1175 | |
| 1176 | # Check the time in ServerHello is within acceptable bounds |
| 1177 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 1178 | # The time in ServerHello is at least 5 minutes before now |
| 1179 | return 1 |
| 1180 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 1181 | # 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] | 1182 | return 1 |
| 1183 | else |
| 1184 | return 0 |
| 1185 | fi |
| 1186 | } |
| 1187 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1188 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 1189 | handshake_memory_get() { |
| 1190 | OUTPUT_VARIABLE="$1" |
| 1191 | OUTPUT_FILE="$2" |
| 1192 | |
| 1193 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 1194 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 1195 | |
| 1196 | # Check if memory usage was read |
| 1197 | if [ -z "$MEM_USAGE" ]; then |
| 1198 | echo "Error: Can not read the value of handshake memory usage" |
| 1199 | return 1 |
| 1200 | else |
| 1201 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 1202 | return 0 |
| 1203 | fi |
| 1204 | } |
| 1205 | |
| 1206 | # Get handshake memory usage from server or client output and check if this value |
| 1207 | # is not higher than the maximum given by the first argument |
| 1208 | handshake_memory_check() { |
| 1209 | MAX_MEMORY="$1" |
| 1210 | OUTPUT_FILE="$2" |
| 1211 | |
| 1212 | # Get memory usage |
| 1213 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 1214 | return 1 |
| 1215 | fi |
| 1216 | |
| 1217 | # Check if memory usage is below max value |
| 1218 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 1219 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 1220 | "but should be below $MAX_MEMORY bytes" |
| 1221 | return 1 |
| 1222 | else |
| 1223 | return 0 |
| 1224 | fi |
| 1225 | } |
| 1226 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1227 | # wait for client to terminate and set CLI_EXIT |
| 1228 | # must be called right after starting the client |
| 1229 | wait_client_done() { |
| 1230 | CLI_PID=$! |
| 1231 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1232 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 1233 | CLI_DELAY_FACTOR=1 |
| 1234 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1235 | ( 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] | 1236 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1237 | |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1238 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
| 1239 | # To remove it from stdout, redirect stdout/stderr to CLI_OUT |
| 1240 | wait $CLI_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1241 | CLI_EXIT=$? |
| 1242 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1243 | kill $DOG_PID >/dev/null 2>&1 |
Jerry Yu | fe52e55 | 2022-07-09 04:23:43 +0000 | [diff] [blame] | 1244 | wait $DOG_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1245 | |
| 1246 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1247 | |
| 1248 | sleep $SRV_DELAY_SECONDS |
| 1249 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1250 | } |
| 1251 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1252 | # check if the given command uses dtls and sets global variable DTLS |
| 1253 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1254 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 1255 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1256 | *) DTLS=0;; |
| 1257 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1258 | } |
| 1259 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1260 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 1261 | is_gnutls() { |
| 1262 | case "$1" in |
| 1263 | *gnutls-cli*) |
| 1264 | CMD_IS_GNUTLS=1 |
| 1265 | ;; |
| 1266 | *gnutls-serv*) |
| 1267 | CMD_IS_GNUTLS=1 |
| 1268 | ;; |
| 1269 | *) |
| 1270 | CMD_IS_GNUTLS=0 |
| 1271 | ;; |
| 1272 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1273 | } |
| 1274 | |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 1275 | # Some external tools (gnutls or openssl) might not have support for static ECDH |
| 1276 | # 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] | 1277 | # and client command lines, given as input, to verify if the current test |
| 1278 | # is using one of these tools. |
| 1279 | use_ext_tool_without_ecdh_support() { |
| 1280 | case "$1" in |
| 1281 | *$GNUTLS_SERV*|\ |
| 1282 | *${GNUTLS_NEXT_SERV:-"gnutls-serv-dummy"}*|\ |
| 1283 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1284 | echo "yes" |
| 1285 | return;; |
| 1286 | esac |
| 1287 | case "$2" in |
| 1288 | *$GNUTLS_CLI*|\ |
| 1289 | *${GNUTLS_NEXT_CLI:-"gnutls-cli-dummy"}*|\ |
| 1290 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1291 | echo "yes" |
| 1292 | return;; |
| 1293 | esac |
| 1294 | echo "no" |
| 1295 | } |
| 1296 | |
Jerry Yu | f467d46 | 2022-11-07 13:12:44 +0800 | [diff] [blame] | 1297 | # Generate random psk_list argument for ssl_server2 |
| 1298 | get_srv_psk_list () |
| 1299 | { |
| 1300 | case $(( TESTS % 3 )) in |
| 1301 | 0) echo "psk_list=abc,dead,def,beef,Client_identity,6162636465666768696a6b6c6d6e6f70";; |
| 1302 | 1) echo "psk_list=abc,dead,Client_identity,6162636465666768696a6b6c6d6e6f70,def,beef";; |
| 1303 | 2) echo "psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70,abc,dead,def,beef";; |
| 1304 | esac |
| 1305 | } |
| 1306 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1307 | # Determine what calc_verify trace is to be expected, if any. |
| 1308 | # |
| 1309 | # calc_verify is only called for two things: to calculate the |
| 1310 | # extended master secret, and to process client authentication. |
| 1311 | # |
| 1312 | # Warning: the current implementation assumes that extended_ms is not |
| 1313 | # disabled on the client or on the server. |
| 1314 | # |
| 1315 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1316 | # * $1: the value of the server auth_mode parameter. |
| 1317 | # 'required' if client authentication is expected, |
| 1318 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1319 | # * $CONFIGS_ENABLED |
| 1320 | # |
| 1321 | # Outputs: |
| 1322 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 1323 | set_maybe_calc_verify() { |
| 1324 | maybe_calc_verify= |
| 1325 | case $CONFIGS_ENABLED in |
| 1326 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 1327 | *) |
| 1328 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1329 | ''|none) return;; |
| 1330 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1331 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 1332 | esac |
| 1333 | esac |
| 1334 | case $CONFIGS_ENABLED in |
| 1335 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 1336 | *) maybe_calc_verify="<= calc verify";; |
| 1337 | esac |
| 1338 | } |
| 1339 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1340 | # Compare file content |
| 1341 | # Usage: find_in_both pattern file1 file2 |
| 1342 | # extract from file1 the first line matching the pattern |
| 1343 | # check in file2 that the same line can be found |
| 1344 | find_in_both() { |
| 1345 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 1346 | if [ -z "$srv_pattern" ]; then |
| 1347 | return 1; |
| 1348 | fi |
| 1349 | |
| 1350 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 1351 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1352 | else |
| 1353 | return 1; |
| 1354 | fi |
| 1355 | } |
| 1356 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1357 | SKIP_HANDSHAKE_CHECK="NO" |
| 1358 | skip_handshake_stage_check() { |
| 1359 | SKIP_HANDSHAKE_CHECK="YES" |
| 1360 | } |
| 1361 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1362 | # Analyze the commands that will be used in a test. |
| 1363 | # |
| 1364 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 1365 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 1366 | # |
| 1367 | # Inputs: |
| 1368 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 1369 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 1370 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 1371 | # |
| 1372 | # Outputs: |
| 1373 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1374 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1375 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 1376 | # 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] | 1377 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1378 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 1379 | case " $SRV_CMD " in |
| 1380 | *' server_addr=::1 '*) |
| 1381 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 1382 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1383 | fi |
| 1384 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1385 | # update CMD_IS_GNUTLS variable |
| 1386 | is_gnutls "$SRV_CMD" |
| 1387 | |
| 1388 | # if the server uses gnutls but doesn't set priority, explicitly |
| 1389 | # set the default priority |
| 1390 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1391 | case "$SRV_CMD" in |
| 1392 | *--priority*) :;; |
| 1393 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 1394 | esac |
| 1395 | fi |
| 1396 | |
| 1397 | # update CMD_IS_GNUTLS variable |
| 1398 | is_gnutls "$CLI_CMD" |
| 1399 | |
| 1400 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1401 | # set the default priority |
| 1402 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1403 | case "$CLI_CMD" in |
| 1404 | *--priority*) :;; |
| 1405 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1406 | esac |
| 1407 | fi |
| 1408 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1409 | # fix client port |
| 1410 | if [ -n "$PXY_CMD" ]; then |
| 1411 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1412 | else |
| 1413 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 1414 | fi |
| 1415 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1416 | # prepend valgrind to our commands if active |
| 1417 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1418 | if is_polar "$SRV_CMD"; then |
| 1419 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1420 | fi |
| 1421 | if is_polar "$CLI_CMD"; then |
| 1422 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1423 | fi |
| 1424 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1425 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1426 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1427 | # Check for failure conditions after a test case. |
| 1428 | # |
| 1429 | # Inputs from run_test: |
| 1430 | # * positional parameters: test options (see run_test documentation) |
| 1431 | # * $CLI_EXIT: client return code |
| 1432 | # * $CLI_EXPECT: expected client return code |
| 1433 | # * $SRV_RET: server return code |
| 1434 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1435 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1436 | # |
| 1437 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1438 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1439 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1440 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1441 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1442 | if [ $TIMES_LEFT -gt 0 ] && |
| 1443 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1444 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1445 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1446 | return |
| 1447 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1448 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1449 | # 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] | 1450 | # (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] | 1451 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1452 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1453 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1454 | then |
| 1455 | if is_polar "$SRV_CMD"; then |
| 1456 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1457 | else |
| 1458 | fail "server or client failed to reach handshake stage" |
| 1459 | return |
| 1460 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1461 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1462 | if is_polar "$CLI_CMD"; then |
| 1463 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1464 | else |
| 1465 | fail "server or client failed to reach handshake stage" |
| 1466 | return |
| 1467 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1468 | fi |
| 1469 | fi |
| 1470 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1471 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1472 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1473 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1474 | # care anyway), in case e.g. the server reports a memory leak. |
| 1475 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1476 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1477 | return |
| 1478 | fi |
| 1479 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1480 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1481 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1482 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1483 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1484 | 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] | 1485 | return |
| 1486 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1487 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1488 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1489 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1490 | # 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] | 1491 | while [ $# -gt 0 ] |
| 1492 | do |
| 1493 | case $1 in |
| 1494 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1495 | 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] | 1496 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1497 | return |
| 1498 | fi |
| 1499 | ;; |
| 1500 | |
| 1501 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1502 | 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] | 1503 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1504 | return |
| 1505 | fi |
| 1506 | ;; |
| 1507 | |
| 1508 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1509 | 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] | 1510 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1511 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1512 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1513 | return |
| 1514 | fi |
| 1515 | ;; |
| 1516 | |
| 1517 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1518 | 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] | 1519 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1520 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1521 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1522 | return |
| 1523 | fi |
| 1524 | ;; |
| 1525 | |
| 1526 | # The filtering in the following two options (-u and -U) do the following |
| 1527 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1528 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1529 | # - keep one of each non-unique line |
| 1530 | # - count how many lines remain |
| 1531 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1532 | # if there were no duplicates. |
| 1533 | "-U") |
| 1534 | 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 |
| 1535 | fail "lines following pattern '$2' must be unique in Server output" |
| 1536 | return |
| 1537 | fi |
| 1538 | ;; |
| 1539 | |
| 1540 | "-u") |
| 1541 | 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 |
| 1542 | 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] | 1543 | return |
| 1544 | fi |
| 1545 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1546 | "-F") |
| 1547 | if ! $2 "$SRV_OUT"; then |
| 1548 | fail "function call to '$2' failed on Server output" |
| 1549 | return |
| 1550 | fi |
| 1551 | ;; |
| 1552 | "-f") |
| 1553 | if ! $2 "$CLI_OUT"; then |
| 1554 | fail "function call to '$2' failed on Client output" |
| 1555 | return |
| 1556 | fi |
| 1557 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1558 | "-g") |
| 1559 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1560 | fail "function call to '$2' failed on Server and Client output" |
| 1561 | return |
| 1562 | fi |
| 1563 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1564 | |
| 1565 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1566 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1567 | exit 1 |
| 1568 | esac |
| 1569 | shift 2 |
| 1570 | done |
| 1571 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1572 | # check valgrind's results |
| 1573 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1574 | 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] | 1575 | fail "Server has memory errors" |
| 1576 | return |
| 1577 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1578 | 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] | 1579 | fail "Client has memory errors" |
| 1580 | return |
| 1581 | fi |
| 1582 | fi |
| 1583 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1584 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1585 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1586 | } |
| 1587 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1588 | # Run the current test case: start the server and if applicable the proxy, run |
| 1589 | # the client, wait for all processes to finish or time out. |
| 1590 | # |
| 1591 | # Inputs: |
| 1592 | # * $NAME: test case name |
| 1593 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1594 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1595 | # |
| 1596 | # Outputs: |
| 1597 | # * $CLI_EXIT: client return code |
| 1598 | # * $SRV_RET: server return code |
| 1599 | do_run_test_once() { |
| 1600 | # run the commands |
| 1601 | if [ -n "$PXY_CMD" ]; then |
| 1602 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1603 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1604 | PXY_PID=$! |
| 1605 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1606 | fi |
| 1607 | |
| 1608 | check_osrv_dtls |
| 1609 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1610 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1611 | SRV_PID=$! |
| 1612 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1613 | |
| 1614 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1615 | # The client must be a subprocess of the script in order for killing it to |
| 1616 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1617 | # not at the end of the line: the latter approach will spawn eval as a |
| 1618 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1619 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1620 | wait_client_done |
| 1621 | |
| 1622 | sleep 0.05 |
| 1623 | |
| 1624 | # terminate the server (and the proxy) |
| 1625 | kill $SRV_PID |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1626 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
Jerry Yu | 27d8092 | 2022-08-02 21:28:55 +0800 | [diff] [blame] | 1627 | # To remove it from stdout, redirect stdout/stderr to SRV_OUT |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1628 | wait $SRV_PID >> $SRV_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1629 | SRV_RET=$? |
| 1630 | |
| 1631 | if [ -n "$PXY_CMD" ]; then |
| 1632 | kill $PXY_PID >/dev/null 2>&1 |
Jerry Yu | 6969eee | 2022-10-10 10:25:26 +0800 | [diff] [blame] | 1633 | wait $PXY_PID >> $PXY_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1634 | fi |
| 1635 | } |
| 1636 | |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1637 | # 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] | 1638 | # $1 and $2 contain the server and client command lines, respectively. |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1639 | # |
| 1640 | # Note: this function only provides some guess about TLS version by simply |
Yanray Wang | 7b320fa | 2023-11-08 10:33:30 +0800 | [diff] [blame] | 1641 | # looking at the server/client command lines. Even though this works |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1642 | # for the sake of tests' filtering (especially in conjunction with the |
| 1643 | # detect_required_features() function), it does NOT guarantee that the |
| 1644 | # result is accurate. It does not check other conditions, such as: |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1645 | # - we can force a ciphersuite which contains "WITH" in its name, meaning |
| 1646 | # that we are going to use TLS 1.2 |
| 1647 | # - etc etc |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1648 | get_tls_version() { |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1649 | # First check if the version is forced on an Mbed TLS peer |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1650 | case $1 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1651 | *tls12*) |
| 1652 | echo "TLS12" |
| 1653 | return;; |
| 1654 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1655 | echo "TLS13" |
| 1656 | return;; |
| 1657 | esac |
| 1658 | case $2 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1659 | *tls12*) |
| 1660 | echo "TLS12" |
| 1661 | return;; |
| 1662 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1663 | echo "TLS13" |
| 1664 | return;; |
| 1665 | esac |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1666 | # Second check if the version is forced on an OpenSSL or GnuTLS peer |
| 1667 | case $1 in |
| 1668 | tls1_2*) |
| 1669 | echo "TLS12" |
| 1670 | return;; |
| 1671 | *tls1_3) |
| 1672 | echo "TLS13" |
| 1673 | return;; |
| 1674 | esac |
| 1675 | case $2 in |
| 1676 | *tls1_2) |
| 1677 | echo "TLS12" |
| 1678 | return;; |
| 1679 | *tls1_3) |
| 1680 | echo "TLS13" |
| 1681 | return;; |
| 1682 | esac |
| 1683 | # Third if the version is not forced, if TLS 1.3 is enabled then the test |
| 1684 | # is aimed to run a TLS 1.3 handshake. |
Gilles Peskine | 0bc5729 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 1685 | if is_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1686 | then |
| 1687 | echo "TLS13" |
| 1688 | else |
| 1689 | echo "TLS12" |
| 1690 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1691 | } |
| 1692 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1693 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1694 | # Options: -s pattern pattern that must be present in server output |
| 1695 | # -c pattern pattern that must be present in client output |
| 1696 | # -u pattern lines after pattern must be unique in client output |
| 1697 | # -f call shell function on client output |
| 1698 | # -S pattern pattern that must be absent in server output |
| 1699 | # -C pattern pattern that must be absent in client output |
| 1700 | # -U pattern lines after pattern must be unique in server output |
| 1701 | # -F call shell function on server output |
| 1702 | # -g call shell function on server and client output |
| 1703 | run_test() { |
| 1704 | NAME="$1" |
| 1705 | shift 1 |
| 1706 | |
Tomás González | 787428a | 2023-08-23 15:27:19 +0100 | [diff] [blame] | 1707 | if is_excluded "$NAME"; then |
| 1708 | SKIP_NEXT="NO" |
| 1709 | # There was no request to run the test, so don't record its outcome. |
| 1710 | return |
| 1711 | fi |
| 1712 | |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1713 | if [ "$LIST_TESTS" -gt 0 ]; then |
Pengyu Lv | 3c170d3 | 2023-11-29 13:53:34 +0800 | [diff] [blame] | 1714 | printf "%s\n" "${TEST_SUITE_NAME:-ssl-opt};$NAME" |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1715 | return |
| 1716 | fi |
| 1717 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 1718 | # Use ssl-opt as default test suite name. Also see record_outcome function |
| 1719 | if is_excluded_test_suite "${TEST_SUITE_NAME:-ssl-opt}"; then |
| 1720 | # Do not skip next test and skip current test. |
| 1721 | SKIP_NEXT="NO" |
| 1722 | return |
| 1723 | fi |
| 1724 | |
Tomás González | 51cb704 | 2023-09-07 10:21:19 +0100 | [diff] [blame] | 1725 | print_name "$NAME" |
| 1726 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1727 | # Do we only run numbered tests? |
| 1728 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1729 | case ",$RUN_TEST_NUMBER," in |
| 1730 | *",$TESTS,"*) :;; |
| 1731 | *) SKIP_NEXT="YES";; |
| 1732 | esac |
| 1733 | fi |
| 1734 | |
| 1735 | # does this test use a proxy? |
| 1736 | if [ "X$1" = "X-p" ]; then |
| 1737 | PXY_CMD="$2" |
| 1738 | shift 2 |
| 1739 | else |
| 1740 | PXY_CMD="" |
| 1741 | fi |
| 1742 | |
| 1743 | # get commands and client output |
| 1744 | SRV_CMD="$1" |
| 1745 | CLI_CMD="$2" |
| 1746 | CLI_EXPECT="$3" |
| 1747 | shift 3 |
| 1748 | |
| 1749 | # Check if test uses files |
| 1750 | case "$SRV_CMD $CLI_CMD" in |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1751 | *$DATA_FILES_PATH/*) |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1752 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1753 | esac |
| 1754 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1755 | # Check if the test uses DTLS. |
| 1756 | detect_dtls "$SRV_CMD" |
| 1757 | if [ "$DTLS" -eq 1 ]; then |
| 1758 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1759 | fi |
| 1760 | |
Yanray Wang | 7b320fa | 2023-11-08 10:33:30 +0800 | [diff] [blame] | 1761 | # 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] | 1762 | EXT_WO_ECDH=$(use_ext_tool_without_ecdh_support "$SRV_CMD" "$CLI_CMD") |
| 1763 | |
Valerio Setti | 726ffbf | 2023-08-02 20:02:44 +0200 | [diff] [blame] | 1764 | # Guess the TLS version which is going to be used |
| 1765 | if [ "$EXT_WO_ECDH" = "no" ]; then |
| 1766 | TLS_VERSION=$(get_tls_version "$SRV_CMD" "$CLI_CMD") |
| 1767 | else |
| 1768 | TLS_VERSION="TLS12" |
| 1769 | fi |
| 1770 | |
Gilles Peskine | 5c766dc | 2024-09-06 15:35:58 +0200 | [diff] [blame] | 1771 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1772 | maybe_adapt_for_psk "$@" |
| 1773 | |
Valerio Setti | 726ffbf | 2023-08-02 20:02:44 +0200 | [diff] [blame] | 1774 | # 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] | 1775 | # from their command-line arguments, check whether they're enabled. |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1776 | detect_required_features "$SRV_CMD" "server" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
| 1777 | detect_required_features "$CLI_CMD" "client" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1778 | |
| 1779 | # should we skip? |
| 1780 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1781 | SKIP_NEXT="NO" |
| 1782 | record_outcome "SKIP" |
| 1783 | SKIPS=$(( $SKIPS + 1 )) |
| 1784 | return |
| 1785 | fi |
| 1786 | |
| 1787 | analyze_test_commands "$@" |
| 1788 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1789 | # One regular run and two retries |
| 1790 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1791 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1792 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1793 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1794 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1795 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1796 | check_test_failure "$@" |
| 1797 | case $outcome in |
| 1798 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1799 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1800 | FAIL) return;; |
| 1801 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1802 | done |
| 1803 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1804 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1805 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1806 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1807 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1808 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1809 | if [ -n "$PXY_CMD" ]; then |
| 1810 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1811 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1812 | fi |
| 1813 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1814 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1815 | } |
| 1816 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1817 | run_test_psa() { |
| 1818 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1819 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1820 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1821 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1822 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1823 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1824 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1825 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1826 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1827 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1828 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1829 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1830 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1831 | -S "error" \ |
| 1832 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1833 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1834 | } |
| 1835 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1836 | run_test_psa_force_curve() { |
| 1837 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1838 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1839 | run_test "PSA - ECDH with $1" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 1840 | "$P_SRV debug_level=4 force_version=tls12 groups=$1" \ |
| 1841 | "$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] | 1842 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1843 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1844 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1845 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1846 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1847 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1848 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1849 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1850 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1851 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1852 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1853 | } |
| 1854 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1855 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1856 | # a maximum fragment length. |
| 1857 | # first argument ($1) is MFL for SSL client |
| 1858 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1859 | run_test_memory_after_handshake_with_mfl() |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1860 | { |
| 1861 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1862 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1863 | |
| 1864 | # Leave some margin for robustness |
| 1865 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1866 | |
| 1867 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1868 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1869 | "$P_CLI debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1870 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1871 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1872 | 0 \ |
| 1873 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1874 | } |
| 1875 | |
| 1876 | |
| 1877 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1878 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1879 | run_tests_memory_after_handshake() |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1880 | { |
| 1881 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1882 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1883 | |
| 1884 | # first test with default MFU is to get reference memory usage |
| 1885 | MEMORY_USAGE_MFL_16K=0 |
| 1886 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1887 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1888 | "$P_CLI debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1889 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1890 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1891 | 0 \ |
| 1892 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1893 | |
| 1894 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1895 | run_test_memory_after_handshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1896 | |
| 1897 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1898 | run_test_memory_after_handshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1899 | |
| 1900 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1901 | run_test_memory_after_handshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1902 | |
| 1903 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1904 | run_test_memory_after_handshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1905 | } |
| 1906 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1907 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1908 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1909 | rm -f context_srv.txt |
| 1910 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1911 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1912 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1913 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1914 | 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] | 1915 | exit 1 |
| 1916 | } |
| 1917 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1918 | # |
| 1919 | # MAIN |
| 1920 | # |
| 1921 | |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 1922 | # Make the outcome file path relative to the original directory, not |
| 1923 | # to .../tests |
| 1924 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 1925 | [!/]*) |
| 1926 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 1927 | ;; |
| 1928 | esac |
| 1929 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 1930 | populate_enabled_hash_algs |
| 1931 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1932 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1933 | # patterns rather than regular expressions, use a case statement instead |
| 1934 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1935 | # detects simple cases: plain substring, everything, nothing. |
| 1936 | # |
| 1937 | # As an exception, the character '.' is treated as an ordinary character |
| 1938 | # if it is the only special character in the string. This is because it's |
| 1939 | # rare to need "any one character", but needing a literal '.' is common |
| 1940 | # (e.g. '-f "DTLS 1.2"'). |
| 1941 | need_grep= |
| 1942 | case "$FILTER" in |
| 1943 | '^$') simple_filter=;; |
| 1944 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1945 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1946 | need_grep=1;; |
| 1947 | *) # No regexp or shell-pattern special character |
| 1948 | simple_filter="*$FILTER*";; |
| 1949 | esac |
| 1950 | case "$EXCLUDE" in |
| 1951 | '^$') simple_exclude=;; |
| 1952 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1953 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1954 | need_grep=1;; |
| 1955 | *) # No regexp or shell-pattern special character |
| 1956 | simple_exclude="*$EXCLUDE*";; |
| 1957 | esac |
| 1958 | if [ -n "$need_grep" ]; then |
| 1959 | is_excluded () { |
| 1960 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1961 | } |
| 1962 | else |
| 1963 | is_excluded () { |
| 1964 | case "$1" in |
| 1965 | $simple_exclude) true;; |
| 1966 | $simple_filter) false;; |
| 1967 | *) true;; |
| 1968 | esac |
| 1969 | } |
| 1970 | fi |
| 1971 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 1972 | # Filter tests according to TEST_SUITE_NAME |
| 1973 | is_excluded_test_suite () { |
| 1974 | if [ -n "$RUN_TEST_SUITE" ] |
| 1975 | then |
| 1976 | case ",$RUN_TEST_SUITE," in |
| 1977 | *",$1,"*) false;; |
| 1978 | *) true;; |
| 1979 | esac |
| 1980 | else |
| 1981 | false |
| 1982 | fi |
| 1983 | |
| 1984 | } |
| 1985 | |
| 1986 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 1987 | if [ "$LIST_TESTS" -eq 0 ];then |
| 1988 | |
| 1989 | # sanity checks, avoid an avalanche of errors |
| 1990 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1991 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1992 | P_PXY_BIN="${P_PXY%%[ ]*}" |
| 1993 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1994 | echo "Command '$P_SRV_BIN' is not an executable file" |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1995 | exit 1 |
| 1996 | fi |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 1997 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1998 | echo "Command '$P_CLI_BIN' is not an executable file" |
| 1999 | exit 1 |
| 2000 | fi |
| 2001 | if [ ! -x "$P_PXY_BIN" ]; then |
| 2002 | echo "Command '$P_PXY_BIN' is not an executable file" |
| 2003 | exit 1 |
| 2004 | fi |
| 2005 | if [ "$MEMCHECK" -gt 0 ]; then |
| 2006 | if which valgrind >/dev/null 2>&1; then :; else |
| 2007 | echo "Memcheck not possible. Valgrind not found" |
| 2008 | exit 1 |
| 2009 | fi |
| 2010 | fi |
| 2011 | if which $OPENSSL >/dev/null 2>&1; then :; else |
| 2012 | echo "Command '$OPENSSL' not found" |
| 2013 | exit 1 |
| 2014 | fi |
| 2015 | |
| 2016 | # used by watchdog |
| 2017 | MAIN_PID="$$" |
| 2018 | |
| 2019 | # We use somewhat arbitrary delays for tests: |
| 2020 | # - how long do we wait for the server to start (when lsof not available)? |
| 2021 | # - how long do we allow for the client to finish? |
| 2022 | # (not to check performance, just to avoid waiting indefinitely) |
| 2023 | # Things are slower with valgrind, so give extra time here. |
| 2024 | # |
| 2025 | # Note: without lsof, there is a trade-off between the running time of this |
| 2026 | # script and the risk of spurious errors because we didn't wait long enough. |
| 2027 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 2028 | # the script, only the case where a client or server gets stuck. |
| 2029 | if [ "$MEMCHECK" -gt 0 ]; then |
| 2030 | START_DELAY=6 |
| 2031 | DOG_DELAY=60 |
| 2032 | else |
| 2033 | START_DELAY=2 |
| 2034 | DOG_DELAY=20 |
| 2035 | fi |
| 2036 | |
| 2037 | # some particular tests need more time: |
| 2038 | # - for the client, we multiply the usual watchdog limit by a factor |
| 2039 | # - for the server, we sleep for a number of seconds after the client exits |
| 2040 | # see client_need_more_time() and server_needs_more_time() |
| 2041 | CLI_DELAY_FACTOR=1 |
| 2042 | SRV_DELAY_SECONDS=0 |
| 2043 | |
| 2044 | # fix commands to use this port, force IPv4 while at it |
| 2045 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
| 2046 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 2047 | # machines that will resolve to ::1, and we don't want ipv6 here. |
| 2048 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 2049 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
| 2050 | 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"}" |
| 2051 | O_SRV="$O_SRV -accept $SRV_PORT" |
| 2052 | O_CLI="$O_CLI -connect 127.0.0.1:+SRV_PORT" |
| 2053 | G_SRV="$G_SRV -p $SRV_PORT" |
| 2054 | G_CLI="$G_CLI -p +SRV_PORT" |
| 2055 | |
| 2056 | # Newer versions of OpenSSL have a syntax to enable all "ciphers", even |
| 2057 | # low-security ones. This covers not just cipher suites but also protocol |
| 2058 | # versions. It is necessary, for example, to use (D)TLS 1.0/1.1 on |
| 2059 | # OpenSSL 1.1.1f from Ubuntu 20.04. The syntax was only introduced in |
| 2060 | # OpenSSL 1.1.0 (21e0c1d23afff48601eb93135defddae51f7e2e3) and I can't find |
| 2061 | # a way to discover it from -help, so check the openssl version. |
| 2062 | case $($OPENSSL version) in |
| 2063 | "OpenSSL 0"*|"OpenSSL 1.0"*) :;; |
| 2064 | *) |
| 2065 | O_CLI="$O_CLI -cipher ALL@SECLEVEL=0" |
| 2066 | O_SRV="$O_SRV -cipher ALL@SECLEVEL=0" |
| 2067 | ;; |
| 2068 | esac |
| 2069 | |
| 2070 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 2071 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
| 2072 | O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT" |
| 2073 | O_NEXT_SRV_EARLY_DATA="$O_NEXT_SRV_EARLY_DATA -accept $SRV_PORT" |
| 2074 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
| 2075 | O_NEXT_CLI_NO_CERT="$O_NEXT_CLI_NO_CERT -connect 127.0.0.1:+SRV_PORT" |
| 2076 | fi |
| 2077 | |
| 2078 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
| 2079 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 2080 | G_NEXT_SRV_NO_CERT="$G_NEXT_SRV_NO_CERT -p $SRV_PORT" |
| 2081 | fi |
| 2082 | |
| 2083 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
| 2084 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
| 2085 | G_NEXT_CLI_NO_CERT="$G_NEXT_CLI_NO_CERT -p +SRV_PORT localhost" |
| 2086 | fi |
| 2087 | |
| 2088 | # Allow SHA-1, because many of our test certificates use it |
| 2089 | P_SRV="$P_SRV allow_sha1=1" |
| 2090 | P_CLI="$P_CLI allow_sha1=1" |
| 2091 | |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 2092 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2093 | # Also pick a unique name for intermediate files |
| 2094 | SRV_OUT="srv_out.$$" |
| 2095 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 2096 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2097 | SESSION="session.$$" |
| 2098 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 2099 | SKIP_NEXT="NO" |
| 2100 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 2101 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 2102 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2103 | # Basic test |
| 2104 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2105 | # Checks that: |
| 2106 | # - 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] | 2107 | # - the expected parameters are selected |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2108 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2109 | requires_hash_alg SHA_512 # "signature_algorithm ext: 6" |
Gilles Peskine | 07e24e9 | 2024-09-07 19:50:17 +0200 | [diff] [blame] | 2110 | requires_any_configs_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED \ |
| 2111 | PSA_WANT_ECC_MONTGOMERY_255 |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2112 | run_test "Default, TLS 1.2" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2113 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2114 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2115 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2116 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 2117 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2118 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 2119 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2120 | -S "error" \ |
| 2121 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2122 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2123 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2124 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2125 | run_test "Default, DTLS" \ |
| 2126 | "$P_SRV dtls=1" \ |
| 2127 | "$P_CLI dtls=1" \ |
| 2128 | 0 \ |
| 2129 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 2130 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2131 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 2132 | run_test "TLS client auth: required" \ |
| 2133 | "$P_SRV auth_mode=required" \ |
| 2134 | "$P_CLI" \ |
| 2135 | 0 \ |
| 2136 | -s "Verifying peer X.509 certificate... ok" |
| 2137 | |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 2138 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2139 | "$P_SRV" \ |
| 2140 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2141 | 0 \ |
| 2142 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2143 | -c "Key size is 256" |
| 2144 | |
| 2145 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2146 | "$P_SRV" \ |
| 2147 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2148 | 0 \ |
| 2149 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2150 | -c "Key size is 128" |
| 2151 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2152 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2153 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2154 | # module does not support PSA dispatching so we need builtin support. |
| 2155 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2156 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2157 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2158 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2159 | run_test "TLS: password protected client key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2160 | "$P_SRV force_version=tls12 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2161 | "$P_CLI crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key.enc key_pwd=PolarSSLTest" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2162 | 0 |
| 2163 | |
| 2164 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2165 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2166 | # module does not support PSA dispatching so we need builtin support. |
| 2167 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2168 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2169 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2170 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2171 | run_test "TLS: password protected server key" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2172 | "$P_SRV crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key.enc key_pwd=PolarSSLTest" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2173 | "$P_CLI force_version=tls12" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2174 | 0 |
| 2175 | |
| 2176 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2177 | requires_config_enabled MBEDTLS_RSA_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2178 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2179 | # module does not support PSA dispatching so we need builtin support. |
| 2180 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2181 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2182 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2183 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2184 | run_test "TLS: password protected server key, two certificates" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2185 | "$P_SRV force_version=tls12\ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2186 | key_file=$DATA_FILES_PATH/server5.key.enc key_pwd=PolarSSLTest crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2187 | key_file2=$DATA_FILES_PATH/server2.key.enc key_pwd2=PolarSSLTest crt_file2=$DATA_FILES_PATH/server2.crt" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2188 | "$P_CLI" \ |
| 2189 | 0 |
| 2190 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2191 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2192 | run_test "CA callback on client" \ |
| 2193 | "$P_SRV debug_level=3" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 2194 | "$P_CLI ca_callback=1 debug_level=3 " \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2195 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2196 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2197 | -S "error" \ |
| 2198 | -C "error" |
| 2199 | |
| 2200 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2201 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2202 | requires_hash_alg SHA_256 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2203 | run_test "CA callback on server" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 2204 | "$P_SRV auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2205 | "$P_CLI ca_callback=1 debug_level=3 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2206 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2207 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2208 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2209 | -s "Verifying peer X.509 certificate... ok" \ |
| 2210 | -S "error" \ |
| 2211 | -C "error" |
| 2212 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2213 | # Test using an EC opaque private key for client authentication |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2214 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2215 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2216 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2217 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2218 | run_test "Opaque key for client authentication: ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2219 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2220 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 2221 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2222 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2223 | 0 \ |
| 2224 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2225 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2226 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2227 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2228 | -S "error" \ |
| 2229 | -C "error" |
| 2230 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2231 | # Test using a RSA opaque private key for client authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2232 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2233 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2234 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2235 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2236 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2237 | run_test "Opaque key for client authentication: ECDHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2238 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2239 | key_file=$DATA_FILES_PATH/server2.key" \ |
| 2240 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2241 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2242 | 0 \ |
| 2243 | -c "key type: Opaque" \ |
| 2244 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2245 | -s "Verifying peer X.509 certificate... ok" \ |
| 2246 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2247 | -S "error" \ |
| 2248 | -C "error" |
| 2249 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2250 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2251 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2252 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2253 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2254 | run_test "Opaque key for client authentication: DHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2255 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2256 | key_file=$DATA_FILES_PATH/server2.key" \ |
| 2257 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2258 | key_file=$DATA_FILES_PATH/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2259 | key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2260 | 0 \ |
| 2261 | -c "key type: Opaque" \ |
| 2262 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2263 | -s "Verifying peer X.509 certificate... ok" \ |
| 2264 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2265 | -S "error" \ |
| 2266 | -C "error" |
| 2267 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2268 | # Test using an EC opaque private key for server authentication |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2269 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2270 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2271 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2272 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2273 | run_test "Opaque key for server authentication: ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2274 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2275 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2276 | "$P_CLI force_version=tls12" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2277 | 0 \ |
| 2278 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2279 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2280 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2281 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2282 | -S "error" \ |
| 2283 | -C "error" |
| 2284 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2285 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2286 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2287 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2288 | run_test "Opaque key for server authentication: ECDH-" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2289 | "$P_SRV auth_mode=required key_opaque=1\ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2290 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt\ |
| 2291 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdh,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2292 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2293 | 0 \ |
| 2294 | -c "Verifying peer X.509 certificate... ok" \ |
| 2295 | -c "Ciphersuite is TLS-ECDH-" \ |
| 2296 | -s "key types: Opaque, none" \ |
| 2297 | -s "Ciphersuite is TLS-ECDH-" \ |
| 2298 | -S "error" \ |
| 2299 | -C "error" |
| 2300 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2301 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2302 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2303 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2304 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2305 | run_test "Opaque key for server authentication: invalid key: decrypt with ECC key, no async" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2306 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2307 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=rsa-decrypt,none \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2308 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2309 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2310 | 1 \ |
| 2311 | -s "key types: Opaque, none" \ |
| 2312 | -s "error" \ |
| 2313 | -c "error" \ |
| 2314 | -c "Public key type mismatch" |
| 2315 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2316 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2317 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2318 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2319 | requires_config_enabled MBEDTLS_RSA_C |
| 2320 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2321 | requires_hash_alg SHA_256 |
| 2322 | run_test "Opaque key for server authentication: invalid key: ecdh with RSA key, no async" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2323 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2324 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=ecdh,none \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2325 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2326 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2327 | 1 \ |
| 2328 | -s "key types: Opaque, none" \ |
| 2329 | -s "error" \ |
| 2330 | -c "error" \ |
| 2331 | -c "Public key type mismatch" |
| 2332 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2333 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2334 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2335 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2336 | requires_hash_alg SHA_256 |
| 2337 | run_test "Opaque key for server authentication: invalid alg: decrypt with ECC key, async" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2338 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2339 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=rsa-decrypt,none \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2340 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2341 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2342 | 1 \ |
| 2343 | -s "key types: Opaque, none" \ |
| 2344 | -s "got ciphersuites in common, but none of them usable" \ |
| 2345 | -s "error" \ |
| 2346 | -c "error" |
| 2347 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2348 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2349 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2350 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2351 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2352 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2353 | run_test "Opaque key for server authentication: invalid alg: ecdh with RSA key, async" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2354 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2355 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2356 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2357 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2358 | 1 \ |
| 2359 | -s "key types: Opaque, none" \ |
| 2360 | -s "got ciphersuites in common, but none of them usable" \ |
| 2361 | -s "error" \ |
| 2362 | -c "error" |
| 2363 | |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2364 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2365 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2366 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2367 | run_test "Opaque key for server authentication: invalid alg: ECDHE-ECDSA with ecdh" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2368 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2369 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2370 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2371 | "$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] | 2372 | 1 \ |
| 2373 | -s "key types: Opaque, none" \ |
| 2374 | -s "got ciphersuites in common, but none of them usable" \ |
| 2375 | -s "error" \ |
| 2376 | -c "error" |
| 2377 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2378 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2379 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2380 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2381 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2382 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2383 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2384 | "$P_SRV force_version=tls12 key_opaque=1 crt_file=$DATA_FILES_PATH/server7.crt \ |
| 2385 | key_file=$DATA_FILES_PATH/server7.key key_opaque_algs=ecdh,none \ |
| 2386 | crt_file2=$DATA_FILES_PATH/server5.crt key_file2=$DATA_FILES_PATH/server5.key \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2387 | key_opaque_algs2=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2388 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2389 | 0 \ |
| 2390 | -c "Verifying peer X.509 certificate... ok" \ |
| 2391 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2392 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2393 | -s "key types: Opaque, Opaque" \ |
| 2394 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2395 | -S "error" \ |
| 2396 | -C "error" |
| 2397 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2398 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2399 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2400 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2401 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2402 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDH-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2403 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server7.crt \ |
| 2404 | key_file=$DATA_FILES_PATH/server7.key key_opaque_algs=ecdsa-sign,none \ |
| 2405 | crt_file2=$DATA_FILES_PATH/server5.crt key_file2=$DATA_FILES_PATH/server5.key \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2406 | key_opaque_algs2=ecdh,none debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2407 | "$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] | 2408 | 0 \ |
| 2409 | -c "Verifying peer X.509 certificate... ok" \ |
| 2410 | -c "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2411 | -c "CN=Polarssl Test EC CA" \ |
| 2412 | -s "key types: Opaque, Opaque" \ |
| 2413 | -s "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2414 | -S "error" \ |
| 2415 | -C "error" |
| 2416 | |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2417 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2418 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2419 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2420 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2421 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2422 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2423 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2424 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2425 | key_file2=$DATA_FILES_PATH/server2.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2426 | "$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] | 2427 | 0 \ |
| 2428 | -c "Verifying peer X.509 certificate... ok" \ |
| 2429 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2430 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2431 | -s "key types: Opaque, Opaque" \ |
| 2432 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2433 | -S "error" \ |
| 2434 | -C "error" |
| 2435 | |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 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: no 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_algs=rsa-decrypt,none" \ |
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 | 1 \ |
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" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 2448 | -s "no suitable signature algorithm" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2449 | |
| 2450 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2451 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2452 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2453 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2454 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2455 | run_test "TLS 1.3 opaque key: suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2456 | "$P_SRV debug_level=4 auth_mode=required key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Ronald Cron | e3196d2 | 2022-09-16 16:43:35 +0200 | [diff] [blame] | 2457 | "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2458 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2459 | -c "key type: Opaque" \ |
| 2460 | -s "key types: Opaque, Opaque" \ |
| 2461 | -C "error" \ |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2462 | -S "error" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2463 | |
| 2464 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2465 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2466 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2467 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2468 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2469 | 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] | 2470 | "$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] | 2471 | "$P_CLI debug_level=4 sig_algs=rsa_pss_rsae_sha256,rsa_pss_rsae_sha512" \ |
| 2472 | 0 \ |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2473 | -s "key types: Opaque, Opaque" \ |
| 2474 | -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \ |
| 2475 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 2476 | -C "error" \ |
| 2477 | -S "error" \ |
| 2478 | |
| 2479 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2480 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2481 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2482 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2483 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2484 | 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] | 2485 | "$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] | 2486 | "$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] | 2487 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2488 | -c "key type: Opaque" \ |
| 2489 | -s "key types: Opaque, Opaque" \ |
| 2490 | -C "error" \ |
| 2491 | -S "error" \ |
| 2492 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2493 | # Test using a RSA opaque private key for server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2494 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2495 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2496 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2497 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2498 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2499 | run_test "Opaque key for server authentication: ECDHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2500 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2501 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2502 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2503 | 0 \ |
| 2504 | -c "Verifying peer X.509 certificate... ok" \ |
| 2505 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2506 | -s "key types: Opaque, none" \ |
| 2507 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2508 | -S "error" \ |
| 2509 | -C "error" |
| 2510 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2511 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2512 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2513 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2514 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2515 | run_test "Opaque key for server authentication: DHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2516 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2517 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2518 | "$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] | 2519 | 0 \ |
| 2520 | -c "Verifying peer X.509 certificate... ok" \ |
| 2521 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2522 | -s "key types: Opaque, none" \ |
| 2523 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2524 | -S "error" \ |
| 2525 | -C "error" |
| 2526 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2527 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2528 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2529 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2530 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2531 | run_test "Opaque key for server authentication: RSA-PSK" \ |
| 2532 | "$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] | 2533 | psk=73776f726466697368 psk_identity=foo" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2534 | "$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] | 2535 | psk=73776f726466697368 psk_identity=foo" \ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2536 | 0 \ |
| 2537 | -c "Verifying peer X.509 certificate... ok" \ |
| 2538 | -c "Ciphersuite is TLS-RSA-PSK-" \ |
| 2539 | -s "key types: Opaque, Opaque" \ |
| 2540 | -s "Ciphersuite is TLS-RSA-PSK-" \ |
| 2541 | -S "error" \ |
| 2542 | -C "error" |
| 2543 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2544 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2545 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2546 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2547 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2548 | run_test "Opaque key for server authentication: RSA-" \ |
| 2549 | "$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] | 2550 | "$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] | 2551 | 0 \ |
| 2552 | -c "Verifying peer X.509 certificate... ok" \ |
| 2553 | -c "Ciphersuite is TLS-RSA-" \ |
| 2554 | -s "key types: Opaque, Opaque" \ |
| 2555 | -s "Ciphersuite is TLS-RSA-" \ |
| 2556 | -S "error" \ |
| 2557 | -C "error" |
| 2558 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2559 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2560 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2561 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2562 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2563 | run_test "Opaque key for server authentication: DHE-RSA, PSS instead of PKCS1" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2564 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2565 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ |
| 2566 | "$P_CLI crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2567 | key_file=$DATA_FILES_PATH/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2568 | 1 \ |
| 2569 | -s "key types: Opaque, none" \ |
| 2570 | -s "got ciphersuites in common, but none of them usable" \ |
| 2571 | -s "error" \ |
| 2572 | -c "error" |
| 2573 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2574 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2575 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2576 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2577 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2578 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2579 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2580 | run_test "Opaque keys for server authentication: RSA keys with different algs" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2581 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2582 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pss,none \ |
| 2583 | crt_file2=$DATA_FILES_PATH/server4.crt \ |
| 2584 | key_file2=$DATA_FILES_PATH/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2585 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2586 | 0 \ |
| 2587 | -c "Verifying peer X.509 certificate... ok" \ |
| 2588 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2589 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2590 | -s "key types: Opaque, Opaque" \ |
| 2591 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2592 | -S "error" \ |
| 2593 | -C "error" |
| 2594 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2595 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2596 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2597 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2598 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2599 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2600 | run_test "Opaque keys for server authentication: EC + RSA, force DHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2601 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2602 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2603 | crt_file2=$DATA_FILES_PATH/server4.crt \ |
| 2604 | key_file2=$DATA_FILES_PATH/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2605 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2606 | 0 \ |
| 2607 | -c "Verifying peer X.509 certificate... ok" \ |
| 2608 | -c "Ciphersuite is TLS-DHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2609 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2610 | -s "key types: Opaque, Opaque" \ |
| 2611 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2612 | -S "error" \ |
| 2613 | -C "error" |
| 2614 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2615 | # Test using an EC opaque private key for client/server authentication |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2616 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2617 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2618 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2619 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2620 | run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2621 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2622 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none" \ |
| 2623 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2624 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2625 | 0 \ |
| 2626 | -c "key type: Opaque" \ |
| 2627 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2628 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2629 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2630 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2631 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2632 | -S "error" \ |
| 2633 | -C "error" |
| 2634 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2635 | # Test using a RSA opaque private key for client/server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2636 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2637 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2638 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2639 | requires_hash_alg SHA_256 |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2640 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2641 | run_test "Opaque key for client/server authentication: ECDHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2642 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2643 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
| 2644 | "$P_CLI force_version=tls12 key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2645 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2646 | 0 \ |
| 2647 | -c "key type: Opaque" \ |
| 2648 | -c "Verifying peer X.509 certificate... ok" \ |
| 2649 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2650 | -s "key types: Opaque, none" \ |
| 2651 | -s "Verifying peer X.509 certificate... ok" \ |
| 2652 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2653 | -S "error" \ |
| 2654 | -C "error" |
| 2655 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2656 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2657 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2658 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2659 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2660 | run_test "Opaque key for client/server authentication: DHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2661 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2662 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
| 2663 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2664 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2665 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2666 | 0 \ |
| 2667 | -c "key type: Opaque" \ |
| 2668 | -c "Verifying peer X.509 certificate... ok" \ |
| 2669 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2670 | -s "key types: Opaque, none" \ |
| 2671 | -s "Verifying peer X.509 certificate... ok" \ |
| 2672 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2673 | -S "error" \ |
| 2674 | -C "error" |
| 2675 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2676 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2677 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 2678 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 2679 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 2680 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 2681 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 2682 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 2683 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 2684 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 2685 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 2686 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 2687 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 2688 | |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2689 | requires_config_enabled PSA_WANT_ECC_SECP_R1_521 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2690 | run_test_psa_force_curve "secp521r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2691 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_512 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2692 | run_test_psa_force_curve "brainpoolP512r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2693 | requires_config_enabled PSA_WANT_ECC_SECP_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2694 | run_test_psa_force_curve "secp384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2695 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2696 | run_test_psa_force_curve "brainpoolP384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2697 | requires_config_enabled PSA_WANT_ECC_SECP_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2698 | run_test_psa_force_curve "secp256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2699 | requires_config_enabled PSA_WANT_ECC_SECP_K1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2700 | run_test_psa_force_curve "secp256k1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2701 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2702 | run_test_psa_force_curve "brainpoolP256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2703 | requires_config_enabled PSA_WANT_ECC_SECP_R1_224 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2704 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2705 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 2706 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2707 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 2708 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 2709 | ## 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] | 2710 | #requires_config_enabled PSA_WANT_ECC_SECP_K1_224 |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2711 | #run_test_psa_force_curve "secp224k1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2712 | requires_config_enabled PSA_WANT_ECC_SECP_R1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2713 | run_test_psa_force_curve "secp192r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2714 | requires_config_enabled PSA_WANT_ECC_SECP_K1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2715 | run_test_psa_force_curve "secp192k1" |
| 2716 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2717 | # Test current time in ServerHello |
| 2718 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 2719 | run_test "ServerHello contains gmt_unix_time" \ |
| 2720 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2721 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2722 | 0 \ |
| 2723 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2724 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2725 | |
| 2726 | # Test for uniqueness of IVs in AEAD ciphersuites |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2727 | run_test "Unique IV in GCM" \ |
| 2728 | "$P_SRV exchanges=20 debug_level=4" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 2729 | "$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] | 2730 | 0 \ |
| 2731 | -u "IV used" \ |
| 2732 | -U "IV used" |
| 2733 | |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2734 | # Test for correctness of sent single supported algorithm |
Gilles Peskine | 07e24e9 | 2024-09-07 19:50:17 +0200 | [diff] [blame] | 2735 | requires_any_configs_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2736 | PSA_WANT_ECC_SECP_R1_256 |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2737 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2738 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Paul Elliott | 3b4ceda | 2022-11-17 12:47:10 +0000 | [diff] [blame] | 2739 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2740 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 2741 | requires_pk_alg "ECDSA" |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2742 | requires_hash_alg SHA_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2743 | run_test "Single supported algorithm sending: mbedtls client" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2744 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2745 | "$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] | 2746 | 0 \ |
| 2747 | -c "Supported Signature Algorithm found: 04 03" |
| 2748 | |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2749 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2750 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 07e24e9 | 2024-09-07 19:50:17 +0200 | [diff] [blame] | 2751 | requires_any_configs_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2752 | PSA_WANT_ECC_SECP_R1_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2753 | requires_hash_alg SHA_256 |
| 2754 | run_test "Single supported algorithm sending: openssl client" \ |
| 2755 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2756 | "$O_CLI -cert $DATA_FILES_PATH/server6.crt \ |
| 2757 | -key $DATA_FILES_PATH/server6.key" \ |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2758 | 0 |
| 2759 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2760 | # Tests for certificate verification callback |
| 2761 | run_test "Configuration-specific CRT verification callback" \ |
| 2762 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | dee6ffa | 2024-08-16 09:53:41 +0200 | [diff] [blame] | 2763 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2764 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2765 | -S "error" \ |
| 2766 | -c "Verify requested for " \ |
| 2767 | -c "Use configuration-specific verification callback" \ |
| 2768 | -C "Use context-specific verification callback" \ |
| 2769 | -C "error" |
| 2770 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2771 | run_test "Context-specific CRT verification callback" \ |
| 2772 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | dee6ffa | 2024-08-16 09:53:41 +0200 | [diff] [blame] | 2773 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2774 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2775 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2776 | -c "Verify requested for " \ |
| 2777 | -c "Use context-specific verification callback" \ |
| 2778 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2779 | -C "error" |
| 2780 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2781 | # Tests for SHA-1 support |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2782 | requires_hash_alg SHA_1 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2783 | run_test "SHA-1 forbidden by default in server certificate" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2784 | "$P_SRV key_file=$DATA_FILES_PATH/server2.key crt_file=$DATA_FILES_PATH/server2.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2785 | "$P_CLI debug_level=2 force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2786 | 1 \ |
| 2787 | -c "The certificate is signed with an unacceptable hash" |
| 2788 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2789 | requires_hash_alg SHA_1 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2790 | run_test "SHA-1 explicitly allowed in server certificate" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2791 | "$P_SRV key_file=$DATA_FILES_PATH/server2.key crt_file=$DATA_FILES_PATH/server2.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2792 | "$P_CLI force_version=tls12 allow_sha1=1" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2793 | 0 |
| 2794 | |
| 2795 | run_test "SHA-256 allowed by default in server certificate" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2796 | "$P_SRV key_file=$DATA_FILES_PATH/server2.key crt_file=$DATA_FILES_PATH/server2-sha256.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2797 | "$P_CLI force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2798 | 0 |
| 2799 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2800 | requires_hash_alg SHA_1 |
| 2801 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2802 | run_test "SHA-1 forbidden by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2803 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2804 | "$P_CLI key_file=$DATA_FILES_PATH/cli-rsa.key crt_file=$DATA_FILES_PATH/cli-rsa-sha1.crt" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2805 | 1 \ |
| 2806 | -s "The certificate is signed with an unacceptable hash" |
| 2807 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2808 | requires_hash_alg SHA_1 |
| 2809 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2810 | run_test "SHA-1 explicitly allowed in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2811 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=1" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2812 | "$P_CLI key_file=$DATA_FILES_PATH/cli-rsa.key crt_file=$DATA_FILES_PATH/cli-rsa-sha1.crt" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2813 | 0 |
| 2814 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2815 | requires_config_enabled MBEDTLS_RSA_C |
| 2816 | requires_hash_alg SHA_256 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2817 | run_test "SHA-256 allowed by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2818 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2819 | "$P_CLI key_file=$DATA_FILES_PATH/cli-rsa.key crt_file=$DATA_FILES_PATH/cli-rsa-sha256.crt" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2820 | 0 |
| 2821 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2822 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2823 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2824 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2825 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2826 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2827 | 0 \ |
| 2828 | -c "next record in same datagram" \ |
| 2829 | -s "next record in same datagram" |
| 2830 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2831 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2832 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2833 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2834 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2835 | 0 \ |
| 2836 | -s "next record in same datagram" \ |
| 2837 | -C "next record in same datagram" |
| 2838 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2839 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2840 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2841 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2842 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2843 | 0 \ |
| 2844 | -S "next record in same datagram" \ |
| 2845 | -c "next record in same datagram" |
| 2846 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2847 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2848 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2849 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2850 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2851 | 0 \ |
| 2852 | -S "next record in same datagram" \ |
| 2853 | -C "next record in same datagram" |
| 2854 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2855 | # Tests for Context serialization |
| 2856 | |
| 2857 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2858 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2859 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2860 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2861 | 0 \ |
| 2862 | -c "Deserializing connection..." \ |
| 2863 | -S "Deserializing connection..." |
| 2864 | |
| 2865 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2866 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2867 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2868 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2869 | 0 \ |
| 2870 | -c "Deserializing connection..." \ |
| 2871 | -S "Deserializing connection..." |
| 2872 | |
| 2873 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2874 | run_test "Context serialization, client serializes, GCM" \ |
| 2875 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2876 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2877 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2878 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2879 | -S "Deserializing connection..." |
| 2880 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2881 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2882 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2883 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2884 | run_test "Context serialization, client serializes, with CID" \ |
| 2885 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2886 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2887 | 0 \ |
| 2888 | -c "Deserializing connection..." \ |
| 2889 | -S "Deserializing connection..." |
| 2890 | |
| 2891 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2892 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2893 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2894 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2895 | 0 \ |
| 2896 | -C "Deserializing connection..." \ |
| 2897 | -s "Deserializing connection..." |
| 2898 | |
| 2899 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2900 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2901 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2902 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2903 | 0 \ |
| 2904 | -C "Deserializing connection..." \ |
| 2905 | -s "Deserializing connection..." |
| 2906 | |
| 2907 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2908 | run_test "Context serialization, server serializes, GCM" \ |
| 2909 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2910 | "$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] | 2911 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2912 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2913 | -s "Deserializing connection..." |
| 2914 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2915 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2916 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2917 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2918 | run_test "Context serialization, server serializes, with CID" \ |
| 2919 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2920 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2921 | 0 \ |
| 2922 | -C "Deserializing connection..." \ |
| 2923 | -s "Deserializing connection..." |
| 2924 | |
| 2925 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2926 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2927 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2928 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2929 | 0 \ |
| 2930 | -c "Deserializing connection..." \ |
| 2931 | -s "Deserializing connection..." |
| 2932 | |
| 2933 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2934 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2935 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2936 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2937 | 0 \ |
| 2938 | -c "Deserializing connection..." \ |
| 2939 | -s "Deserializing connection..." |
| 2940 | |
| 2941 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2942 | run_test "Context serialization, both serialize, GCM" \ |
| 2943 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2944 | "$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] | 2945 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2946 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2947 | -s "Deserializing connection..." |
| 2948 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2950 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2951 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2952 | run_test "Context serialization, both serialize, with CID" \ |
| 2953 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2954 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2955 | 0 \ |
| 2956 | -c "Deserializing connection..." \ |
| 2957 | -s "Deserializing connection..." |
| 2958 | |
| 2959 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2960 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2961 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2962 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2963 | 0 \ |
| 2964 | -c "Deserializing connection..." \ |
| 2965 | -S "Deserializing connection..." |
| 2966 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2967 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2968 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2969 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2970 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2971 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2972 | 0 \ |
| 2973 | -c "Deserializing connection..." \ |
| 2974 | -S "Deserializing connection..." |
| 2975 | |
| 2976 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2977 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2978 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2979 | "$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] | 2980 | 0 \ |
| 2981 | -c "Deserializing connection..." \ |
| 2982 | -S "Deserializing connection..." |
| 2983 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2984 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2985 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2986 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2987 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2988 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2989 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2990 | 0 \ |
| 2991 | -c "Deserializing connection..." \ |
| 2992 | -S "Deserializing connection..." |
| 2993 | |
| 2994 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2995 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2996 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2997 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2998 | 0 \ |
| 2999 | -C "Deserializing connection..." \ |
| 3000 | -s "Deserializing connection..." |
| 3001 | |
| 3002 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3003 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 3004 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3005 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 3006 | 0 \ |
| 3007 | -C "Deserializing connection..." \ |
| 3008 | -s "Deserializing connection..." |
| 3009 | |
| 3010 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3011 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 3012 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3013 | "$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] | 3014 | 0 \ |
| 3015 | -C "Deserializing connection..." \ |
| 3016 | -s "Deserializing connection..." |
| 3017 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3018 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 3019 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 3020 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3021 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 3022 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 3023 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 3024 | 0 \ |
| 3025 | -C "Deserializing connection..." \ |
| 3026 | -s "Deserializing connection..." |
| 3027 | |
| 3028 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3029 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 3030 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3031 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3032 | 0 \ |
| 3033 | -c "Deserializing connection..." \ |
| 3034 | -s "Deserializing connection..." |
| 3035 | |
| 3036 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3037 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 3038 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3039 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 3040 | 0 \ |
| 3041 | -c "Deserializing connection..." \ |
| 3042 | -s "Deserializing connection..." |
| 3043 | |
| 3044 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3045 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 3046 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3047 | "$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] | 3048 | 0 \ |
| 3049 | -c "Deserializing connection..." \ |
| 3050 | -s "Deserializing connection..." |
| 3051 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3052 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 3053 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3054 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3055 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 3056 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 3057 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 3058 | 0 \ |
| 3059 | -c "Deserializing connection..." \ |
| 3060 | -s "Deserializing connection..." |
| 3061 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3062 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 3063 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3064 | run_test "Saving the serialized context to a file" \ |
| 3065 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 3066 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 3067 | 0 \ |
| 3068 | -s "Save serialized context to a file... ok" \ |
| 3069 | -c "Save serialized context to a file... ok" |
| 3070 | rm -f context_srv.txt |
| 3071 | rm -f context_cli.txt |
| 3072 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3073 | # Tests for DTLS Connection ID extension |
| 3074 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3075 | # So far, the CID API isn't implemented, so we can't |
| 3076 | # grep for output witnessing its use. This needs to be |
| 3077 | # changed once the CID extension is implemented. |
| 3078 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3079 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3080 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3081 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3082 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 3083 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3084 | 0 \ |
| 3085 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3086 | -s "found CID extension" \ |
| 3087 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3088 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3089 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3090 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3091 | -C "found CID extension" \ |
| 3092 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3093 | -C "Copy CIDs into SSL transform" \ |
| 3094 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3095 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3096 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3097 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3098 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3099 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3100 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 3101 | 0 \ |
| 3102 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3103 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3104 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3105 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3106 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3107 | -C "found CID extension" \ |
| 3108 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3109 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 3110 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3111 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3112 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3113 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3114 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3115 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3116 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 3117 | 0 \ |
| 3118 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3119 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3120 | -c "client hello, adding CID extension" \ |
| 3121 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3122 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3123 | -s "server hello, adding CID extension" \ |
| 3124 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3125 | -c "Use of CID extension negotiated" \ |
| 3126 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3127 | -c "Copy CIDs into SSL transform" \ |
| 3128 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3129 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3130 | -s "Use of Connection ID has been negotiated" \ |
| 3131 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3132 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3133 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3134 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3135 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3136 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3137 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 3138 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 3139 | 0 \ |
| 3140 | -c "Enable use of CID extension." \ |
| 3141 | -s "Enable use of CID extension." \ |
| 3142 | -c "client hello, adding CID extension" \ |
| 3143 | -s "found CID extension" \ |
| 3144 | -s "Use of CID extension negotiated" \ |
| 3145 | -s "server hello, adding CID extension" \ |
| 3146 | -c "found CID extension" \ |
| 3147 | -c "Use of CID extension negotiated" \ |
| 3148 | -s "Copy CIDs into SSL transform" \ |
| 3149 | -c "Copy CIDs into SSL transform" \ |
| 3150 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3151 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3152 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3153 | -c "Use of Connection ID has been negotiated" \ |
| 3154 | -c "ignoring unexpected CID" \ |
| 3155 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3156 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3157 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3158 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3159 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 3160 | -p "$P_PXY mtu=800" \ |
| 3161 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3162 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3163 | 0 \ |
| 3164 | -c "Enable use of CID extension." \ |
| 3165 | -s "Enable use of CID extension." \ |
| 3166 | -c "client hello, adding CID extension" \ |
| 3167 | -s "found CID extension" \ |
| 3168 | -s "Use of CID extension negotiated" \ |
| 3169 | -s "server hello, adding CID extension" \ |
| 3170 | -c "found CID extension" \ |
| 3171 | -c "Use of CID extension negotiated" \ |
| 3172 | -s "Copy CIDs into SSL transform" \ |
| 3173 | -c "Copy CIDs into SSL transform" \ |
| 3174 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3175 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3176 | -s "Use of Connection ID has been negotiated" \ |
| 3177 | -c "Use of Connection ID has been negotiated" |
| 3178 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3179 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3180 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3181 | 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] | 3182 | -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] | 3183 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3184 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3185 | 0 \ |
| 3186 | -c "Enable use of CID extension." \ |
| 3187 | -s "Enable use of CID extension." \ |
| 3188 | -c "client hello, adding CID extension" \ |
| 3189 | -s "found CID extension" \ |
| 3190 | -s "Use of CID extension negotiated" \ |
| 3191 | -s "server hello, adding CID extension" \ |
| 3192 | -c "found CID extension" \ |
| 3193 | -c "Use of CID extension negotiated" \ |
| 3194 | -s "Copy CIDs into SSL transform" \ |
| 3195 | -c "Copy CIDs into SSL transform" \ |
| 3196 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3197 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3198 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3199 | -c "Use of Connection ID has been negotiated" \ |
| 3200 | -c "ignoring unexpected CID" \ |
| 3201 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3202 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3203 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3204 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3205 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3206 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3207 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3208 | 0 \ |
| 3209 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3210 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3211 | -c "client hello, adding CID extension" \ |
| 3212 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3213 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3214 | -s "server hello, adding CID extension" \ |
| 3215 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3216 | -c "Use of CID extension negotiated" \ |
| 3217 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3218 | -c "Copy CIDs into SSL transform" \ |
| 3219 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3220 | -s "Peer CID (length 0 Bytes):" \ |
| 3221 | -s "Use of Connection ID has been negotiated" \ |
| 3222 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3223 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3224 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3225 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3226 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3227 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3228 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3229 | 0 \ |
| 3230 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3231 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3232 | -c "client hello, adding CID extension" \ |
| 3233 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3234 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3235 | -s "server hello, adding CID extension" \ |
| 3236 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3237 | -c "Use of CID extension negotiated" \ |
| 3238 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3239 | -c "Copy CIDs into SSL transform" \ |
| 3240 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3241 | -c "Peer CID (length 0 Bytes):" \ |
| 3242 | -s "Use of Connection ID has been negotiated" \ |
| 3243 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3244 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3246 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3247 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3248 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3249 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3250 | 0 \ |
| 3251 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3252 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3253 | -c "client hello, adding CID extension" \ |
| 3254 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3255 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3256 | -s "server hello, adding CID extension" \ |
| 3257 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3258 | -c "Use of CID extension negotiated" \ |
| 3259 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3260 | -c "Copy CIDs into SSL transform" \ |
| 3261 | -S "Use of Connection ID has been negotiated" \ |
| 3262 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3263 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3264 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3265 | 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] | 3266 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3267 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3268 | 0 \ |
| 3269 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3270 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3271 | -c "client hello, adding CID extension" \ |
| 3272 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3273 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3274 | -s "server hello, adding CID extension" \ |
| 3275 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3276 | -c "Use of CID extension negotiated" \ |
| 3277 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3278 | -c "Copy CIDs into SSL transform" \ |
| 3279 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3280 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3281 | -s "Use of Connection ID has been negotiated" \ |
| 3282 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3283 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3284 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3285 | 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] | 3286 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3287 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3288 | 0 \ |
| 3289 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3290 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3291 | -c "client hello, adding CID extension" \ |
| 3292 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3293 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3294 | -s "server hello, adding CID extension" \ |
| 3295 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3296 | -c "Use of CID extension negotiated" \ |
| 3297 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3298 | -c "Copy CIDs into SSL transform" \ |
| 3299 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3300 | -s "Peer CID (length 0 Bytes):" \ |
| 3301 | -s "Use of Connection ID has been negotiated" \ |
| 3302 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3303 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3304 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3305 | 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] | 3306 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3307 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3308 | 0 \ |
| 3309 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3310 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3311 | -c "client hello, adding CID extension" \ |
| 3312 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3313 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3314 | -s "server hello, adding CID extension" \ |
| 3315 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3316 | -c "Use of CID extension negotiated" \ |
| 3317 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3318 | -c "Copy CIDs into SSL transform" \ |
| 3319 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3320 | -c "Peer CID (length 0 Bytes):" \ |
| 3321 | -s "Use of Connection ID has been negotiated" \ |
| 3322 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3323 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3324 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3325 | 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] | 3326 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3327 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3328 | 0 \ |
| 3329 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3330 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3331 | -c "client hello, adding CID extension" \ |
| 3332 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3333 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3334 | -s "server hello, adding CID extension" \ |
| 3335 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3336 | -c "Use of CID extension negotiated" \ |
| 3337 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3338 | -c "Copy CIDs into SSL transform" \ |
| 3339 | -S "Use of Connection ID has been negotiated" \ |
| 3340 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3341 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3342 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3343 | 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] | 3344 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3345 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3346 | 0 \ |
| 3347 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3348 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3349 | -c "client hello, adding CID extension" \ |
| 3350 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3351 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3352 | -s "server hello, adding CID extension" \ |
| 3353 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3354 | -c "Use of CID extension negotiated" \ |
| 3355 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3356 | -c "Copy CIDs into SSL transform" \ |
| 3357 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3358 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3359 | -s "Use of Connection ID has been negotiated" \ |
| 3360 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3361 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3362 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3363 | 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] | 3364 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3365 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3366 | 0 \ |
| 3367 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3368 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3369 | -c "client hello, adding CID extension" \ |
| 3370 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3371 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3372 | -s "server hello, adding CID extension" \ |
| 3373 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3374 | -c "Use of CID extension negotiated" \ |
| 3375 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3376 | -c "Copy CIDs into SSL transform" \ |
| 3377 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3378 | -s "Peer CID (length 0 Bytes):" \ |
| 3379 | -s "Use of Connection ID has been negotiated" \ |
| 3380 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3381 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3382 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3383 | 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] | 3384 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3385 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3386 | 0 \ |
| 3387 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3388 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3389 | -c "client hello, adding CID extension" \ |
| 3390 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3391 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3392 | -s "server hello, adding CID extension" \ |
| 3393 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3394 | -c "Use of CID extension negotiated" \ |
| 3395 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3396 | -c "Copy CIDs into SSL transform" \ |
| 3397 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3398 | -c "Peer CID (length 0 Bytes):" \ |
| 3399 | -s "Use of Connection ID has been negotiated" \ |
| 3400 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3401 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3402 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3403 | 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] | 3404 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3405 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3406 | 0 \ |
| 3407 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3408 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3409 | -c "client hello, adding CID extension" \ |
| 3410 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3411 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3412 | -s "server hello, adding CID extension" \ |
| 3413 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3414 | -c "Use of CID extension negotiated" \ |
| 3415 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3416 | -c "Copy CIDs into SSL transform" \ |
| 3417 | -S "Use of Connection ID has been negotiated" \ |
| 3418 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3419 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3420 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3421 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3422 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3423 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3424 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3425 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3426 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3427 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3428 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3429 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3430 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3431 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3432 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3433 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3434 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3435 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3436 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3437 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3438 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3439 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3440 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3441 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3442 | 0 \ |
| 3443 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3444 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3445 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3446 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3447 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3448 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3449 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3450 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3451 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3452 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3453 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3454 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3455 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 3456 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3457 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3458 | 0 \ |
| 3459 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3460 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3461 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3462 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3463 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3464 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3465 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3466 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3467 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3468 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3469 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3470 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3471 | 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] | 3472 | -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] | 3473 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3474 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3475 | 0 \ |
| 3476 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3477 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3478 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3479 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3480 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3481 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3482 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3483 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3484 | -c "ignoring unexpected CID" \ |
| 3485 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3486 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3487 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3488 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3489 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3490 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3491 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3492 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3493 | 0 \ |
| 3494 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3495 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3496 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3497 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3498 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3499 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3500 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3501 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3502 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3503 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3504 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3505 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3506 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 3507 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3508 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3509 | 0 \ |
| 3510 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3511 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3512 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3513 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3514 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3515 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3516 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3517 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3518 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3519 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3520 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3521 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3522 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3523 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3524 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3525 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3526 | 0 \ |
| 3527 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3528 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3529 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3530 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3531 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3532 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3533 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3534 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3535 | -c "ignoring unexpected CID" \ |
| 3536 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3537 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3538 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3539 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3540 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3541 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3542 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3543 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3544 | 0 \ |
| 3545 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3546 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3547 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3548 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3549 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3550 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3551 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3552 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3553 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3554 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3555 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 3556 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3557 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3558 | 0 \ |
| 3559 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3560 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3561 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3562 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3563 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3564 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3565 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3566 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3567 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3568 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3569 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3570 | -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] | 3571 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3572 | "$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" \ |
| 3573 | 0 \ |
| 3574 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3575 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3576 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3577 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3578 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3579 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3580 | -c "ignoring unexpected CID" \ |
| 3581 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3582 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3583 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3584 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3585 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3586 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3587 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3588 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3589 | 0 \ |
| 3590 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3591 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3592 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3593 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3594 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3595 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3596 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3597 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3598 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 3599 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3600 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3601 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3602 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3603 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3604 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3605 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3606 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3607 | 0 \ |
| 3608 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3609 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3610 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3611 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3612 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3613 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3614 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3615 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3616 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 3617 | -c "ignoring unexpected CID" \ |
| 3618 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3619 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3620 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3621 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3622 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3623 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 3624 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3625 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3626 | 0 \ |
| 3627 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3628 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3629 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3630 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3631 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3632 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3633 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3634 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3635 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 3636 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3637 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3638 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3639 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3640 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3641 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3642 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3643 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3644 | 0 \ |
| 3645 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3646 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3647 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3648 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3649 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3650 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3651 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3652 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3653 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 3654 | -c "ignoring unexpected CID" \ |
| 3655 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3656 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3657 | # 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] | 3658 | # tests check that the buffer contents are reallocated when the message is |
| 3659 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3660 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3661 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3662 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3663 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 3664 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3665 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 3666 | 0 \ |
| 3667 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3668 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3669 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3670 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3671 | -s "Reallocating in_buf" \ |
| 3672 | -s "Reallocating out_buf" |
| 3673 | |
| 3674 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3675 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3676 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3677 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 3678 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3679 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 3680 | 0 \ |
| 3681 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3682 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3683 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3684 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3685 | -s "Reallocating in_buf" \ |
| 3686 | -s "Reallocating out_buf" |
| 3687 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3688 | # Tests for Encrypt-then-MAC extension |
| 3689 | |
| 3690 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3691 | "$P_SRV debug_level=3 \ |
| 3692 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3693 | "$P_CLI debug_level=3" \ |
| 3694 | 0 \ |
| 3695 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3696 | -s "found encrypt then mac extension" \ |
| 3697 | -s "server hello, adding encrypt then mac extension" \ |
| 3698 | -c "found encrypt_then_mac extension" \ |
| 3699 | -c "using encrypt then mac" \ |
| 3700 | -s "using encrypt then mac" |
| 3701 | |
| 3702 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3703 | "$P_SRV debug_level=3 etm=0 \ |
| 3704 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3705 | "$P_CLI debug_level=3 etm=1" \ |
| 3706 | 0 \ |
| 3707 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3708 | -s "found encrypt then mac extension" \ |
| 3709 | -S "server hello, adding encrypt then mac extension" \ |
| 3710 | -C "found encrypt_then_mac extension" \ |
| 3711 | -C "using encrypt then mac" \ |
| 3712 | -S "using encrypt then mac" |
| 3713 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3714 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3715 | "$P_SRV debug_level=3 etm=1 \ |
| 3716 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3717 | "$P_CLI debug_level=3 etm=1" \ |
| 3718 | 0 \ |
| 3719 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3720 | -s "found encrypt then mac extension" \ |
| 3721 | -S "server hello, adding encrypt then mac extension" \ |
| 3722 | -C "found encrypt_then_mac extension" \ |
| 3723 | -C "using encrypt then mac" \ |
| 3724 | -S "using encrypt then mac" |
| 3725 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3726 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3727 | "$P_SRV debug_level=3 etm=1 \ |
| 3728 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3729 | "$P_CLI debug_level=3 etm=0" \ |
| 3730 | 0 \ |
| 3731 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3732 | -S "found encrypt then mac extension" \ |
| 3733 | -S "server hello, adding encrypt then mac extension" \ |
| 3734 | -C "found encrypt_then_mac extension" \ |
| 3735 | -C "using encrypt then mac" \ |
| 3736 | -S "using encrypt then mac" |
| 3737 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3738 | # Tests for Extended Master Secret extension |
| 3739 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3740 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3741 | run_test "Extended Master Secret: default" \ |
| 3742 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3743 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3744 | 0 \ |
| 3745 | -c "client hello, adding extended_master_secret extension" \ |
| 3746 | -s "found extended master secret extension" \ |
| 3747 | -s "server hello, adding extended master secret extension" \ |
| 3748 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3749 | -c "session hash for extended master secret" \ |
| 3750 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3751 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3752 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3753 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3754 | "$P_SRV debug_level=3 extended_ms=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3755 | "$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] | 3756 | 0 \ |
| 3757 | -c "client hello, adding extended_master_secret extension" \ |
| 3758 | -s "found extended master secret extension" \ |
| 3759 | -S "server hello, adding extended master secret extension" \ |
| 3760 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3761 | -C "session hash for extended master secret" \ |
| 3762 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3763 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3764 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3765 | run_test "Extended Master Secret: client disabled, server enabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3766 | "$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] | 3767 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3768 | 0 \ |
| 3769 | -C "client hello, adding extended_master_secret extension" \ |
| 3770 | -S "found extended master secret extension" \ |
| 3771 | -S "server hello, adding extended master secret extension" \ |
| 3772 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3773 | -C "session hash for extended master secret" \ |
| 3774 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3775 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3776 | # Test sending and receiving empty application data records |
| 3777 | |
| 3778 | run_test "Encrypt then MAC: empty application data record" \ |
| 3779 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3780 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3781 | 0 \ |
| 3782 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3783 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3784 | -c "0 bytes written in 1 fragments" |
| 3785 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3786 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3787 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3788 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3789 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3790 | 0 \ |
| 3791 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3792 | -c "0 bytes written in 1 fragments" |
| 3793 | |
| 3794 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3795 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3796 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3797 | 0 \ |
| 3798 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3799 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3800 | -c "0 bytes written in 1 fragments" |
| 3801 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3802 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3803 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3804 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3805 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3806 | 0 \ |
| 3807 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3808 | -c "0 bytes written in 1 fragments" |
| 3809 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3810 | # Tests for CBC 1/n-1 record splitting |
| 3811 | |
| 3812 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3813 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3814 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3815 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3816 | 0 \ |
| 3817 | -s "Read from client: 123 bytes read" \ |
| 3818 | -S "Read from client: 1 bytes read" \ |
| 3819 | -S "122 bytes read" |
| 3820 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3821 | # Tests for Session Tickets |
| 3822 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3823 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3824 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3825 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3826 | "$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] | 3827 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3828 | -c "client hello, adding session ticket extension" \ |
| 3829 | -s "found session ticket extension" \ |
| 3830 | -s "server hello, adding session ticket extension" \ |
| 3831 | -c "found session_ticket extension" \ |
| 3832 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3833 | -S "session successfully restored from cache" \ |
| 3834 | -s "session successfully restored from ticket" \ |
| 3835 | -s "a session has been resumed" \ |
| 3836 | -c "a session has been resumed" |
| 3837 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3838 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3839 | run_test "Session resume using tickets: manual rotation" \ |
| 3840 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3841 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3842 | 0 \ |
| 3843 | -c "client hello, adding session ticket extension" \ |
| 3844 | -s "found session ticket extension" \ |
| 3845 | -s "server hello, adding session ticket extension" \ |
| 3846 | -c "found session_ticket extension" \ |
| 3847 | -c "parse new session ticket" \ |
| 3848 | -S "session successfully restored from cache" \ |
| 3849 | -s "session successfully restored from ticket" \ |
| 3850 | -s "a session has been resumed" \ |
| 3851 | -c "a session has been resumed" |
| 3852 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3853 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3854 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3855 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3856 | "$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] | 3857 | 0 \ |
| 3858 | -c "client hello, adding session ticket extension" \ |
| 3859 | -s "found session ticket extension" \ |
| 3860 | -s "server hello, adding session ticket extension" \ |
| 3861 | -c "found session_ticket extension" \ |
| 3862 | -c "parse new session ticket" \ |
| 3863 | -S "session successfully restored from cache" \ |
| 3864 | -s "session successfully restored from ticket" \ |
| 3865 | -s "a session has been resumed" \ |
| 3866 | -c "a session has been resumed" |
| 3867 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3868 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3869 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3870 | "$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] | 3871 | "$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] | 3872 | 0 \ |
| 3873 | -c "client hello, adding session ticket extension" \ |
| 3874 | -s "found session ticket extension" \ |
| 3875 | -s "server hello, adding session ticket extension" \ |
| 3876 | -c "found session_ticket extension" \ |
| 3877 | -c "parse new session ticket" \ |
| 3878 | -S "session successfully restored from cache" \ |
| 3879 | -S "session successfully restored from ticket" \ |
| 3880 | -S "a session has been resumed" \ |
| 3881 | -C "a session has been resumed" |
| 3882 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3883 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3884 | run_test "Session resume using tickets: session copy" \ |
| 3885 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3886 | "$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] | 3887 | 0 \ |
| 3888 | -c "client hello, adding session ticket extension" \ |
| 3889 | -s "found session ticket extension" \ |
| 3890 | -s "server hello, adding session ticket extension" \ |
| 3891 | -c "found session_ticket extension" \ |
| 3892 | -c "parse new session ticket" \ |
| 3893 | -S "session successfully restored from cache" \ |
| 3894 | -s "session successfully restored from ticket" \ |
| 3895 | -s "a session has been resumed" \ |
| 3896 | -c "a session has been resumed" |
| 3897 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3898 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3899 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3900 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3901 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 3902 | "$P_CLI debug_level=3 tickets=1 new_session_tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3903 | 0 \ |
| 3904 | -c "client hello, adding session ticket extension" \ |
| 3905 | -c "found session_ticket extension" \ |
| 3906 | -c "parse new session ticket" \ |
| 3907 | -c "a session has been resumed" |
| 3908 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3909 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3910 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3911 | run_test "Session resume using tickets: openssl client" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 3912 | "$P_SRV force_version=tls12 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3913 | "( $O_CLI -sess_out $SESSION; \ |
| 3914 | $O_CLI -sess_in $SESSION; \ |
| 3915 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3916 | 0 \ |
| 3917 | -s "found session ticket extension" \ |
| 3918 | -s "server hello, adding session ticket extension" \ |
| 3919 | -S "session successfully restored from cache" \ |
| 3920 | -s "session successfully restored from ticket" \ |
| 3921 | -s "a session has been resumed" |
| 3922 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3923 | requires_cipher_enabled "AES" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3924 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3925 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3926 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3927 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3928 | 0 \ |
| 3929 | -c "client hello, adding session ticket extension" \ |
| 3930 | -s "found session ticket extension" \ |
| 3931 | -s "server hello, adding session ticket extension" \ |
| 3932 | -c "found session_ticket extension" \ |
| 3933 | -c "parse new session ticket" \ |
| 3934 | -S "session successfully restored from cache" \ |
| 3935 | -s "session successfully restored from ticket" \ |
| 3936 | -s "a session has been resumed" \ |
| 3937 | -c "a session has been resumed" |
| 3938 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3939 | requires_cipher_enabled "AES" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3940 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3941 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3942 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3943 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3944 | 0 \ |
| 3945 | -c "client hello, adding session ticket extension" \ |
| 3946 | -s "found session ticket extension" \ |
| 3947 | -s "server hello, adding session ticket extension" \ |
| 3948 | -c "found session_ticket extension" \ |
| 3949 | -c "parse new session ticket" \ |
| 3950 | -S "session successfully restored from cache" \ |
| 3951 | -s "session successfully restored from ticket" \ |
| 3952 | -s "a session has been resumed" \ |
| 3953 | -c "a session has been resumed" |
| 3954 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3955 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3956 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3957 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3958 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3959 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3960 | 0 \ |
| 3961 | -c "client hello, adding session ticket extension" \ |
| 3962 | -s "found session ticket extension" \ |
| 3963 | -s "server hello, adding session ticket extension" \ |
| 3964 | -c "found session_ticket extension" \ |
| 3965 | -c "parse new session ticket" \ |
| 3966 | -S "session successfully restored from cache" \ |
| 3967 | -s "session successfully restored from ticket" \ |
| 3968 | -s "a session has been resumed" \ |
| 3969 | -c "a session has been resumed" |
| 3970 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3971 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3972 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3973 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 3974 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3975 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3976 | 0 \ |
| 3977 | -c "client hello, adding session ticket extension" \ |
| 3978 | -s "found session ticket extension" \ |
| 3979 | -s "server hello, adding session ticket extension" \ |
| 3980 | -c "found session_ticket extension" \ |
| 3981 | -c "parse new session ticket" \ |
| 3982 | -S "session successfully restored from cache" \ |
| 3983 | -s "session successfully restored from ticket" \ |
| 3984 | -s "a session has been resumed" \ |
| 3985 | -c "a session has been resumed" |
| 3986 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3987 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3988 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3989 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 3990 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3991 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3992 | 0 \ |
| 3993 | -c "client hello, adding session ticket extension" \ |
| 3994 | -s "found session ticket extension" \ |
| 3995 | -s "server hello, adding session ticket extension" \ |
| 3996 | -c "found session_ticket extension" \ |
| 3997 | -c "parse new session ticket" \ |
| 3998 | -S "session successfully restored from cache" \ |
| 3999 | -s "session successfully restored from ticket" \ |
| 4000 | -s "a session has been resumed" \ |
| 4001 | -c "a session has been resumed" |
| 4002 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4003 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4004 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4005 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 4006 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4007 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4008 | 0 \ |
| 4009 | -c "client hello, adding session ticket extension" \ |
| 4010 | -s "found session ticket extension" \ |
| 4011 | -s "server hello, adding session ticket extension" \ |
| 4012 | -c "found session_ticket extension" \ |
| 4013 | -c "parse new session ticket" \ |
| 4014 | -S "session successfully restored from cache" \ |
| 4015 | -s "session successfully restored from ticket" \ |
| 4016 | -s "a session has been resumed" \ |
| 4017 | -c "a session has been resumed" |
| 4018 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4019 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4020 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4021 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 4022 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4023 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4024 | 0 \ |
| 4025 | -c "client hello, adding session ticket extension" \ |
| 4026 | -s "found session ticket extension" \ |
| 4027 | -s "server hello, adding session ticket extension" \ |
| 4028 | -c "found session_ticket extension" \ |
| 4029 | -c "parse new session ticket" \ |
| 4030 | -S "session successfully restored from cache" \ |
| 4031 | -s "session successfully restored from ticket" \ |
| 4032 | -s "a session has been resumed" \ |
| 4033 | -c "a session has been resumed" |
| 4034 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4035 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4036 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4037 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 4038 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4039 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4040 | 0 \ |
| 4041 | -c "client hello, adding session ticket extension" \ |
| 4042 | -s "found session ticket extension" \ |
| 4043 | -s "server hello, adding session ticket extension" \ |
| 4044 | -c "found session_ticket extension" \ |
| 4045 | -c "parse new session ticket" \ |
| 4046 | -S "session successfully restored from cache" \ |
| 4047 | -s "session successfully restored from ticket" \ |
| 4048 | -s "a session has been resumed" \ |
| 4049 | -c "a session has been resumed" |
| 4050 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4051 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4052 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4053 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 4054 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4055 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4056 | 0 \ |
| 4057 | -c "client hello, adding session ticket extension" \ |
| 4058 | -s "found session ticket extension" \ |
| 4059 | -s "server hello, adding session ticket extension" \ |
| 4060 | -c "found session_ticket extension" \ |
| 4061 | -c "parse new session ticket" \ |
| 4062 | -S "session successfully restored from cache" \ |
| 4063 | -s "session successfully restored from ticket" \ |
| 4064 | -s "a session has been resumed" \ |
| 4065 | -c "a session has been resumed" |
| 4066 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4067 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4068 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4069 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 4070 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4071 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4072 | 0 \ |
| 4073 | -c "client hello, adding session ticket extension" \ |
| 4074 | -s "found session ticket extension" \ |
| 4075 | -s "server hello, adding session ticket extension" \ |
| 4076 | -c "found session_ticket extension" \ |
| 4077 | -c "parse new session ticket" \ |
| 4078 | -S "session successfully restored from cache" \ |
| 4079 | -s "session successfully restored from ticket" \ |
| 4080 | -s "a session has been resumed" \ |
| 4081 | -c "a session has been resumed" |
| 4082 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4083 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4084 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4085 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 4086 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4087 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4088 | 0 \ |
| 4089 | -c "client hello, adding session ticket extension" \ |
| 4090 | -s "found session ticket extension" \ |
| 4091 | -s "server hello, adding session ticket extension" \ |
| 4092 | -c "found session_ticket extension" \ |
| 4093 | -c "parse new session ticket" \ |
| 4094 | -S "session successfully restored from cache" \ |
| 4095 | -s "session successfully restored from ticket" \ |
| 4096 | -s "a session has been resumed" \ |
| 4097 | -c "a session has been resumed" |
| 4098 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4099 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4100 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4101 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 4102 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4103 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4104 | 0 \ |
| 4105 | -c "client hello, adding session ticket extension" \ |
| 4106 | -s "found session ticket extension" \ |
| 4107 | -s "server hello, adding session ticket extension" \ |
| 4108 | -c "found session_ticket extension" \ |
| 4109 | -c "parse new session ticket" \ |
| 4110 | -S "session successfully restored from cache" \ |
| 4111 | -s "session successfully restored from ticket" \ |
| 4112 | -s "a session has been resumed" \ |
| 4113 | -c "a session has been resumed" |
| 4114 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4115 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4116 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4117 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 4118 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4119 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4120 | 0 \ |
| 4121 | -c "client hello, adding session ticket extension" \ |
| 4122 | -s "found session ticket extension" \ |
| 4123 | -s "server hello, adding session ticket extension" \ |
| 4124 | -c "found session_ticket extension" \ |
| 4125 | -c "parse new session ticket" \ |
| 4126 | -S "session successfully restored from cache" \ |
| 4127 | -s "session successfully restored from ticket" \ |
| 4128 | -s "a session has been resumed" \ |
| 4129 | -c "a session has been resumed" |
| 4130 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4131 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4132 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4133 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 4134 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4135 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4136 | 0 \ |
| 4137 | -c "client hello, adding session ticket extension" \ |
| 4138 | -s "found session ticket extension" \ |
| 4139 | -s "server hello, adding session ticket extension" \ |
| 4140 | -c "found session_ticket extension" \ |
| 4141 | -c "parse new session ticket" \ |
| 4142 | -S "session successfully restored from cache" \ |
| 4143 | -s "session successfully restored from ticket" \ |
| 4144 | -s "a session has been resumed" \ |
| 4145 | -c "a session has been resumed" |
| 4146 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4147 | requires_cipher_enabled "CHACHA20" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4148 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4149 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 4150 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4151 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4152 | 0 \ |
| 4153 | -c "client hello, adding session ticket extension" \ |
| 4154 | -s "found session ticket extension" \ |
| 4155 | -s "server hello, adding session ticket extension" \ |
| 4156 | -c "found session_ticket extension" \ |
| 4157 | -c "parse new session ticket" \ |
| 4158 | -S "session successfully restored from cache" \ |
| 4159 | -s "session successfully restored from ticket" \ |
| 4160 | -s "a session has been resumed" \ |
| 4161 | -c "a session has been resumed" |
| 4162 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4163 | # Tests for Session Tickets with DTLS |
| 4164 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4165 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4166 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4167 | run_test "Session resume using tickets, DTLS: basic" \ |
| 4168 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4169 | "$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] | 4170 | 0 \ |
| 4171 | -c "client hello, adding session ticket extension" \ |
| 4172 | -s "found session ticket extension" \ |
| 4173 | -s "server hello, adding session ticket extension" \ |
| 4174 | -c "found session_ticket extension" \ |
| 4175 | -c "parse new session ticket" \ |
| 4176 | -S "session successfully restored from cache" \ |
| 4177 | -s "session successfully restored from ticket" \ |
| 4178 | -s "a session has been resumed" \ |
| 4179 | -c "a session has been resumed" |
| 4180 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4181 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4182 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4183 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 4184 | "$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] | 4185 | "$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] | 4186 | 0 \ |
| 4187 | -c "client hello, adding session ticket extension" \ |
| 4188 | -s "found session ticket extension" \ |
| 4189 | -s "server hello, adding session ticket extension" \ |
| 4190 | -c "found session_ticket extension" \ |
| 4191 | -c "parse new session ticket" \ |
| 4192 | -S "session successfully restored from cache" \ |
| 4193 | -s "session successfully restored from ticket" \ |
| 4194 | -s "a session has been resumed" \ |
| 4195 | -c "a session has been resumed" |
| 4196 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4197 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4198 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4199 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 4200 | "$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] | 4201 | "$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] | 4202 | 0 \ |
| 4203 | -c "client hello, adding session ticket extension" \ |
| 4204 | -s "found session ticket extension" \ |
| 4205 | -s "server hello, adding session ticket extension" \ |
| 4206 | -c "found session_ticket extension" \ |
| 4207 | -c "parse new session ticket" \ |
| 4208 | -S "session successfully restored from cache" \ |
| 4209 | -S "session successfully restored from ticket" \ |
| 4210 | -S "a session has been resumed" \ |
| 4211 | -C "a session has been resumed" |
| 4212 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4213 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4214 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4215 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 4216 | "$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] | 4217 | "$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] | 4218 | 0 \ |
| 4219 | -c "client hello, adding session ticket extension" \ |
| 4220 | -s "found session ticket extension" \ |
| 4221 | -s "server hello, adding session ticket extension" \ |
| 4222 | -c "found session_ticket extension" \ |
| 4223 | -c "parse new session ticket" \ |
| 4224 | -S "session successfully restored from cache" \ |
| 4225 | -s "session successfully restored from ticket" \ |
| 4226 | -s "a session has been resumed" \ |
| 4227 | -c "a session has been resumed" |
| 4228 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4229 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4230 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4231 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 4232 | "$O_SRV -dtls" \ |
| 4233 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 4234 | 0 \ |
| 4235 | -c "client hello, adding session ticket extension" \ |
| 4236 | -c "found session_ticket extension" \ |
| 4237 | -c "parse new session ticket" \ |
| 4238 | -c "a session has been resumed" |
| 4239 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4240 | # 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] | 4241 | # 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] | 4242 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4243 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4244 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4245 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 4246 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4247 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4248 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4249 | rm -f $SESSION )" \ |
| 4250 | 0 \ |
| 4251 | -s "found session ticket extension" \ |
| 4252 | -s "server hello, adding session ticket extension" \ |
| 4253 | -S "session successfully restored from cache" \ |
| 4254 | -s "session successfully restored from ticket" \ |
| 4255 | -s "a session has been resumed" |
| 4256 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4257 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4258 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4259 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4260 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4261 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4262 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4263 | "$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] | 4264 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4265 | -c "client hello, adding session ticket extension" \ |
| 4266 | -s "found session ticket extension" \ |
| 4267 | -S "server hello, adding session ticket extension" \ |
| 4268 | -C "found session_ticket extension" \ |
| 4269 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4270 | -s "session successfully restored from cache" \ |
| 4271 | -S "session successfully restored from ticket" \ |
| 4272 | -s "a session has been resumed" \ |
| 4273 | -c "a session has been resumed" |
| 4274 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4275 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4276 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4277 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4278 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4279 | "$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] | 4280 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4281 | -C "client hello, adding session ticket extension" \ |
| 4282 | -S "found session ticket extension" \ |
| 4283 | -S "server hello, adding session ticket extension" \ |
| 4284 | -C "found session_ticket extension" \ |
| 4285 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4286 | -s "session successfully restored from cache" \ |
| 4287 | -S "session successfully restored from ticket" \ |
| 4288 | -s "a session has been resumed" \ |
| 4289 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4290 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4291 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4292 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4293 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4294 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4295 | 0 \ |
| 4296 | -S "session successfully restored from cache" \ |
| 4297 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4298 | -S "a session has been resumed" \ |
| 4299 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4300 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4301 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4302 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4303 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4304 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4305 | 0 \ |
| 4306 | -s "session successfully restored from cache" \ |
| 4307 | -S "session successfully restored from ticket" \ |
| 4308 | -s "a session has been resumed" \ |
| 4309 | -c "a session has been resumed" |
| 4310 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4311 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4312 | run_test "Session resume using cache: cache removed" \ |
| 4313 | "$P_SRV debug_level=3 tickets=0 cache_remove=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4314 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4315 | 0 \ |
| 4316 | -C "client hello, adding session ticket extension" \ |
| 4317 | -S "found session ticket extension" \ |
| 4318 | -S "server hello, adding session ticket extension" \ |
| 4319 | -C "found session_ticket extension" \ |
| 4320 | -C "parse new session ticket" \ |
| 4321 | -S "session successfully restored from cache" \ |
| 4322 | -S "session successfully restored from ticket" \ |
| 4323 | -S "a session has been resumed" \ |
| 4324 | -C "a session has been resumed" |
| 4325 | |
| 4326 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4327 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 4328 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4329 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4330 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4331 | 0 \ |
| 4332 | -s "session successfully restored from cache" \ |
| 4333 | -S "session successfully restored from ticket" \ |
| 4334 | -s "a session has been resumed" \ |
| 4335 | -c "a session has been resumed" |
| 4336 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4337 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4338 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4339 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4340 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1 reco_delay=2000" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4341 | 0 \ |
| 4342 | -S "session successfully restored from cache" \ |
| 4343 | -S "session successfully restored from ticket" \ |
| 4344 | -S "a session has been resumed" \ |
| 4345 | -C "a session has been resumed" |
| 4346 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4347 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4348 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4349 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4350 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1 reco_delay=2000" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4351 | 0 \ |
| 4352 | -s "session successfully restored from cache" \ |
| 4353 | -S "session successfully restored from ticket" \ |
| 4354 | -s "a session has been resumed" \ |
| 4355 | -c "a session has been resumed" |
| 4356 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4357 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4358 | run_test "Session resume using cache: session copy" \ |
| 4359 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4360 | "$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] | 4361 | 0 \ |
| 4362 | -s "session successfully restored from cache" \ |
| 4363 | -S "session successfully restored from ticket" \ |
| 4364 | -s "a session has been resumed" \ |
| 4365 | -c "a session has been resumed" |
| 4366 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4367 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4368 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4369 | run_test "Session resume using cache: openssl client" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4370 | "$P_SRV force_version=tls12 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 4371 | "( $O_CLI -sess_out $SESSION; \ |
| 4372 | $O_CLI -sess_in $SESSION; \ |
| 4373 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4374 | 0 \ |
| 4375 | -s "found session ticket extension" \ |
| 4376 | -S "server hello, adding session ticket extension" \ |
| 4377 | -s "session successfully restored from cache" \ |
| 4378 | -S "session successfully restored from ticket" \ |
| 4379 | -s "a session has been resumed" |
| 4380 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4381 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4382 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4383 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4384 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4385 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4386 | 0 \ |
| 4387 | -C "found session_ticket extension" \ |
| 4388 | -C "parse new session ticket" \ |
| 4389 | -c "a session has been resumed" |
| 4390 | |
Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 4391 | # Tests for Session resume and extensions |
| 4392 | |
| 4393 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4394 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 4395 | run_test "Session resume and connection ID" \ |
| 4396 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 4397 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 4398 | 0 \ |
| 4399 | -c "Enable use of CID extension." \ |
| 4400 | -s "Enable use of CID extension." \ |
| 4401 | -c "client hello, adding CID extension" \ |
| 4402 | -s "found CID extension" \ |
| 4403 | -s "Use of CID extension negotiated" \ |
| 4404 | -s "server hello, adding CID extension" \ |
| 4405 | -c "found CID extension" \ |
| 4406 | -c "Use of CID extension negotiated" \ |
| 4407 | -s "Copy CIDs into SSL transform" \ |
| 4408 | -c "Copy CIDs into SSL transform" \ |
| 4409 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 4410 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 4411 | -s "Use of Connection ID has been negotiated" \ |
| 4412 | -c "Use of Connection ID has been negotiated" |
| 4413 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4414 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 4415 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4416 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4417 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4418 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4419 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 4420 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4421 | "$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] | 4422 | 0 \ |
| 4423 | -c "client hello, adding session ticket extension" \ |
| 4424 | -s "found session ticket extension" \ |
| 4425 | -S "server hello, adding session ticket extension" \ |
| 4426 | -C "found session_ticket extension" \ |
| 4427 | -C "parse new session ticket" \ |
| 4428 | -s "session successfully restored from cache" \ |
| 4429 | -S "session successfully restored from ticket" \ |
| 4430 | -s "a session has been resumed" \ |
| 4431 | -c "a session has been resumed" |
| 4432 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4433 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4434 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4435 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4436 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 4437 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4438 | "$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] | 4439 | 0 \ |
| 4440 | -C "client hello, adding session ticket extension" \ |
| 4441 | -S "found session ticket extension" \ |
| 4442 | -S "server hello, adding session ticket extension" \ |
| 4443 | -C "found session_ticket extension" \ |
| 4444 | -C "parse new session ticket" \ |
| 4445 | -s "session successfully restored from cache" \ |
| 4446 | -S "session successfully restored from ticket" \ |
| 4447 | -s "a session has been resumed" \ |
| 4448 | -c "a session has been resumed" |
| 4449 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4450 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4451 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4452 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 4453 | "$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] | 4454 | "$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] | 4455 | 0 \ |
| 4456 | -S "session successfully restored from cache" \ |
| 4457 | -S "session successfully restored from ticket" \ |
| 4458 | -S "a session has been resumed" \ |
| 4459 | -C "a session has been resumed" |
| 4460 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4461 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4462 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4463 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 4464 | "$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] | 4465 | "$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] | 4466 | 0 \ |
| 4467 | -s "session successfully restored from cache" \ |
| 4468 | -S "session successfully restored from ticket" \ |
| 4469 | -s "a session has been resumed" \ |
| 4470 | -c "a session has been resumed" |
| 4471 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4472 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4473 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4474 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 4475 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4476 | "$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] | 4477 | 0 \ |
| 4478 | -s "session successfully restored from cache" \ |
| 4479 | -S "session successfully restored from ticket" \ |
| 4480 | -s "a session has been resumed" \ |
| 4481 | -c "a session has been resumed" |
| 4482 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4483 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4484 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4485 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 4486 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4487 | "$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] | 4488 | 0 \ |
| 4489 | -S "session successfully restored from cache" \ |
| 4490 | -S "session successfully restored from ticket" \ |
| 4491 | -S "a session has been resumed" \ |
| 4492 | -C "a session has been resumed" |
| 4493 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4495 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4496 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 4497 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4498 | "$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] | 4499 | 0 \ |
| 4500 | -s "session successfully restored from cache" \ |
| 4501 | -S "session successfully restored from ticket" \ |
| 4502 | -s "a session has been resumed" \ |
| 4503 | -c "a session has been resumed" |
| 4504 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4505 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4506 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4507 | run_test "Session resume using cache, DTLS: session copy" \ |
| 4508 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4509 | "$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] | 4510 | 0 \ |
| 4511 | -s "session successfully restored from cache" \ |
| 4512 | -S "session successfully restored from ticket" \ |
| 4513 | -s "a session has been resumed" \ |
| 4514 | -c "a session has been resumed" |
| 4515 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4516 | # 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] | 4517 | # 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] | 4518 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4519 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4520 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4521 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4522 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 4523 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4524 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4525 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4526 | rm -f $SESSION )" \ |
| 4527 | 0 \ |
| 4528 | -s "found session ticket extension" \ |
| 4529 | -S "server hello, adding session ticket extension" \ |
| 4530 | -s "session successfully restored from cache" \ |
| 4531 | -S "session successfully restored from ticket" \ |
| 4532 | -s "a session has been resumed" |
| 4533 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4534 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4535 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4536 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 4537 | "$O_SRV -dtls" \ |
| 4538 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 4539 | 0 \ |
| 4540 | -C "found session_ticket extension" \ |
| 4541 | -C "parse new session ticket" \ |
| 4542 | -c "a session has been resumed" |
| 4543 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4544 | # Tests for Max Fragment Length extension |
| 4545 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4546 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4547 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4548 | run_test "Max fragment length: enabled, default" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4549 | "$P_SRV debug_level=3 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4550 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4551 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4552 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4553 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4554 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4555 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4556 | -C "client hello, adding max_fragment_length extension" \ |
| 4557 | -S "found max fragment length extension" \ |
| 4558 | -S "server hello, max_fragment_length extension" \ |
| 4559 | -C "found max_fragment_length extension" |
| 4560 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4561 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4562 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4563 | run_test "Max fragment length: enabled, default, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4564 | "$P_SRV debug_level=3 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4565 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4566 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4567 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4568 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4569 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4570 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4571 | -C "client hello, adding max_fragment_length extension" \ |
| 4572 | -S "found max fragment length extension" \ |
| 4573 | -S "server hello, max_fragment_length extension" \ |
| 4574 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4575 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4576 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4577 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4578 | |
| 4579 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4580 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4581 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 4582 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4583 | "$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] | 4584 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4585 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4586 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4587 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4588 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4589 | -C "client hello, adding max_fragment_length extension" \ |
| 4590 | -S "found max fragment length extension" \ |
| 4591 | -S "server hello, max_fragment_length extension" \ |
| 4592 | -C "found max_fragment_length extension" \ |
| 4593 | -c "fragment larger than.*maximum " |
| 4594 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4595 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 4596 | # (session fragment length will be 16384 regardless of mbedtls |
| 4597 | # content length configuration.) |
| 4598 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4599 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4600 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4601 | run_test "Max fragment length: disabled, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4602 | "$P_SRV debug_level=3 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4603 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4604 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4605 | -C "Maximum incoming record payload length is 16384" \ |
| 4606 | -C "Maximum outgoing record payload length is 16384" \ |
| 4607 | -S "Maximum incoming record payload length is 16384" \ |
| 4608 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4609 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4610 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4611 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4612 | |
| 4613 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4614 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4615 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4616 | "$P_SRV debug_level=3 dtls=1 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4617 | "$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] | 4618 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4619 | -C "Maximum incoming record payload length is 16384" \ |
| 4620 | -C "Maximum outgoing record payload length is 16384" \ |
| 4621 | -S "Maximum incoming record payload length is 16384" \ |
| 4622 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4623 | -c "fragment larger than.*maximum " |
| 4624 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4625 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4626 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4627 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4628 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4629 | "$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] | 4630 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4631 | -c "Maximum incoming record payload length is 4096" \ |
| 4632 | -c "Maximum outgoing record payload length is 4096" \ |
| 4633 | -s "Maximum incoming record payload length is 4096" \ |
| 4634 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4635 | -c "client hello, adding max_fragment_length extension" \ |
| 4636 | -s "found max fragment length extension" \ |
| 4637 | -s "server hello, max_fragment_length extension" \ |
| 4638 | -c "found max_fragment_length extension" |
| 4639 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4640 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4641 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4642 | run_test "Max fragment length: client 512, server 1024" \ |
| 4643 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4644 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4645 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4646 | -c "Maximum incoming record payload length is 512" \ |
| 4647 | -c "Maximum outgoing record payload length is 512" \ |
| 4648 | -s "Maximum incoming record payload length is 512" \ |
| 4649 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4650 | -c "client hello, adding max_fragment_length extension" \ |
| 4651 | -s "found max fragment length extension" \ |
| 4652 | -s "server hello, max_fragment_length extension" \ |
| 4653 | -c "found max_fragment_length extension" |
| 4654 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4655 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4656 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4657 | run_test "Max fragment length: client 512, server 2048" \ |
| 4658 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4659 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4660 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4661 | -c "Maximum incoming record payload length is 512" \ |
| 4662 | -c "Maximum outgoing record payload length is 512" \ |
| 4663 | -s "Maximum incoming record payload length is 512" \ |
| 4664 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4665 | -c "client hello, adding max_fragment_length extension" \ |
| 4666 | -s "found max fragment length extension" \ |
| 4667 | -s "server hello, max_fragment_length extension" \ |
| 4668 | -c "found max_fragment_length extension" |
| 4669 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4670 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4671 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4672 | run_test "Max fragment length: client 512, server 4096" \ |
| 4673 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4674 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4675 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4676 | -c "Maximum incoming record payload length is 512" \ |
| 4677 | -c "Maximum outgoing record payload length is 512" \ |
| 4678 | -s "Maximum incoming record payload length is 512" \ |
| 4679 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4680 | -c "client hello, adding max_fragment_length extension" \ |
| 4681 | -s "found max fragment length extension" \ |
| 4682 | -s "server hello, max_fragment_length extension" \ |
| 4683 | -c "found max_fragment_length extension" |
| 4684 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4685 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4686 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4687 | run_test "Max fragment length: client 1024, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4688 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4689 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4690 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4691 | -c "Maximum incoming record payload length is 1024" \ |
| 4692 | -c "Maximum outgoing record payload length is 1024" \ |
| 4693 | -s "Maximum incoming record payload length is 1024" \ |
| 4694 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4695 | -c "client hello, adding max_fragment_length extension" \ |
| 4696 | -s "found max fragment length extension" \ |
| 4697 | -s "server hello, max_fragment_length extension" \ |
| 4698 | -c "found max_fragment_length extension" |
| 4699 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4700 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4701 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4702 | run_test "Max fragment length: client 1024, server 2048" \ |
| 4703 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4704 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4705 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4706 | -c "Maximum incoming record payload length is 1024" \ |
| 4707 | -c "Maximum outgoing record payload length is 1024" \ |
| 4708 | -s "Maximum incoming record payload length is 1024" \ |
| 4709 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4710 | -c "client hello, adding max_fragment_length extension" \ |
| 4711 | -s "found max fragment length extension" \ |
| 4712 | -s "server hello, max_fragment_length extension" \ |
| 4713 | -c "found max_fragment_length extension" |
| 4714 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4715 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4716 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4717 | run_test "Max fragment length: client 1024, server 4096" \ |
| 4718 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4719 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4720 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4721 | -c "Maximum incoming record payload length is 1024" \ |
| 4722 | -c "Maximum outgoing record payload length is 1024" \ |
| 4723 | -s "Maximum incoming record payload length is 1024" \ |
| 4724 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4725 | -c "client hello, adding max_fragment_length extension" \ |
| 4726 | -s "found max fragment length extension" \ |
| 4727 | -s "server hello, max_fragment_length extension" \ |
| 4728 | -c "found max_fragment_length extension" |
| 4729 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4730 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4731 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4732 | run_test "Max fragment length: client 2048, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4733 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4734 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4735 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4736 | -c "Maximum incoming record payload length is 2048" \ |
| 4737 | -c "Maximum outgoing record payload length is 2048" \ |
| 4738 | -s "Maximum incoming record payload length is 2048" \ |
| 4739 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4740 | -c "client hello, adding max_fragment_length extension" \ |
| 4741 | -s "found max fragment length extension" \ |
| 4742 | -s "server hello, max_fragment_length extension" \ |
| 4743 | -c "found max_fragment_length extension" |
| 4744 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4745 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4746 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4747 | run_test "Max fragment length: client 2048, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4748 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4749 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4750 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4751 | -c "Maximum incoming record payload length is 2048" \ |
| 4752 | -c "Maximum outgoing record payload length is 2048" \ |
| 4753 | -s "Maximum incoming record payload length is 2048" \ |
| 4754 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4755 | -c "client hello, adding max_fragment_length extension" \ |
| 4756 | -s "found max fragment length extension" \ |
| 4757 | -s "server hello, max_fragment_length extension" \ |
| 4758 | -c "found max_fragment_length extension" |
| 4759 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4760 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4761 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4762 | run_test "Max fragment length: client 2048, server 4096" \ |
| 4763 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4764 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4765 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4766 | -c "Maximum incoming record payload length is 2048" \ |
| 4767 | -c "Maximum outgoing record payload length is 2048" \ |
| 4768 | -s "Maximum incoming record payload length is 2048" \ |
| 4769 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4770 | -c "client hello, adding max_fragment_length extension" \ |
| 4771 | -s "found max fragment length extension" \ |
| 4772 | -s "server hello, max_fragment_length extension" \ |
| 4773 | -c "found max_fragment_length extension" |
| 4774 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4775 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4776 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4777 | run_test "Max fragment length: client 4096, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4778 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4779 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4780 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4781 | -c "Maximum incoming record payload length is 4096" \ |
| 4782 | -c "Maximum outgoing record payload length is 4096" \ |
| 4783 | -s "Maximum incoming record payload length is 4096" \ |
| 4784 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4785 | -c "client hello, adding max_fragment_length extension" \ |
| 4786 | -s "found max fragment length extension" \ |
| 4787 | -s "server hello, max_fragment_length extension" \ |
| 4788 | -c "found max_fragment_length extension" |
| 4789 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4790 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4791 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4792 | run_test "Max fragment length: client 4096, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4793 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4794 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4795 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4796 | -c "Maximum incoming record payload length is 4096" \ |
| 4797 | -c "Maximum outgoing record payload length is 4096" \ |
| 4798 | -s "Maximum incoming record payload length is 4096" \ |
| 4799 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4800 | -c "client hello, adding max_fragment_length extension" \ |
| 4801 | -s "found max fragment length extension" \ |
| 4802 | -s "server hello, 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 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4806 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4807 | run_test "Max fragment length: client 4096, server 2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4808 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4809 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4810 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4811 | -c "Maximum incoming record payload length is 4096" \ |
| 4812 | -c "Maximum outgoing record payload length is 4096" \ |
| 4813 | -s "Maximum incoming record payload length is 4096" \ |
| 4814 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [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 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4820 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4821 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4822 | run_test "Max fragment length: used by server" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4823 | "$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] | 4824 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4825 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4826 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4827 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4828 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4829 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4830 | -C "client hello, adding max_fragment_length extension" \ |
| 4831 | -S "found max fragment length extension" \ |
| 4832 | -S "server hello, max_fragment_length extension" \ |
| 4833 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4834 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4835 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4836 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4837 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4838 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4839 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4840 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4841 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4842 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4843 | -c "Maximum incoming record payload length is 4096" \ |
| 4844 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4845 | -c "client hello, adding max_fragment_length extension" \ |
| 4846 | -c "found max_fragment_length extension" |
| 4847 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4848 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4849 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4850 | run_test "Max fragment length: client, message just fits" \ |
| 4851 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4852 | "$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] | 4853 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4854 | -c "Maximum incoming record payload length is 2048" \ |
| 4855 | -c "Maximum outgoing record payload length is 2048" \ |
| 4856 | -s "Maximum incoming record payload length is 2048" \ |
| 4857 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4858 | -c "client hello, adding max_fragment_length extension" \ |
| 4859 | -s "found max fragment length extension" \ |
| 4860 | -s "server hello, max_fragment_length extension" \ |
| 4861 | -c "found max_fragment_length extension" \ |
| 4862 | -c "2048 bytes written in 1 fragments" \ |
| 4863 | -s "2048 bytes read" |
| 4864 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4865 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4866 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4867 | run_test "Max fragment length: client, larger message" \ |
| 4868 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4869 | "$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] | 4870 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4871 | -c "Maximum incoming record payload length is 2048" \ |
| 4872 | -c "Maximum outgoing record payload length is 2048" \ |
| 4873 | -s "Maximum incoming record payload length is 2048" \ |
| 4874 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4875 | -c "client hello, adding max_fragment_length extension" \ |
| 4876 | -s "found max fragment length extension" \ |
| 4877 | -s "server hello, max_fragment_length extension" \ |
| 4878 | -c "found max_fragment_length extension" \ |
| 4879 | -c "2345 bytes written in 2 fragments" \ |
| 4880 | -s "2048 bytes read" \ |
| 4881 | -s "297 bytes read" |
| 4882 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4883 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4884 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4885 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4886 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4887 | "$P_SRV debug_level=3 dtls=1" \ |
| 4888 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4889 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4890 | -c "Maximum incoming record payload length is 2048" \ |
| 4891 | -c "Maximum outgoing record payload length is 2048" \ |
| 4892 | -s "Maximum incoming record payload length is 2048" \ |
| 4893 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4894 | -c "client hello, adding max_fragment_length extension" \ |
| 4895 | -s "found max fragment length extension" \ |
| 4896 | -s "server hello, max_fragment_length extension" \ |
| 4897 | -c "found max_fragment_length extension" \ |
| 4898 | -c "fragment larger than.*maximum" |
| 4899 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4900 | # Tests for Record Size Limit extension |
| 4901 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4902 | requires_gnutls_tls1_3 |
| 4903 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4904 | 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] | 4905 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4906 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4907 | 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] | 4908 | "$P_SRV debug_level=3 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4909 | "$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] | 4910 | 0 \ |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4911 | -s "RecordSizeLimit: 16385 Bytes" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4912 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4913 | -s "Maximum outgoing record payload length is 16383" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4914 | -s "bytes written in 1 fragments" |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4915 | |
| 4916 | requires_gnutls_tls1_3 |
| 4917 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4918 | 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] | 4919 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4920 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4921 | 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] | 4922 | "$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] | 4923 | "$P_CLI debug_level=4 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4924 | 0 \ |
Yanray Wang | 42017cd | 2023-11-08 11:15:23 +0800 | [diff] [blame] | 4925 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 4926 | -c "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 4927 | -c "EncryptedExtensions: record_size_limit(28) extension received." \ |
Yanray Wang | 42017cd | 2023-11-08 11:15:23 +0800 | [diff] [blame] | 4928 | -c "RecordSizeLimit: 16385 Bytes" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4929 | |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 4930 | # In the following tests, --recordsize is the value used by the G_NEXT_CLI (3.7.2) to configure the |
| 4931 | # maximum record size using gnutls_record_set_max_size() |
| 4932 | # (https://gnutls.org/reference/gnutls-gnutls.html#gnutls-record-set-max-size). |
| 4933 | # There is currently a lower limit of 512, caused by gnutls_record_set_max_size() |
| 4934 | # not respecting the "%ALLOW_SMALL_RECORDS" priority string and not using the |
| 4935 | # more recent function gnutls_record_set_max_recv_size() |
| 4936 | # (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] | 4937 | # There is currently an upper limit of 4096, caused by the cli arg parser: |
| 4938 | # 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] | 4939 | # Thus, these tests are currently limited to the value range 512-4096. |
| 4940 | # Also, the value sent in the extension will be one larger than the value |
| 4941 | # set at the command line: |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4942 | # 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] | 4943 | |
| 4944 | # 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] | 4945 | # so for 513 record size limit tests we use preshared key to avoid sending |
| 4946 | # the certificate. |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4947 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4948 | requires_gnutls_tls1_3 |
| 4949 | requires_gnutls_record_size_limit |
| 4950 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
| 4951 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4952 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4953 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 1 fragment" \ |
| 4954 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4955 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4956 | response_size=256" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4957 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4958 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4959 | 0 \ |
| 4960 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4961 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4962 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4963 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4964 | -s "Maximum outgoing record payload length is 511" \ |
| 4965 | -s "256 bytes written in 1 fragments" |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4966 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4967 | requires_gnutls_tls1_3 |
| 4968 | requires_gnutls_record_size_limit |
| 4969 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
| 4970 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4971 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4972 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 2 fragments" \ |
| 4973 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4974 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4975 | response_size=768" \ |
| 4976 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4977 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
| 4978 | 0 \ |
| 4979 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4980 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4981 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4982 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4983 | -s "Maximum outgoing record payload length is 511" \ |
| 4984 | -s "768 bytes written in 2 fragments" |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4985 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4986 | requires_gnutls_tls1_3 |
| 4987 | requires_gnutls_record_size_limit |
| 4988 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
| 4989 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4990 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4991 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 3 fragments" \ |
| 4992 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4993 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4994 | response_size=1280" \ |
| 4995 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4996 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
| 4997 | 0 \ |
| 4998 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4999 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 5000 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5001 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5002 | -s "Maximum outgoing record payload length is 511" \ |
| 5003 | -s "1280 bytes written in 3 fragments" |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5004 | |
| 5005 | requires_gnutls_tls1_3 |
| 5006 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5007 | 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] | 5008 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5009 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5010 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 1 fragment" \ |
| 5011 | "$P_SRV debug_level=3 force_version=tls13 response_size=512" \ |
| 5012 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 5013 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5014 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 5015 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5016 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5017 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5018 | -s "Maximum outgoing record payload length is 1023" \ |
| 5019 | -s "512 bytes written in 1 fragments" |
| 5020 | |
| 5021 | requires_gnutls_tls1_3 |
| 5022 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5023 | 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] | 5024 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5025 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5026 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 2 fragments" \ |
| 5027 | "$P_SRV debug_level=3 force_version=tls13 response_size=1536" \ |
| 5028 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 5029 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5030 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 5031 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5032 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5033 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5034 | -s "Maximum outgoing record payload length is 1023" \ |
| 5035 | -s "1536 bytes written in 2 fragments" |
| 5036 | |
| 5037 | requires_gnutls_tls1_3 |
| 5038 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5039 | 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] | 5040 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5041 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5042 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 3 fragments" \ |
| 5043 | "$P_SRV debug_level=3 force_version=tls13 response_size=2560" \ |
| 5044 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 5045 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5046 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 5047 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5048 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5049 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5050 | -s "Maximum outgoing record payload length is 1023" \ |
| 5051 | -s "2560 bytes written in 3 fragments" |
| 5052 | |
| 5053 | requires_gnutls_tls1_3 |
| 5054 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5055 | 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] | 5056 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5057 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5058 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 1 fragment" \ |
| 5059 | "$P_SRV debug_level=3 force_version=tls13 response_size=2048" \ |
| 5060 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5061 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5062 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5063 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5064 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5065 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5066 | -s "Maximum outgoing record payload length is 4095" \ |
| 5067 | -s "2048 bytes written in 1 fragments" |
| 5068 | |
| 5069 | requires_gnutls_tls1_3 |
| 5070 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5071 | 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] | 5072 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5073 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5074 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 2 fragments" \ |
| 5075 | "$P_SRV debug_level=3 force_version=tls13 response_size=6144" \ |
| 5076 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5077 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5078 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5079 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5080 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5081 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5082 | -s "Maximum outgoing record payload length is 4095" \ |
| 5083 | -s "6144 bytes written in 2 fragments" |
| 5084 | |
| 5085 | requires_gnutls_tls1_3 |
| 5086 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5087 | 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] | 5088 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5089 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5090 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 3 fragments" \ |
| 5091 | "$P_SRV debug_level=3 force_version=tls13 response_size=10240" \ |
| 5092 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5093 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5094 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5095 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5096 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5097 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5098 | -s "Maximum outgoing record payload length is 4095" \ |
| 5099 | -s "10240 bytes written in 3 fragments" |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 5100 | |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5101 | requires_gnutls_tls1_3 |
| 5102 | requires_gnutls_record_size_limit |
| 5103 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5104 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5105 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5106 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 1 fragment" \ |
| 5107 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5108 | "$P_CLI debug_level=4 force_version=tls13 request_size=256" \ |
| 5109 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5110 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5111 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5112 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5113 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5114 | -c "Maximum outgoing record payload length is 511" \ |
| 5115 | -c "256 bytes written in 1 fragments" |
| 5116 | |
| 5117 | requires_gnutls_tls1_3 |
| 5118 | requires_gnutls_record_size_limit |
| 5119 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5120 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5121 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5122 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 2 fragments" \ |
| 5123 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5124 | "$P_CLI debug_level=4 force_version=tls13 request_size=768" \ |
| 5125 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5126 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5127 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5128 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5129 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5130 | -c "Maximum outgoing record payload length is 511" \ |
| 5131 | -c "768 bytes written in 2 fragments" |
| 5132 | |
| 5133 | requires_gnutls_tls1_3 |
| 5134 | requires_gnutls_record_size_limit |
| 5135 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5136 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5137 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5138 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 3 fragments" \ |
| 5139 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5140 | "$P_CLI debug_level=4 force_version=tls13 request_size=1280" \ |
| 5141 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5142 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5143 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5144 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5145 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5146 | -c "Maximum outgoing record payload length is 511" \ |
| 5147 | -c "1280 bytes written in 3 fragments" |
| 5148 | |
| 5149 | requires_gnutls_tls1_3 |
| 5150 | requires_gnutls_record_size_limit |
| 5151 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5152 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5153 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5154 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 1 fragment" \ |
| 5155 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5156 | "$P_CLI debug_level=4 force_version=tls13 request_size=512" \ |
| 5157 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5158 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5159 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5160 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5161 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5162 | -c "Maximum outgoing record payload length is 1023" \ |
| 5163 | -c "512 bytes written in 1 fragments" |
| 5164 | |
| 5165 | requires_gnutls_tls1_3 |
| 5166 | requires_gnutls_record_size_limit |
| 5167 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5168 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5169 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5170 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 2 fragments" \ |
| 5171 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5172 | "$P_CLI debug_level=4 force_version=tls13 request_size=1536" \ |
| 5173 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5174 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5175 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5176 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5177 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5178 | -c "Maximum outgoing record payload length is 1023" \ |
| 5179 | -c "1536 bytes written in 2 fragments" |
| 5180 | |
| 5181 | requires_gnutls_tls1_3 |
| 5182 | requires_gnutls_record_size_limit |
| 5183 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5184 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5185 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5186 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 3 fragments" \ |
| 5187 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5188 | "$P_CLI debug_level=4 force_version=tls13 request_size=2560" \ |
| 5189 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5190 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5191 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5192 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5193 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5194 | -c "Maximum outgoing record payload length is 1023" \ |
| 5195 | -c "2560 bytes written in 3 fragments" |
| 5196 | |
| 5197 | requires_gnutls_tls1_3 |
| 5198 | requires_gnutls_record_size_limit |
| 5199 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5200 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5201 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5202 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 1 fragment" \ |
| 5203 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5204 | "$P_CLI debug_level=4 force_version=tls13 request_size=2048" \ |
| 5205 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5206 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5207 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5208 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5209 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5210 | -c "Maximum outgoing record payload length is 4095" \ |
| 5211 | -c "2048 bytes written in 1 fragments" |
| 5212 | |
| 5213 | requires_gnutls_tls1_3 |
| 5214 | requires_gnutls_record_size_limit |
| 5215 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5216 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5217 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5218 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 2 fragments" \ |
| 5219 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5220 | "$P_CLI debug_level=4 force_version=tls13 request_size=6144" \ |
| 5221 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5222 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5223 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5224 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5225 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5226 | -c "Maximum outgoing record payload length is 4095" \ |
| 5227 | -c "6144 bytes written in 2 fragments" |
| 5228 | |
| 5229 | requires_gnutls_tls1_3 |
| 5230 | requires_gnutls_record_size_limit |
| 5231 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5232 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5233 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5234 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 3 fragments" \ |
| 5235 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5236 | "$P_CLI debug_level=4 force_version=tls13 request_size=10240" \ |
| 5237 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5238 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5239 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5240 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5241 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5242 | -c "Maximum outgoing record payload length is 4095" \ |
| 5243 | -c "10240 bytes written in 3 fragments" |
| 5244 | |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5245 | # TODO: For time being, we send fixed value of RecordSizeLimit defined by |
| 5246 | # MBEDTLS_SSL_IN_CONTENT_LEN. Once we support variable buffer length of |
| 5247 | # RecordSizeLimit, we need to modify value of RecordSizeLimit in below test. |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5248 | requires_config_value_equals "MBEDTLS_SSL_IN_CONTENT_LEN" 16384 |
| 5249 | 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] | 5250 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5251 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5252 | 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] | 5253 | "$P_SRV debug_level=4 force_version=tls13" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5254 | "$P_CLI debug_level=4" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5255 | 0 \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5256 | -c "Sent RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5257 | -c "RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5258 | -s "RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5259 | -s "Sent RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5260 | -s "Maximum outgoing record payload length is 16383" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5261 | -s "Maximum incoming record payload length is 16384" |
| 5262 | |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 5263 | # End of Record size limit tests |
| 5264 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5265 | # Tests for renegotiation |
| 5266 | |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5267 | # G_NEXT_SRV is used in renegotiation tests becuase of the increased |
| 5268 | # extensions limit since we exceed the limit in G_SRV when we send |
| 5269 | # TLS 1.3 extensions in the initial handshake. |
| 5270 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5271 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5272 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5273 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5274 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5275 | 0 \ |
| 5276 | -C "client hello, adding renegotiation extension" \ |
| 5277 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5278 | -S "found renegotiation extension" \ |
| 5279 | -s "server hello, secure renegotiation extension" \ |
| 5280 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5281 | -C "=> renegotiate" \ |
| 5282 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5283 | -S "write hello request" |
| 5284 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5285 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5286 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5287 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5288 | "$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] | 5289 | 0 \ |
| 5290 | -c "client hello, adding renegotiation extension" \ |
| 5291 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5292 | -s "found renegotiation extension" \ |
| 5293 | -s "server hello, secure renegotiation extension" \ |
| 5294 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5295 | -c "=> renegotiate" \ |
| 5296 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5297 | -S "write hello request" |
| 5298 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5299 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5300 | run_test "Renegotiation: server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5301 | "$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] | 5302 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5303 | 0 \ |
| 5304 | -c "client hello, adding renegotiation extension" \ |
| 5305 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5306 | -s "found renegotiation extension" \ |
| 5307 | -s "server hello, secure renegotiation extension" \ |
| 5308 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5309 | -c "=> renegotiate" \ |
| 5310 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5311 | -s "write hello request" |
| 5312 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5313 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 5314 | # 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] | 5315 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5316 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5317 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 5318 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5319 | "$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] | 5320 | 0 \ |
| 5321 | -c "client hello, adding renegotiation extension" \ |
| 5322 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5323 | -s "found renegotiation extension" \ |
| 5324 | -s "server hello, secure renegotiation extension" \ |
| 5325 | -c "found renegotiation extension" \ |
| 5326 | -c "=> renegotiate" \ |
| 5327 | -s "=> renegotiate" \ |
| 5328 | -S "write hello request" \ |
| 5329 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 5330 | |
| 5331 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 5332 | # 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] | 5333 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5334 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5335 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5336 | "$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] | 5337 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 5338 | 0 \ |
| 5339 | -c "client hello, adding renegotiation extension" \ |
| 5340 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5341 | -s "found renegotiation extension" \ |
| 5342 | -s "server hello, secure renegotiation extension" \ |
| 5343 | -c "found renegotiation extension" \ |
| 5344 | -c "=> renegotiate" \ |
| 5345 | -s "=> renegotiate" \ |
| 5346 | -s "write hello request" \ |
| 5347 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 5348 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5349 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5350 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5351 | "$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] | 5352 | "$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] | 5353 | 0 \ |
| 5354 | -c "client hello, adding renegotiation extension" \ |
| 5355 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5356 | -s "found renegotiation extension" \ |
| 5357 | -s "server hello, secure renegotiation extension" \ |
| 5358 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5359 | -c "=> renegotiate" \ |
| 5360 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5361 | -s "write hello request" |
| 5362 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5363 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5364 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 5365 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5366 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5367 | "$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] | 5368 | "$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" \ |
| 5369 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 5370 | -c "Maximum incoming record payload length is 2048" \ |
| 5371 | -c "Maximum outgoing record payload length is 2048" \ |
| 5372 | -s "Maximum incoming record payload length is 2048" \ |
| 5373 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5374 | -c "client hello, adding max_fragment_length extension" \ |
| 5375 | -s "found max fragment length extension" \ |
| 5376 | -s "server hello, max_fragment_length extension" \ |
| 5377 | -c "found max_fragment_length extension" \ |
| 5378 | -c "client hello, adding renegotiation extension" \ |
| 5379 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5380 | -s "found renegotiation extension" \ |
| 5381 | -s "server hello, secure renegotiation extension" \ |
| 5382 | -c "found renegotiation extension" \ |
| 5383 | -c "=> renegotiate" \ |
| 5384 | -s "=> renegotiate" \ |
| 5385 | -s "write hello request" |
| 5386 | |
| 5387 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5388 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5389 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5390 | "$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] | 5391 | 1 \ |
| 5392 | -c "client hello, adding renegotiation extension" \ |
| 5393 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5394 | -S "found renegotiation extension" \ |
| 5395 | -s "server hello, secure renegotiation extension" \ |
| 5396 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5397 | -c "=> renegotiate" \ |
| 5398 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5399 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 5400 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5401 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5402 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5403 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5404 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5405 | "$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] | 5406 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5407 | 0 \ |
| 5408 | -C "client hello, adding renegotiation extension" \ |
| 5409 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5410 | -S "found renegotiation extension" \ |
| 5411 | -s "server hello, secure renegotiation extension" \ |
| 5412 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5413 | -C "=> renegotiate" \ |
| 5414 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5415 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 5416 | -S "SSL - An unexpected message was received from our peer" \ |
| 5417 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5418 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5419 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5420 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5421 | "$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] | 5422 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5423 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5424 | 0 \ |
| 5425 | -C "client hello, adding renegotiation extension" \ |
| 5426 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5427 | -S "found renegotiation extension" \ |
| 5428 | -s "server hello, secure renegotiation extension" \ |
| 5429 | -c "found renegotiation extension" \ |
| 5430 | -C "=> renegotiate" \ |
| 5431 | -S "=> renegotiate" \ |
| 5432 | -s "write hello request" \ |
| 5433 | -S "SSL - An unexpected message was received from our peer" \ |
| 5434 | -S "failed" |
| 5435 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5436 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5437 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5438 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5439 | "$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] | 5440 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5441 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5442 | 0 \ |
| 5443 | -C "client hello, adding renegotiation extension" \ |
| 5444 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5445 | -S "found renegotiation extension" \ |
| 5446 | -s "server hello, secure renegotiation extension" \ |
| 5447 | -c "found renegotiation extension" \ |
| 5448 | -C "=> renegotiate" \ |
| 5449 | -S "=> renegotiate" \ |
| 5450 | -s "write hello request" \ |
| 5451 | -S "SSL - An unexpected message was received from our peer" \ |
| 5452 | -S "failed" |
| 5453 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5454 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5455 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5456 | "$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] | 5457 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5458 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5459 | 0 \ |
| 5460 | -C "client hello, adding renegotiation extension" \ |
| 5461 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5462 | -S "found renegotiation extension" \ |
| 5463 | -s "server hello, secure renegotiation extension" \ |
| 5464 | -c "found renegotiation extension" \ |
| 5465 | -C "=> renegotiate" \ |
| 5466 | -S "=> renegotiate" \ |
| 5467 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5468 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5469 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5470 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5471 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5472 | "$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] | 5473 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5474 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5475 | 0 \ |
| 5476 | -c "client hello, adding renegotiation extension" \ |
| 5477 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5478 | -s "found renegotiation extension" \ |
| 5479 | -s "server hello, secure renegotiation extension" \ |
| 5480 | -c "found renegotiation extension" \ |
| 5481 | -c "=> renegotiate" \ |
| 5482 | -s "=> renegotiate" \ |
| 5483 | -s "write hello request" \ |
| 5484 | -S "SSL - An unexpected message was received from our peer" \ |
| 5485 | -S "failed" |
| 5486 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5487 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5488 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5489 | "$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] | 5490 | "$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] | 5491 | 0 \ |
| 5492 | -C "client hello, adding renegotiation extension" \ |
| 5493 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5494 | -S "found renegotiation extension" \ |
| 5495 | -s "server hello, secure renegotiation extension" \ |
| 5496 | -c "found renegotiation extension" \ |
| 5497 | -S "record counter limit reached: renegotiate" \ |
| 5498 | -C "=> renegotiate" \ |
| 5499 | -S "=> renegotiate" \ |
| 5500 | -S "write hello request" \ |
| 5501 | -S "SSL - An unexpected message was received from our peer" \ |
| 5502 | -S "failed" |
| 5503 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 5504 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5505 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5506 | run_test "Renegotiation: periodic, just above period" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5507 | "$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] | 5508 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5509 | 0 \ |
| 5510 | -c "client hello, adding renegotiation extension" \ |
| 5511 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5512 | -s "found renegotiation extension" \ |
| 5513 | -s "server hello, secure renegotiation extension" \ |
| 5514 | -c "found renegotiation extension" \ |
| 5515 | -s "record counter limit reached: renegotiate" \ |
| 5516 | -c "=> renegotiate" \ |
| 5517 | -s "=> renegotiate" \ |
| 5518 | -s "write hello request" \ |
| 5519 | -S "SSL - An unexpected message was received from our peer" \ |
| 5520 | -S "failed" |
| 5521 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5522 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5523 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5524 | "$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] | 5525 | "$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] | 5526 | 0 \ |
| 5527 | -c "client hello, adding renegotiation extension" \ |
| 5528 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5529 | -s "found renegotiation extension" \ |
| 5530 | -s "server hello, secure renegotiation extension" \ |
| 5531 | -c "found renegotiation extension" \ |
| 5532 | -s "record counter limit reached: renegotiate" \ |
| 5533 | -c "=> renegotiate" \ |
| 5534 | -s "=> renegotiate" \ |
| 5535 | -s "write hello request" \ |
| 5536 | -S "SSL - An unexpected message was received from our peer" \ |
| 5537 | -S "failed" |
| 5538 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5539 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5540 | run_test "Renegotiation: periodic, above period, disabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5541 | "$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] | 5542 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 5543 | 0 \ |
| 5544 | -C "client hello, adding renegotiation extension" \ |
| 5545 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5546 | -S "found renegotiation extension" \ |
| 5547 | -s "server hello, secure renegotiation extension" \ |
| 5548 | -c "found renegotiation extension" \ |
| 5549 | -S "record counter limit reached: renegotiate" \ |
| 5550 | -C "=> renegotiate" \ |
| 5551 | -S "=> renegotiate" \ |
| 5552 | -S "write hello request" \ |
| 5553 | -S "SSL - An unexpected message was received from our peer" \ |
| 5554 | -S "failed" |
| 5555 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5556 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5557 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5558 | "$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] | 5559 | "$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] | 5560 | 0 \ |
| 5561 | -c "client hello, adding renegotiation extension" \ |
| 5562 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5563 | -s "found renegotiation extension" \ |
| 5564 | -s "server hello, secure renegotiation extension" \ |
| 5565 | -c "found renegotiation extension" \ |
| 5566 | -c "=> renegotiate" \ |
| 5567 | -s "=> renegotiate" \ |
| 5568 | -S "write hello request" |
| 5569 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5570 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5571 | run_test "Renegotiation: nbio, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5572 | "$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] | 5573 | "$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] | 5574 | 0 \ |
| 5575 | -c "client hello, adding renegotiation extension" \ |
| 5576 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5577 | -s "found renegotiation extension" \ |
| 5578 | -s "server hello, secure renegotiation extension" \ |
| 5579 | -c "found renegotiation extension" \ |
| 5580 | -c "=> renegotiate" \ |
| 5581 | -s "=> renegotiate" \ |
| 5582 | -s "write hello request" |
| 5583 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5584 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5585 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5586 | run_test "Renegotiation: openssl server, client-initiated" \ |
Gilles Peskine | ed8cc46 | 2024-09-06 13:52:14 +0200 | [diff] [blame] | 5587 | "$O_SRV -www $OPENSSL_S_SERVER_CLIENT_RENEGOTIATION -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5588 | "$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] | 5589 | 0 \ |
| 5590 | -c "client hello, adding renegotiation extension" \ |
| 5591 | -c "found renegotiation extension" \ |
| 5592 | -c "=> renegotiate" \ |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5593 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [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 strict, client-initiated" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5601 | "$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] | 5602 | "$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] | 5603 | 0 \ |
| 5604 | -c "client hello, adding renegotiation extension" \ |
| 5605 | -c "found renegotiation extension" \ |
| 5606 | -c "=> renegotiate" \ |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5607 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5608 | -C "error" \ |
| 5609 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5610 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5611 | requires_gnutls |
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 | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5614 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5615 | "$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] | 5616 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5617 | 1 \ |
| 5618 | -c "client hello, adding renegotiation extension" \ |
| 5619 | -C "found renegotiation extension" \ |
| 5620 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5621 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5622 | -c "error" \ |
| 5623 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5624 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5625 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5626 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5627 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5628 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5629 | "$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] | 5630 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5631 | allow_legacy=0" \ |
| 5632 | 1 \ |
| 5633 | -c "client hello, adding renegotiation extension" \ |
| 5634 | -C "found renegotiation extension" \ |
| 5635 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5636 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5637 | -c "error" \ |
| 5638 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5639 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5640 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5641 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5643 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5644 | "$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] | 5645 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5646 | allow_legacy=1" \ |
| 5647 | 0 \ |
| 5648 | -c "client hello, adding renegotiation extension" \ |
| 5649 | -C "found renegotiation extension" \ |
| 5650 | -c "=> renegotiate" \ |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5651 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5652 | -C "error" \ |
| 5653 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5654 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5655 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5656 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 5657 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 5658 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 5659 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5660 | 0 \ |
| 5661 | -c "client hello, adding renegotiation extension" \ |
| 5662 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5663 | -s "found renegotiation extension" \ |
| 5664 | -s "server hello, secure renegotiation extension" \ |
| 5665 | -c "found renegotiation extension" \ |
| 5666 | -c "=> renegotiate" \ |
| 5667 | -s "=> renegotiate" \ |
| 5668 | -S "write hello request" |
| 5669 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5670 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5671 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5672 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 5673 | "$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] | 5674 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 5675 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5676 | 0 \ |
| 5677 | -c "client hello, adding renegotiation extension" \ |
| 5678 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5679 | -s "found renegotiation extension" \ |
| 5680 | -s "server hello, secure renegotiation extension" \ |
| 5681 | -c "found renegotiation extension" \ |
| 5682 | -c "=> renegotiate" \ |
| 5683 | -s "=> renegotiate" \ |
| 5684 | -s "write hello request" |
| 5685 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [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 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5688 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 5689 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 5690 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 5691 | 0 \ |
| 5692 | -c "client hello, adding renegotiation extension" \ |
| 5693 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5694 | -s "found renegotiation extension" \ |
| 5695 | -s "server hello, secure renegotiation extension" \ |
| 5696 | -s "record counter limit reached: renegotiate" \ |
| 5697 | -c "=> renegotiate" \ |
| 5698 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5699 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5700 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5701 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5702 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5703 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5704 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5705 | "$G_NEXT_SRV -u --mtu 4096" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5706 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5707 | 0 \ |
| 5708 | -c "client hello, adding renegotiation extension" \ |
| 5709 | -c "found renegotiation extension" \ |
| 5710 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5711 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5712 | -C "error" \ |
| 5713 | -s "Extra-header:" |
| 5714 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5715 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 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 server strict, client default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5721 | "$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] | 5722 | "$P_CLI debug_level=3" \ |
| 5723 | 0 \ |
| 5724 | -c "found renegotiation extension" \ |
| 5725 | -C "error" \ |
| 5726 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5727 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5728 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5729 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5730 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5731 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5732 | "$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] | 5733 | "$P_CLI debug_level=3" \ |
| 5734 | 0 \ |
| 5735 | -C "found renegotiation extension" \ |
| 5736 | -C "error" \ |
| 5737 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5738 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5739 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5740 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5741 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5742 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5743 | "$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] | 5744 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 5745 | 1 \ |
| 5746 | -C "found renegotiation extension" \ |
| 5747 | -c "error" \ |
| 5748 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5749 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5750 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5751 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5752 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5753 | run_test "Renego ext: gnutls client strict, server default" \ |
| 5754 | "$P_SRV debug_level=3" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5755 | "$G_CLI --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5756 | 0 \ |
| 5757 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5758 | -s "server hello, secure renegotiation extension" |
| 5759 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5760 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5761 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5762 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5763 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 5764 | "$P_SRV debug_level=3" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5765 | "$G_CLI --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5766 | 0 \ |
| 5767 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5768 | -S "server hello, secure renegotiation extension" |
| 5769 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5770 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5771 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5772 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5773 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 5774 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5775 | "$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] | 5776 | 1 \ |
| 5777 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5778 | -S "server hello, secure renegotiation extension" |
| 5779 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5780 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 5781 | |
| 5782 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5783 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5784 | run_test "DER format: no trailing bytes" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5785 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der0.crt \ |
| 5786 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5787 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5788 | 0 \ |
| 5789 | -c "Handshake was completed" \ |
| 5790 | |
| 5791 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5792 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5793 | run_test "DER format: with a trailing zero byte" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5794 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der1a.crt \ |
| 5795 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5796 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5797 | 0 \ |
| 5798 | -c "Handshake was completed" \ |
| 5799 | |
| 5800 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5801 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5802 | run_test "DER format: with a trailing random byte" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5803 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der1b.crt \ |
| 5804 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5805 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5806 | 0 \ |
| 5807 | -c "Handshake was completed" \ |
| 5808 | |
| 5809 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5810 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5811 | run_test "DER format: with 2 trailing random bytes" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5812 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der2.crt \ |
| 5813 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5814 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5815 | 0 \ |
| 5816 | -c "Handshake was completed" \ |
| 5817 | |
| 5818 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5819 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5820 | run_test "DER format: with 4 trailing random bytes" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5821 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der4.crt \ |
| 5822 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5823 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5824 | 0 \ |
| 5825 | -c "Handshake was completed" \ |
| 5826 | |
| 5827 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5828 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5829 | run_test "DER format: with 8 trailing random bytes" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5830 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der8.crt \ |
| 5831 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5832 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5833 | 0 \ |
| 5834 | -c "Handshake was completed" \ |
| 5835 | |
| 5836 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5837 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5838 | run_test "DER format: with 9 trailing random bytes" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5839 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der9.crt \ |
| 5840 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5841 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5842 | 0 \ |
| 5843 | -c "Handshake was completed" \ |
| 5844 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5845 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 5846 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5847 | |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5848 | # The next 4 cases test the 3 auth modes with a badly signed server cert. |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5849 | run_test "Authentication: server badcert, client required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5850 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5851 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5852 | "$P_CLI debug_level=3 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5853 | 1 \ |
| 5854 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5855 | -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] | 5856 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5857 | -c "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5858 | -c "X509 - Certificate verification failed" |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5859 | # MBEDTLS_X509_BADCERT_NOT_TRUSTED -> MBEDTLS_SSL_ALERT_MSG_UNKNOWN_CA |
| 5860 | # We don't check that the server receives the alert because it might |
| 5861 | # detect that its write end of the connection is closed and abort |
| 5862 | # before reading the alert message. |
| 5863 | |
| 5864 | run_test "Authentication: server badcert, client required (1.2)" \ |
| 5865 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5866 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 5867 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=required" \ |
| 5868 | 1 \ |
| 5869 | -c "x509_verify_cert() returned" \ |
| 5870 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5871 | -c "! mbedtls_ssl_handshake returned" \ |
| 5872 | -c "send alert level=2 message=48" \ |
| 5873 | -c "X509 - Certificate verification failed" |
| 5874 | # MBEDTLS_X509_BADCERT_NOT_TRUSTED -> MBEDTLS_SSL_ALERT_MSG_UNKNOWN_CA |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5875 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5876 | run_test "Authentication: server badcert, client optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5877 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5878 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | e1cc926 | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 5879 | "$P_CLI force_version=tls13 debug_level=3 auth_mode=optional" \ |
| 5880 | 0 \ |
| 5881 | -c "x509_verify_cert() returned" \ |
| 5882 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5883 | -C "! mbedtls_ssl_handshake returned" \ |
| 5884 | -C "send alert level=2 message=48" \ |
| 5885 | -C "X509 - Certificate verification failed" |
| 5886 | |
| 5887 | run_test "Authentication: server badcert, client optional (1.2)" \ |
| 5888 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5889 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5890 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5891 | 0 \ |
| 5892 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5893 | -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] | 5894 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5895 | -C "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5896 | -C "X509 - Certificate verification failed" |
| 5897 | |
Manuel Pégourié-Gonnard | a3cf1a5 | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 5898 | run_test "Authentication: server badcert, client none" \ |
| 5899 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5900 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 2b98a4e | 2024-08-14 10:44:02 +0200 | [diff] [blame] | 5901 | "$P_CLI debug_level=3 auth_mode=none" \ |
| 5902 | 0 \ |
| 5903 | -C "x509_verify_cert() returned" \ |
| 5904 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5905 | -C "! mbedtls_ssl_handshake returned" \ |
| 5906 | -C "send alert level=2 message=48" \ |
| 5907 | -C "X509 - Certificate verification failed" |
| 5908 | |
| 5909 | run_test "Authentication: server badcert, client none (1.2)" \ |
| 5910 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5911 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5912 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=none" \ |
Manuel Pégourié-Gonnard | a3cf1a5 | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 5913 | 0 \ |
| 5914 | -C "x509_verify_cert() returned" \ |
| 5915 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5916 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5917 | -C "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | a3cf1a5 | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 5918 | -C "X509 - Certificate verification failed" |
| 5919 | |
Manuel Pégourié-Gonnard | a0a781e | 2024-08-14 10:34:53 +0200 | [diff] [blame] | 5920 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 5921 | "$P_SRV" \ |
| 5922 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5923 | 1 \ |
| 5924 | -c "x509_verify_cert() returned" \ |
| 5925 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5926 | -c "! Certificate verification flags"\ |
| 5927 | -c "! mbedtls_ssl_handshake returned" \ |
| 5928 | -c "SSL - No CA Chain is set, but required to operate" |
| 5929 | |
| 5930 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 5931 | run_test "Authentication: server goodcert, client required, no trusted CA (1.2)" \ |
| 5932 | "$P_SRV force_version=tls12" \ |
| 5933 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5934 | 1 \ |
| 5935 | -c "x509_verify_cert() returned" \ |
| 5936 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5937 | -c "! Certificate verification flags"\ |
| 5938 | -c "! mbedtls_ssl_handshake returned" \ |
| 5939 | -c "SSL - No CA Chain is set, but required to operate" |
Manuel Pégourié-Gonnard | e1cc926 | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 5940 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5941 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 5942 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | e1cc926 | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 5943 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 5944 | 0 \ |
| 5945 | -c "x509_verify_cert() returned" \ |
| 5946 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5947 | -c "! Certificate verification flags"\ |
| 5948 | -C "! mbedtls_ssl_handshake returned" \ |
| 5949 | -C "X509 - Certificate verification failed" \ |
| 5950 | -C "SSL - No CA Chain is set, but required to operate" |
| 5951 | |
| 5952 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 5953 | run_test "Authentication: server goodcert, client optional, no trusted CA (1.2)" \ |
| 5954 | "$P_SRV" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5955 | "$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] | 5956 | 0 \ |
| 5957 | -c "x509_verify_cert() returned" \ |
| 5958 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5959 | -c "! Certificate verification flags"\ |
| 5960 | -C "! mbedtls_ssl_handshake returned" \ |
| 5961 | -C "X509 - Certificate verification failed" \ |
| 5962 | -C "SSL - No CA Chain is set, but required to operate" |
| 5963 | |
Manuel Pégourié-Gonnard | 2b98a4e | 2024-08-14 10:44:02 +0200 | [diff] [blame] | 5964 | run_test "Authentication: server goodcert, client none, no trusted CA" \ |
| 5965 | "$P_SRV" \ |
| 5966 | "$P_CLI debug_level=3 auth_mode=none ca_file=none ca_path=none" \ |
| 5967 | 0 \ |
| 5968 | -C "x509_verify_cert() returned" \ |
| 5969 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5970 | -C "! Certificate verification flags"\ |
| 5971 | -C "! mbedtls_ssl_handshake returned" \ |
| 5972 | -C "X509 - Certificate verification failed" \ |
| 5973 | -C "SSL - No CA Chain is set, but required to operate" |
| 5974 | |
| 5975 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 5976 | run_test "Authentication: server goodcert, client none, no trusted CA (1.2)" \ |
| 5977 | "$P_SRV" \ |
| 5978 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=none ca_file=none ca_path=none" \ |
| 5979 | 0 \ |
| 5980 | -C "x509_verify_cert() returned" \ |
| 5981 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5982 | -C "! Certificate verification flags"\ |
| 5983 | -C "! mbedtls_ssl_handshake returned" \ |
| 5984 | -C "X509 - Certificate verification failed" \ |
| 5985 | -C "SSL - No CA Chain is set, but required to operate" |
Manuel Pégourié-Gonnard | 060e284 | 2024-08-05 11:10:47 +0200 | [diff] [blame] | 5986 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5987 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5988 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5989 | # the client informs the server about the supported curves - it does, though, in the |
| 5990 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5991 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5992 | # different means to have the server ignoring the client's supported curve list. |
| 5993 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5994 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5995 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 5996 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 5997 | "$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] | 5998 | 1 \ |
| 5999 | -c "bad certificate (EC key curve)"\ |
| 6000 | -c "! Certificate verification flags"\ |
| 6001 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 6002 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 6003 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6004 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6005 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6006 | "$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] | 6007 | 1 \ |
| 6008 | -c "bad certificate (EC key curve)"\ |
| 6009 | -c "! Certificate verification flags"\ |
| 6010 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 6011 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6012 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6013 | run_test "Authentication: client SHA256, server required" \ |
| 6014 | "$P_SRV auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6015 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6016 | key_file=$DATA_FILES_PATH/server6.key \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6017 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 6018 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6019 | -c "Supported Signature Algorithm found: 04 " \ |
| 6020 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6021 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6022 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6023 | run_test "Authentication: client SHA384, server required" \ |
| 6024 | "$P_SRV auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6025 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6026 | key_file=$DATA_FILES_PATH/server6.key \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6027 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 6028 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6029 | -c "Supported Signature Algorithm found: 04 " \ |
| 6030 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6031 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6032 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 6033 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 6034 | "$P_CLI debug_level=3 crt_file=none \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6035 | key_file=$DATA_FILES_PATH/server5.key" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6036 | 1 \ |
| 6037 | -S "skip write certificate request" \ |
| 6038 | -C "skip parse certificate request" \ |
| 6039 | -c "got a certificate request" \ |
| 6040 | -c "= write certificate$" \ |
| 6041 | -C "skip write certificate$" \ |
| 6042 | -S "x509_verify_cert() returned" \ |
Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 6043 | -s "peer has no certificate" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6044 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6045 | -s "No client certification received from the client, but required by the authentication mode" |
| 6046 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6047 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6048 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6049 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6050 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6051 | 1 \ |
| 6052 | -S "skip write certificate request" \ |
| 6053 | -C "skip parse certificate request" \ |
| 6054 | -c "got a certificate request" \ |
| 6055 | -C "skip write certificate" \ |
| 6056 | -C "skip write certificate verify" \ |
| 6057 | -S "skip parse certificate verify" \ |
| 6058 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6059 | -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] | 6060 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 6061 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6062 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 6063 | # We don't check that the client receives the alert because it might |
| 6064 | # detect that its write end of the connection is closed and abort |
| 6065 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6066 | |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 6067 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6068 | "$P_SRV debug_level=3 auth_mode=required ca_file=$DATA_FILES_PATH/server5-selfsigned.crt" \ |
| 6069 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6070 | key_file=$DATA_FILES_PATH/server5.key" \ |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 6071 | 0 \ |
| 6072 | -S "skip write certificate request" \ |
| 6073 | -C "skip parse certificate request" \ |
| 6074 | -c "got a certificate request" \ |
| 6075 | -C "skip write certificate" \ |
| 6076 | -C "skip write certificate verify" \ |
| 6077 | -S "skip parse certificate verify" \ |
| 6078 | -S "x509_verify_cert() returned" \ |
| 6079 | -S "! The certificate is not correctly signed" \ |
| 6080 | -S "X509 - Certificate verification failed" |
| 6081 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6082 | run_test "Authentication: client cert not trusted, server required" \ |
| 6083 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6084 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6085 | key_file=$DATA_FILES_PATH/server5.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6086 | 1 \ |
| 6087 | -S "skip write certificate request" \ |
| 6088 | -C "skip parse certificate request" \ |
| 6089 | -c "got a certificate request" \ |
| 6090 | -C "skip write certificate" \ |
| 6091 | -C "skip write certificate verify" \ |
| 6092 | -S "skip parse certificate verify" \ |
| 6093 | -s "x509_verify_cert() returned" \ |
| 6094 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6095 | -s "! mbedtls_ssl_handshake returned" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6096 | -s "X509 - Certificate verification failed" |
| 6097 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6098 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6099 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6100 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6101 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6102 | 0 \ |
| 6103 | -S "skip write certificate request" \ |
| 6104 | -C "skip parse certificate request" \ |
| 6105 | -c "got a certificate request" \ |
| 6106 | -C "skip write certificate" \ |
| 6107 | -C "skip write certificate verify" \ |
| 6108 | -S "skip parse certificate verify" \ |
| 6109 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6110 | -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] | 6111 | -S "! mbedtls_ssl_handshake returned" \ |
| 6112 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6113 | -S "X509 - Certificate verification failed" |
| 6114 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6115 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6116 | "$P_SRV debug_level=3 auth_mode=none" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6117 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6118 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6119 | 0 \ |
| 6120 | -s "skip write certificate request" \ |
| 6121 | -C "skip parse certificate request" \ |
| 6122 | -c "got no certificate request" \ |
| 6123 | -c "skip write certificate" \ |
| 6124 | -c "skip write certificate verify" \ |
| 6125 | -s "skip parse certificate verify" \ |
| 6126 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6127 | -S "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6128 | -S "! mbedtls_ssl_handshake returned" \ |
| 6129 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6130 | -S "X509 - Certificate verification failed" |
| 6131 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6132 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6133 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 6134 | "$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] | 6135 | 0 \ |
| 6136 | -S "skip write certificate request" \ |
| 6137 | -C "skip parse certificate request" \ |
| 6138 | -c "got a certificate request" \ |
| 6139 | -C "skip write certificate$" \ |
| 6140 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6141 | -c "skip write certificate verify" \ |
| 6142 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6143 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6144 | -S "! mbedtls_ssl_handshake returned" \ |
| 6145 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6146 | -S "X509 - Certificate verification failed" |
| 6147 | |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 6148 | requires_openssl_tls1_3_with_compatible_ephemeral |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6149 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6150 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6151 | "$O_NEXT_CLI_NO_CERT -no_middlebox" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6152 | 0 \ |
| 6153 | -S "skip write certificate request" \ |
| 6154 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6155 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6156 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6157 | -S "X509 - Certificate verification failed" |
| 6158 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6159 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6160 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6161 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6162 | "$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] | 6163 | 0 \ |
| 6164 | -C "skip parse certificate request" \ |
| 6165 | -c "got a certificate request" \ |
| 6166 | -C "skip write certificate$" \ |
| 6167 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6168 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6169 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6170 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6171 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6172 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6173 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 6174 | 1 \ |
| 6175 | -C "skip parse certificate request" \ |
| 6176 | -c "got a certificate request" \ |
| 6177 | -C "skip write certificate$" \ |
| 6178 | -c "skip write certificate verify" \ |
| 6179 | -c "! mbedtls_ssl_handshake returned" |
| 6180 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 6181 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 6182 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 6183 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 6184 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 6185 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 6186 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 6187 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 6188 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 6189 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 6190 | # 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] | 6191 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6192 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6193 | run_test "Authentication: server max_int chain, client default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6194 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6195 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
| 6196 | "$P_CLI server_name=CA09 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6197 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6198 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6199 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6200 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6201 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6202 | run_test "Authentication: server max_int+1 chain, client default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6203 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6204 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6205 | "$P_CLI server_name=CA10 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6206 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6207 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6208 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6209 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6210 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6211 | run_test "Authentication: server max_int+1 chain, client optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6212 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6213 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | e1cc926 | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 6214 | "$P_CLI server_name=CA10 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6215 | auth_mode=optional" \ |
| 6216 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6217 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6218 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6219 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6220 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6221 | run_test "Authentication: server max_int+1 chain, client none" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6222 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6223 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6224 | "$P_CLI force_version=tls12 server_name=CA10 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6225 | auth_mode=none" \ |
| 6226 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6227 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6228 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6229 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6230 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6231 | run_test "Authentication: client max_int+1 chain, server default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6232 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt" \ |
| 6233 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6234 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6235 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6236 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6237 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6238 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6239 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6240 | run_test "Authentication: client max_int+1 chain, server optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6241 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=optional" \ |
| 6242 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6243 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6244 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6245 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6246 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6247 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6248 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6249 | run_test "Authentication: client max_int+1 chain, server required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6250 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
| 6251 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6252 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6253 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6254 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6255 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6256 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6257 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6258 | run_test "Authentication: client max_int chain, server required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6259 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
| 6260 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6261 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6262 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6263 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6264 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6265 | # Tests for CA list in CertificateRequest messages |
| 6266 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6267 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6268 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 6269 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6270 | "$P_CLI force_version=tls12 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6271 | key_file=$DATA_FILES_PATH/server6.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6272 | 0 \ |
| 6273 | -s "requested DN" |
| 6274 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6275 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6276 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 6277 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6278 | "$P_CLI force_version=tls12 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6279 | key_file=$DATA_FILES_PATH/server6.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6280 | 0 \ |
| 6281 | -S "requested DN" |
| 6282 | |
| 6283 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6284 | "$P_SRV force_version=tls12 debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6285 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6286 | key_file=$DATA_FILES_PATH/server5.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6287 | 1 \ |
| 6288 | -S "requested DN" \ |
| 6289 | -s "x509_verify_cert() returned" \ |
| 6290 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6291 | -s "! mbedtls_ssl_handshake returned" \ |
| 6292 | -c "! mbedtls_ssl_handshake returned" \ |
| 6293 | -s "X509 - Certificate verification failed" |
| 6294 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6295 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6296 | run_test "Authentication: send alt conf DN hints in CertificateRequest" \ |
| 6297 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6298 | crt_file2=$DATA_FILES_PATH/server1.crt \ |
| 6299 | key_file2=$DATA_FILES_PATH/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6300 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6301 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6302 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6303 | 0 \ |
| 6304 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 6305 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6306 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6307 | run_test "Authentication: send alt conf DN hints in CertificateRequest (2)" \ |
| 6308 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6309 | crt_file2=$DATA_FILES_PATH/server2.crt \ |
| 6310 | key_file2=$DATA_FILES_PATH/server2.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6311 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6312 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6313 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6314 | 0 \ |
| 6315 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" |
| 6316 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6317 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6318 | run_test "Authentication: send alt hs DN hints in CertificateRequest" \ |
| 6319 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6320 | crt_file2=$DATA_FILES_PATH/server1.crt \ |
| 6321 | key_file2=$DATA_FILES_PATH/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6322 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6323 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6324 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6325 | 0 \ |
| 6326 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 6327 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 6328 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 6329 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6330 | |
| 6331 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6332 | run_test "Authentication, CA callback: server badcert, client required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6333 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6334 | key_file=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6335 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6336 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6337 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6338 | -c "x509_verify_cert() returned" \ |
| 6339 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6340 | -c "! mbedtls_ssl_handshake returned" \ |
| 6341 | -c "X509 - Certificate verification failed" |
| 6342 | |
| 6343 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6344 | run_test "Authentication, CA callback: server badcert, client optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6345 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6346 | key_file=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6347 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6348 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6349 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6350 | -c "x509_verify_cert() returned" \ |
| 6351 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6352 | -C "! mbedtls_ssl_handshake returned" \ |
| 6353 | -C "X509 - Certificate verification failed" |
| 6354 | |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6355 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6356 | run_test "Authentication, CA callback: server badcert, client none" \ |
| 6357 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6358 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 6359 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=none" \ |
| 6360 | 0 \ |
| 6361 | -C "use CA callback for X.509 CRT verification" \ |
| 6362 | -C "x509_verify_cert() returned" \ |
| 6363 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6364 | -C "! mbedtls_ssl_handshake returned" \ |
| 6365 | -C "X509 - Certificate verification failed" |
| 6366 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6367 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 6368 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 6369 | # the client informs the server about the supported curves - it does, though, in the |
| 6370 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 6371 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 6372 | # different means to have the server ignoring the client's supported curve list. |
| 6373 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6374 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6375 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6376 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6377 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6378 | "$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] | 6379 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6380 | -c "use CA callback for X.509 CRT verification" \ |
| 6381 | -c "bad certificate (EC key curve)" \ |
| 6382 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6383 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 6384 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6385 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6386 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6387 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6388 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6389 | "$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] | 6390 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6391 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6392 | -c "bad certificate (EC key curve)"\ |
| 6393 | -c "! Certificate verification flags"\ |
| 6394 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 6395 | |
| 6396 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6397 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 84442a3 | 2024-04-03 08:57:09 +0200 | [diff] [blame] | 6398 | run_test "Authentication, CA callback: client SHA384, server required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6399 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6400 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6401 | key_file=$DATA_FILES_PATH/server6.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6402 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 6403 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6404 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6405 | -c "Supported Signature Algorithm found: 04 " \ |
| 6406 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6407 | |
| 6408 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6409 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 84442a3 | 2024-04-03 08:57:09 +0200 | [diff] [blame] | 6410 | run_test "Authentication, CA callback: client SHA256, server required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6411 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6412 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6413 | key_file=$DATA_FILES_PATH/server6.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6414 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 6415 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6416 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6417 | -c "Supported Signature Algorithm found: 04 " \ |
| 6418 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6419 | |
| 6420 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6421 | run_test "Authentication, CA callback: client badcert, server required" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6422 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6423 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6424 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6425 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6426 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6427 | -S "skip write certificate request" \ |
| 6428 | -C "skip parse certificate request" \ |
| 6429 | -c "got a certificate request" \ |
| 6430 | -C "skip write certificate" \ |
| 6431 | -C "skip write certificate verify" \ |
| 6432 | -S "skip parse certificate verify" \ |
| 6433 | -s "x509_verify_cert() returned" \ |
| 6434 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6435 | -s "! mbedtls_ssl_handshake returned" \ |
| 6436 | -s "send alert level=2 message=48" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6437 | -s "X509 - Certificate verification failed" |
| 6438 | # We don't check that the client receives the alert because it might |
| 6439 | # detect that its write end of the connection is closed and abort |
| 6440 | # before reading the alert message. |
| 6441 | |
| 6442 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6443 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6444 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6445 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6446 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6447 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6448 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6449 | -S "skip write certificate request" \ |
| 6450 | -C "skip parse certificate request" \ |
| 6451 | -c "got a certificate request" \ |
| 6452 | -C "skip write certificate" \ |
| 6453 | -C "skip write certificate verify" \ |
| 6454 | -S "skip parse certificate verify" \ |
| 6455 | -s "x509_verify_cert() returned" \ |
| 6456 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6457 | -s "! mbedtls_ssl_handshake returned" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6458 | -s "X509 - Certificate verification failed" |
| 6459 | |
| 6460 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6461 | run_test "Authentication, CA callback: client badcert, server optional" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6462 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6463 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6464 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6465 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6466 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6467 | -S "skip write certificate request" \ |
| 6468 | -C "skip parse certificate request" \ |
| 6469 | -c "got a certificate request" \ |
| 6470 | -C "skip write certificate" \ |
| 6471 | -C "skip write certificate verify" \ |
| 6472 | -S "skip parse certificate verify" \ |
| 6473 | -s "x509_verify_cert() returned" \ |
| 6474 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6475 | -S "! mbedtls_ssl_handshake returned" \ |
| 6476 | -C "! mbedtls_ssl_handshake returned" \ |
| 6477 | -S "X509 - Certificate verification failed" |
| 6478 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6479 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6480 | requires_full_size_output_buffer |
| 6481 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6482 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6483 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6484 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6485 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6486 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6487 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6488 | -C "X509 - A fatal error occurred" |
| 6489 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6490 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6491 | requires_full_size_output_buffer |
| 6492 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6493 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6494 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6495 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6496 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6497 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6498 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6499 | -c "X509 - A fatal error occurred" |
| 6500 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6501 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6502 | requires_full_size_output_buffer |
| 6503 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6504 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6505 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6506 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6507 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6508 | debug_level=3 auth_mode=optional" \ |
| 6509 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6510 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6511 | -c "X509 - A fatal error occurred" |
| 6512 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6513 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6514 | requires_full_size_output_buffer |
| 6515 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6516 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6517 | "$P_SRV ca_callback=1 debug_level=3 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6518 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6519 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6520 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6521 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6522 | -s "X509 - A fatal error occurred" |
| 6523 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6524 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6525 | requires_full_size_output_buffer |
| 6526 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6527 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6528 | "$P_SRV ca_callback=1 debug_level=3 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6529 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6530 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6531 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6532 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6533 | -s "X509 - A fatal error occurred" |
| 6534 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6535 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6536 | requires_full_size_output_buffer |
| 6537 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6538 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6539 | "$P_SRV ca_callback=1 debug_level=3 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6540 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6541 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6542 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6543 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6544 | -S "X509 - A fatal error occurred" |
| 6545 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 6546 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6547 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6548 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6549 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6550 | "$P_SRV force_version=tls12 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 6551 | key_file=$DATA_FILES_PATH/server5.key \ |
| 6552 | crt_file2=$DATA_FILES_PATH/server5-sha1.crt \ |
| 6553 | key_file2=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6554 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6555 | 0 \ |
| 6556 | -c "signed using.*ECDSA with SHA256" \ |
| 6557 | -C "signed using.*ECDSA with SHA1" |
| 6558 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6559 | # tests for SNI |
| 6560 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6561 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6562 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6563 | "$P_SRV debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6564 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6565 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6566 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6567 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6568 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6569 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6570 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6571 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6572 | "$P_SRV debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6573 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6574 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6575 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6576 | 0 \ |
| 6577 | -s "parse ServerName extension" \ |
| 6578 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6579 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6580 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6581 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6582 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6583 | "$P_SRV debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6584 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6585 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6586 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6587 | 0 \ |
| 6588 | -s "parse ServerName extension" \ |
| 6589 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6590 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6591 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6592 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6593 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6594 | "$P_SRV debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6595 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6596 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6597 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6598 | 1 \ |
| 6599 | -s "parse ServerName extension" \ |
| 6600 | -s "ssl_sni_wrapper() returned" \ |
| 6601 | -s "mbedtls_ssl_handshake returned" \ |
| 6602 | -c "mbedtls_ssl_handshake returned" \ |
| 6603 | -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] | 6604 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6605 | run_test "SNI: client auth no override: optional" \ |
| 6606 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6607 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6608 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-" \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6609 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6610 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6611 | -S "skip write certificate request" \ |
| 6612 | -C "skip parse certificate request" \ |
| 6613 | -c "got a certificate request" \ |
| 6614 | -C "skip write certificate" \ |
| 6615 | -C "skip write certificate verify" \ |
| 6616 | -S "skip parse certificate verify" |
| 6617 | |
| 6618 | run_test "SNI: client auth override: none -> optional" \ |
| 6619 | "$P_SRV debug_level=3 auth_mode=none \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6620 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6621 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,optional" \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6622 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6623 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6624 | -S "skip write certificate request" \ |
| 6625 | -C "skip parse certificate request" \ |
| 6626 | -c "got a certificate request" \ |
| 6627 | -C "skip write certificate" \ |
| 6628 | -C "skip write certificate verify" \ |
| 6629 | -S "skip parse certificate verify" |
| 6630 | |
| 6631 | run_test "SNI: client auth override: optional -> none" \ |
| 6632 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6633 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6634 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,none" \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6635 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6636 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6637 | -s "skip write certificate request" \ |
| 6638 | -C "skip parse certificate request" \ |
| 6639 | -c "got no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 6640 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6641 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6642 | run_test "SNI: CA no override" \ |
| 6643 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6644 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6645 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6646 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,required" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6647 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6648 | crt_file=$DATA_FILES_PATH/server6.crt key_file=$DATA_FILES_PATH/server6.key" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6649 | 1 \ |
| 6650 | -S "skip write certificate request" \ |
| 6651 | -C "skip parse certificate request" \ |
| 6652 | -c "got a certificate request" \ |
| 6653 | -C "skip write certificate" \ |
| 6654 | -C "skip write certificate verify" \ |
| 6655 | -S "skip parse certificate verify" \ |
| 6656 | -s "x509_verify_cert() returned" \ |
| 6657 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6658 | -S "The certificate has been revoked (is on a CRL)" |
| 6659 | |
| 6660 | run_test "SNI: CA override" \ |
| 6661 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6662 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6663 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6664 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,$DATA_FILES_PATH/test-ca2.crt,-,required" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6665 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6666 | crt_file=$DATA_FILES_PATH/server6.crt key_file=$DATA_FILES_PATH/server6.key" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6667 | 0 \ |
| 6668 | -S "skip write certificate request" \ |
| 6669 | -C "skip parse certificate request" \ |
| 6670 | -c "got a certificate request" \ |
| 6671 | -C "skip write certificate" \ |
| 6672 | -C "skip write certificate verify" \ |
| 6673 | -S "skip parse certificate verify" \ |
| 6674 | -S "x509_verify_cert() returned" \ |
| 6675 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6676 | -S "The certificate has been revoked (is on a CRL)" |
| 6677 | |
| 6678 | run_test "SNI: CA override with CRL" \ |
| 6679 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6680 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6681 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6682 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,$DATA_FILES_PATH/test-ca2.crt,$DATA_FILES_PATH/crl-ec-sha256.pem,required" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6683 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6684 | crt_file=$DATA_FILES_PATH/server6.crt key_file=$DATA_FILES_PATH/server6.key" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6685 | 1 \ |
| 6686 | -S "skip write certificate request" \ |
| 6687 | -C "skip parse certificate request" \ |
| 6688 | -c "got a certificate request" \ |
| 6689 | -C "skip write certificate" \ |
| 6690 | -C "skip write certificate verify" \ |
| 6691 | -S "skip parse certificate verify" \ |
| 6692 | -s "x509_verify_cert() returned" \ |
| 6693 | -S "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 4192bba | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6694 | -s "send alert level=2 message=44" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6695 | -s "The certificate has been revoked (is on a CRL)" |
Manuel Pégourié-Gonnard | 4192bba | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6696 | # MBEDTLS_X509_BADCERT_REVOKED -> MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6697 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6698 | # Tests for SNI and DTLS |
| 6699 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6700 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6701 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6702 | run_test "SNI: DTLS, no SNI callback" \ |
| 6703 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6704 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6705 | "$P_CLI server_name=localhost dtls=1" \ |
| 6706 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6707 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6708 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6709 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6710 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6711 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6712 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6713 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6714 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6715 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6716 | "$P_CLI server_name=localhost dtls=1" \ |
| 6717 | 0 \ |
| 6718 | -s "parse ServerName extension" \ |
| 6719 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6720 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6721 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6722 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6723 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6724 | run_test "SNI: DTLS, matching cert 2" \ |
| 6725 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6726 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6727 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6728 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 6729 | 0 \ |
| 6730 | -s "parse ServerName extension" \ |
| 6731 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6732 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6733 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6734 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6735 | run_test "SNI: DTLS, no matching cert" \ |
| 6736 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6737 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6738 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6739 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 6740 | 1 \ |
| 6741 | -s "parse ServerName extension" \ |
| 6742 | -s "ssl_sni_wrapper() returned" \ |
| 6743 | -s "mbedtls_ssl_handshake returned" \ |
| 6744 | -c "mbedtls_ssl_handshake returned" \ |
| 6745 | -c "SSL - A fatal alert message was received from our peer" |
| 6746 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6748 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 6749 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6750 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6751 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6752 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6753 | 0 \ |
| 6754 | -S "skip write certificate request" \ |
| 6755 | -C "skip parse certificate request" \ |
| 6756 | -c "got a certificate request" \ |
| 6757 | -C "skip write certificate" \ |
| 6758 | -C "skip write certificate verify" \ |
| 6759 | -S "skip parse certificate verify" |
| 6760 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6761 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6762 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 6763 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6764 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6765 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,optional" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6766 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6767 | 0 \ |
| 6768 | -S "skip write certificate request" \ |
| 6769 | -C "skip parse certificate request" \ |
| 6770 | -c "got a certificate request" \ |
| 6771 | -C "skip write certificate" \ |
| 6772 | -C "skip write certificate verify" \ |
| 6773 | -S "skip parse certificate verify" |
| 6774 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6775 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6776 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 6777 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6778 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6779 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,none" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6780 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6781 | 0 \ |
| 6782 | -s "skip write certificate request" \ |
| 6783 | -C "skip parse certificate request" \ |
| 6784 | -c "got no certificate request" \ |
| 6785 | -c "skip write certificate" \ |
| 6786 | -c "skip write certificate verify" \ |
| 6787 | -s "skip parse certificate verify" |
| 6788 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6789 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6790 | run_test "SNI: DTLS, CA no override" \ |
| 6791 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6792 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6793 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6794 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,required" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6795 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6796 | crt_file=$DATA_FILES_PATH/server6.crt key_file=$DATA_FILES_PATH/server6.key" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6797 | 1 \ |
| 6798 | -S "skip write certificate request" \ |
| 6799 | -C "skip parse certificate request" \ |
| 6800 | -c "got a certificate request" \ |
| 6801 | -C "skip write certificate" \ |
| 6802 | -C "skip write certificate verify" \ |
| 6803 | -S "skip parse certificate verify" \ |
| 6804 | -s "x509_verify_cert() returned" \ |
| 6805 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6806 | -S "The certificate has been revoked (is on a CRL)" |
| 6807 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6808 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6809 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6810 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6811 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6812 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6813 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,$DATA_FILES_PATH/test-ca2.crt,-,required" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6814 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6815 | crt_file=$DATA_FILES_PATH/server6.crt key_file=$DATA_FILES_PATH/server6.key" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6816 | 0 \ |
| 6817 | -S "skip write certificate request" \ |
| 6818 | -C "skip parse certificate request" \ |
| 6819 | -c "got a certificate request" \ |
| 6820 | -C "skip write certificate" \ |
| 6821 | -C "skip write certificate verify" \ |
| 6822 | -S "skip parse certificate verify" \ |
| 6823 | -S "x509_verify_cert() returned" \ |
| 6824 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6825 | -S "The certificate has been revoked (is on a CRL)" |
| 6826 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6827 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6828 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6829 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6830 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key dtls=1 \ |
| 6831 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6832 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,$DATA_FILES_PATH/test-ca2.crt,$DATA_FILES_PATH/crl-ec-sha256.pem,required" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6833 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6834 | crt_file=$DATA_FILES_PATH/server6.crt key_file=$DATA_FILES_PATH/server6.key" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6835 | 1 \ |
| 6836 | -S "skip write certificate request" \ |
| 6837 | -C "skip parse certificate request" \ |
| 6838 | -c "got a certificate request" \ |
| 6839 | -C "skip write certificate" \ |
| 6840 | -C "skip write certificate verify" \ |
| 6841 | -S "skip parse certificate verify" \ |
| 6842 | -s "x509_verify_cert() returned" \ |
| 6843 | -S "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 4192bba | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6844 | -s "send alert level=2 message=44" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6845 | -s "The certificate has been revoked (is on a CRL)" |
Manuel Pégourié-Gonnard | 4192bba | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6846 | # MBEDTLS_X509_BADCERT_REVOKED -> MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6847 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6848 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 6849 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6850 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6851 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6852 | "$P_CLI nbio=2 tickets=0" \ |
| 6853 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6854 | -S "mbedtls_ssl_handshake returned" \ |
| 6855 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6856 | -c "Read from server: .* bytes read" |
| 6857 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6858 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6859 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 6860 | "$P_CLI nbio=2 tickets=0" \ |
| 6861 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6862 | -S "mbedtls_ssl_handshake returned" \ |
| 6863 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6864 | -c "Read from server: .* bytes read" |
| 6865 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6866 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6867 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6868 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 6869 | "$P_CLI nbio=2 tickets=1 new_session_tickets=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6870 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6871 | -S "mbedtls_ssl_handshake returned" \ |
| 6872 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6873 | -c "Read from server: .* bytes read" |
| 6874 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6875 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6876 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6877 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 6878 | "$P_CLI nbio=2 tickets=1 new_session_tickets=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6879 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6880 | -S "mbedtls_ssl_handshake returned" \ |
| 6881 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6882 | -c "Read from server: .* bytes read" |
| 6883 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6884 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6885 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6886 | 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] | 6887 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6888 | "$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] | 6889 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6890 | -S "mbedtls_ssl_handshake returned" \ |
| 6891 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6892 | -c "Read from server: .* bytes read" |
| 6893 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6895 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6896 | 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] | 6897 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6898 | run_test "Non-blocking I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 6899 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 6900 | "$P_CLI nbio=2 tickets=1 new_session_tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6901 | 0 \ |
| 6902 | -S "mbedtls_ssl_handshake returned" \ |
| 6903 | -C "mbedtls_ssl_handshake returned" \ |
| 6904 | -c "Read from server: .* bytes read" |
| 6905 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6906 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6907 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6908 | 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] | 6909 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6910 | "$P_CLI force_version=tls12 nbio=2 tickets=1 reconnect=1" \ |
| 6911 | 0 \ |
| 6912 | -S "mbedtls_ssl_handshake returned" \ |
| 6913 | -C "mbedtls_ssl_handshake returned" \ |
| 6914 | -c "Read from server: .* bytes read" |
| 6915 | |
| 6916 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6917 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6918 | 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] | 6919 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6920 | run_test "Non-blocking I/O: TLS 1.3 + ticket + resume" \ |
| 6921 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 6922 | "$P_CLI nbio=2 tickets=1 new_session_tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6923 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6924 | -S "mbedtls_ssl_handshake returned" \ |
| 6925 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6926 | -c "Read from server: .* bytes read" |
| 6927 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6928 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6929 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6930 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6931 | "$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] | 6932 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6933 | -S "mbedtls_ssl_handshake returned" \ |
| 6934 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6935 | -c "Read from server: .* bytes read" |
| 6936 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6937 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 6938 | |
| 6939 | run_test "Event-driven I/O: basic handshake" \ |
| 6940 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6941 | "$P_CLI event=1 tickets=0" \ |
| 6942 | 0 \ |
| 6943 | -S "mbedtls_ssl_handshake returned" \ |
| 6944 | -C "mbedtls_ssl_handshake returned" \ |
| 6945 | -c "Read from server: .* bytes read" |
| 6946 | |
| 6947 | run_test "Event-driven I/O: client auth" \ |
| 6948 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 6949 | "$P_CLI event=1 tickets=0" \ |
| 6950 | 0 \ |
| 6951 | -S "mbedtls_ssl_handshake returned" \ |
| 6952 | -C "mbedtls_ssl_handshake returned" \ |
| 6953 | -c "Read from server: .* bytes read" |
| 6954 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6955 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6956 | run_test "Event-driven I/O: ticket" \ |
| 6957 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 6958 | "$P_CLI event=1 tickets=1 new_session_tickets=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6959 | 0 \ |
| 6960 | -S "mbedtls_ssl_handshake returned" \ |
| 6961 | -C "mbedtls_ssl_handshake returned" \ |
| 6962 | -c "Read from server: .* bytes read" |
| 6963 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6964 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6965 | run_test "Event-driven I/O: ticket + client auth" \ |
| 6966 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 6967 | "$P_CLI event=1 tickets=1 new_session_tickets=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6968 | 0 \ |
| 6969 | -S "mbedtls_ssl_handshake returned" \ |
| 6970 | -C "mbedtls_ssl_handshake returned" \ |
| 6971 | -c "Read from server: .* bytes read" |
| 6972 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6973 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6974 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6975 | 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] | 6976 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6977 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6978 | 0 \ |
| 6979 | -S "mbedtls_ssl_handshake returned" \ |
| 6980 | -C "mbedtls_ssl_handshake returned" \ |
| 6981 | -c "Read from server: .* bytes read" |
| 6982 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6983 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6984 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6985 | 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] | 6986 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6987 | run_test "Event-driven I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 6988 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 6989 | "$P_CLI event=1 tickets=1 new_session_tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6990 | 0 \ |
| 6991 | -S "mbedtls_ssl_handshake returned" \ |
| 6992 | -C "mbedtls_ssl_handshake returned" \ |
| 6993 | -c "Read from server: .* bytes read" |
| 6994 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6995 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6996 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6997 | run_test "Event-driven I/O: TLS 1.2 + ticket + resume" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6998 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6999 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
| 7000 | 0 \ |
| 7001 | -S "mbedtls_ssl_handshake returned" \ |
| 7002 | -C "mbedtls_ssl_handshake returned" \ |
| 7003 | -c "Read from server: .* bytes read" |
| 7004 | |
| 7005 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7006 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 7007 | 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] | 7008 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7009 | run_test "Event-driven I/O: TLS 1.3 + ticket + resume" \ |
| 7010 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 7011 | "$P_CLI event=1 tickets=1 new_session_tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7012 | 0 \ |
| 7013 | -S "mbedtls_ssl_handshake returned" \ |
| 7014 | -C "mbedtls_ssl_handshake returned" \ |
| 7015 | -c "Read from server: .* bytes read" |
| 7016 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7017 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7018 | run_test "Event-driven I/O: session-id resume" \ |
| 7019 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 7020 | "$P_CLI force_version=tls12 event=1 tickets=0 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7021 | 0 \ |
| 7022 | -S "mbedtls_ssl_handshake returned" \ |
| 7023 | -C "mbedtls_ssl_handshake returned" \ |
| 7024 | -c "Read from server: .* bytes read" |
| 7025 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7026 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7027 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 7028 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 7029 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 7030 | 0 \ |
| 7031 | -c "Read from server: .* bytes read" |
| 7032 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7033 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7034 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 7035 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 7036 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 7037 | 0 \ |
| 7038 | -c "Read from server: .* bytes read" |
| 7039 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7040 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7041 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7042 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 7043 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 7044 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 7045 | 0 \ |
| 7046 | -c "Read from server: .* bytes read" |
| 7047 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7048 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7049 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7050 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 7051 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 7052 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 7053 | 0 \ |
| 7054 | -c "Read from server: .* bytes read" |
| 7055 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7056 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7057 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7058 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 7059 | "$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] | 7060 | "$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] | 7061 | 0 \ |
| 7062 | -c "Read from server: .* bytes read" |
| 7063 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7064 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7065 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7066 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 7067 | "$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] | 7068 | "$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] | 7069 | 0 \ |
| 7070 | -c "Read from server: .* bytes read" |
| 7071 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7073 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 7074 | "$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] | 7075 | "$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] | 7076 | 0 \ |
| 7077 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7078 | |
| 7079 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 7080 | # During session resumption, the client will send its ApplicationData record |
| 7081 | # within the same datagram as the Finished messages. In this situation, the |
| 7082 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 7083 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7084 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7085 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7086 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7087 | "$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] | 7088 | "$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] | 7089 | 0 \ |
| 7090 | -c "Read from server: .* bytes read" |
| 7091 | |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7092 | # Tests for version negotiation. Some information to ease the understanding |
| 7093 | # of the version negotiation test titles below: |
| 7094 | # . 1.2/1.3 means that only TLS 1.2/TLS 1.3 is enabled. |
| 7095 | # . 1.2+1.3 means that both TLS 1.2 and TLS 1.3 are enabled. |
| 7096 | # . 1.2+(1.3)/(1.2)+1.3 means that TLS 1.2/1.3 is enabled and that |
| 7097 | # TLS 1.3/1.2 may be enabled or not. |
| 7098 | # . max=1.2 means that both TLS 1.2 and TLS 1.3 are enabled at build time but |
| 7099 | # TLS 1.3 is disabled at runtime (maximum negotiable version is TLS 1.2). |
| 7100 | # . min=1.3 means that both TLS 1.2 and TLS 1.3 are enabled at build time but |
| 7101 | # TLS 1.2 is disabled at runtime (minimum negotiable version is TLS 1.3). |
| 7102 | |
Ronald Cron | fe18d8d | 2024-03-06 15:19:55 +0100 | [diff] [blame] | 7103 | # Tests for version negotiation, MbedTLS client and server |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7104 | |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7105 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C |
| 7106 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7107 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7108 | 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] | 7109 | "$P_SRV" \ |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7110 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7111 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7112 | -S "mbedtls_ssl_handshake returned" \ |
| 7113 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7114 | -s "Protocol is TLSv1.2" \ |
| 7115 | -c "Protocol is TLSv1.2" |
| 7116 | |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7117 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7118 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7119 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7120 | 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] | 7121 | "$P_SRV max_version=tls12" \ |
| 7122 | "$P_CLI max_version=tls12" \ |
| 7123 | 0 \ |
| 7124 | -S "mbedtls_ssl_handshake returned" \ |
| 7125 | -C "mbedtls_ssl_handshake returned" \ |
| 7126 | -s "Protocol is TLSv1.2" \ |
| 7127 | -c "Protocol is TLSv1.2" |
| 7128 | |
| 7129 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7130 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 7131 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7132 | 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] | 7133 | "$P_SRV" \ |
| 7134 | "$P_CLI" \ |
| 7135 | 0 \ |
| 7136 | -S "mbedtls_ssl_handshake returned" \ |
| 7137 | -C "mbedtls_ssl_handshake returned" \ |
| 7138 | -s "Protocol is TLSv1.3" \ |
| 7139 | -c "Protocol is TLSv1.3" |
| 7140 | |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7141 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7142 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7143 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7144 | 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] | 7145 | "$P_SRV min_version=tls13" \ |
| 7146 | "$P_CLI min_version=tls13" \ |
| 7147 | 0 \ |
| 7148 | -S "mbedtls_ssl_handshake returned" \ |
| 7149 | -C "mbedtls_ssl_handshake returned" \ |
| 7150 | -s "Protocol is TLSv1.3" \ |
| 7151 | -c "Protocol is TLSv1.3" |
| 7152 | |
| 7153 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7154 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7155 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7156 | 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] | 7157 | "$P_SRV" \ |
| 7158 | "$P_CLI" \ |
| 7159 | 0 \ |
| 7160 | -S "mbedtls_ssl_handshake returned" \ |
| 7161 | -C "mbedtls_ssl_handshake returned" \ |
| 7162 | -s "Protocol is TLSv1.3" \ |
| 7163 | -c "Protocol is TLSv1.3" |
| 7164 | |
| 7165 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7166 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7167 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7168 | 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] | 7169 | "$P_SRV min_version=tls13" \ |
| 7170 | "$P_CLI" \ |
| 7171 | 0 \ |
| 7172 | -S "mbedtls_ssl_handshake returned" \ |
| 7173 | -C "mbedtls_ssl_handshake returned" \ |
| 7174 | -s "Protocol is TLSv1.3" \ |
| 7175 | -c "Protocol is TLSv1.3" |
| 7176 | |
| 7177 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7178 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7179 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7180 | 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] | 7181 | "$P_SRV max_version=tls12" \ |
| 7182 | "$P_CLI" \ |
| 7183 | 0 \ |
| 7184 | -S "mbedtls_ssl_handshake returned" \ |
| 7185 | -C "mbedtls_ssl_handshake returned" \ |
| 7186 | -s "Protocol is TLSv1.2" \ |
| 7187 | -c "Protocol is TLSv1.2" |
| 7188 | |
| 7189 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7190 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7191 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7192 | 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] | 7193 | "$P_SRV" \ |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7194 | "$P_CLI max_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7195 | 0 \ |
| 7196 | -S "mbedtls_ssl_handshake returned" \ |
| 7197 | -C "mbedtls_ssl_handshake returned" \ |
| 7198 | -s "Protocol is TLSv1.2" \ |
| 7199 | -c "Protocol is TLSv1.2" |
| 7200 | |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7201 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7202 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7203 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7204 | 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] | 7205 | "$P_SRV" \ |
| 7206 | "$P_CLI min_version=tls13" \ |
| 7207 | 0 \ |
| 7208 | -S "mbedtls_ssl_handshake returned" \ |
| 7209 | -C "mbedtls_ssl_handshake returned" \ |
| 7210 | -s "Protocol is TLSv1.3" \ |
| 7211 | -c "Protocol is TLSv1.3" |
| 7212 | |
| 7213 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7214 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7215 | 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] | 7216 | "$P_SRV min_version=tls13" \ |
| 7217 | "$P_CLI max_version=tls12" \ |
| 7218 | 1 \ |
| 7219 | -s "Handshake protocol not within min/max boundaries" \ |
| 7220 | -S "Protocol is TLSv1.2" \ |
| 7221 | -C "Protocol is TLSv1.2" \ |
| 7222 | -S "Protocol is TLSv1.3" \ |
| 7223 | -C "Protocol is TLSv1.3" |
Ronald Cron | fe18d8d | 2024-03-06 15:19:55 +0100 | [diff] [blame] | 7224 | |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7225 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7226 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7227 | 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] | 7228 | "$P_SRV max_version=tls12" \ |
| 7229 | "$P_CLI min_version=tls13" \ |
| 7230 | 1 \ |
| 7231 | -s "The handshake negotiation failed" \ |
| 7232 | -S "Protocol is TLSv1.2" \ |
| 7233 | -C "Protocol is TLSv1.2" \ |
| 7234 | -S "Protocol is TLSv1.3" \ |
| 7235 | -C "Protocol is TLSv1.3" |
| 7236 | |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7237 | # Tests of version negotiation on server side against GnuTLS client |
| 7238 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7239 | 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] | 7240 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7241 | 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] | 7242 | "$P_SRV" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7243 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7244 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7245 | -S "mbedtls_ssl_handshake returned" \ |
| 7246 | -s "Protocol is TLSv1.2" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7247 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7248 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7249 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7250 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7251 | 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] | 7252 | "$P_SRV max_version=tls12" \ |
| 7253 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7254 | 0 \ |
| 7255 | -S "mbedtls_ssl_handshake returned" \ |
| 7256 | -s "Protocol is TLSv1.2" |
| 7257 | |
| 7258 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7259 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7260 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7261 | 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] | 7262 | "$P_SRV" \ |
| 7263 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7264 | 0 \ |
| 7265 | -S "mbedtls_ssl_handshake returned" \ |
| 7266 | -s "Protocol is TLSv1.3" |
| 7267 | |
| 7268 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7269 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7270 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7271 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7272 | 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] | 7273 | "$P_SRV min_version=tls13" \ |
| 7274 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7275 | 0 \ |
| 7276 | -S "mbedtls_ssl_handshake returned" \ |
| 7277 | -s "Protocol is TLSv1.3" |
| 7278 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7279 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7280 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7281 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7282 | 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] | 7283 | "$P_SRV" \ |
| 7284 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7285 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7286 | -S "mbedtls_ssl_handshake returned" \ |
| 7287 | -s "Protocol is TLSv1.3" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7288 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7289 | requires_gnutls_next_disable_tls13_compat |
| 7290 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7291 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7292 | 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] | 7293 | "$P_SRV" \ |
| 7294 | "$G_NEXT_CLI localhost --priority=NORMAL:%DISABLE_TLS13_COMPAT_MODE" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7295 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7296 | -S "mbedtls_ssl_handshake returned" \ |
| 7297 | -s "Protocol is TLSv1.3" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7298 | |
| 7299 | # GnuTLS can be setup to send a ClientHello containing a supported versions |
| 7300 | # extension proposing TLS 1.2 (preferred) and then TLS 1.3. In that case, |
| 7301 | # a TLS 1.3 and TLS 1.2 capable server is supposed to negotiate TLS 1.2 and |
| 7302 | # to indicate in the ServerHello that it downgrades from TLS 1.3. The GnuTLS |
| 7303 | # client then detects the downgrade indication and aborts the handshake even |
| 7304 | # if TLS 1.2 was its preferred version. Keeping the test even if the |
| 7305 | # handshake fails eventually as it exercices parts of the Mbed TLS |
| 7306 | # implementation that are otherwise not exercised. |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7307 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7308 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 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 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] | 7311 | "$P_SRV" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7312 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3" \ |
| 7313 | 1 \ |
| 7314 | -c "Detected downgrade to TLS 1.2 from TLS 1.3" |
| 7315 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7316 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7317 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7318 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7319 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7320 | 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] | 7321 | "$P_SRV min_version=tls13" \ |
| 7322 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7323 | 0 \ |
| 7324 | -S "mbedtls_ssl_handshake returned" \ |
| 7325 | -s "Protocol is TLSv1.3" |
| 7326 | |
| 7327 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7328 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7329 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7330 | run_test "Server version nego G->m: cli 1.2+1.3, srv 1.2 -> 1.2" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7331 | "$P_SRV" \ |
| 7332 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7333 | 0 \ |
| 7334 | -S "mbedtls_ssl_handshake returned" \ |
| 7335 | -s "Protocol is TLSv1.2" |
| 7336 | |
| 7337 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7338 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7339 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7340 | run_test "Server version nego G->m: cli 1.2+1.3, max=1.2 -> 1.2" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7341 | "$P_SRV max_version=tls12" \ |
| 7342 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7343 | 0 \ |
| 7344 | -S "mbedtls_ssl_handshake returned" \ |
| 7345 | -s "Protocol is TLSv1.2" |
| 7346 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7347 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7348 | 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] | 7349 | "$P_SRV" \ |
| 7350 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 7351 | 1 \ |
| 7352 | -s "Handshake protocol not within min/max boundaries" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7353 | -S "Protocol is TLSv1.0" |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7354 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7355 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7356 | 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] | 7357 | "$P_SRV" \ |
| 7358 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 7359 | 1 \ |
| 7360 | -s "Handshake protocol not within min/max boundaries" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7361 | -S "Protocol is TLSv1.1" |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7362 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7363 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7364 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7365 | 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] | 7366 | "$P_SRV" \ |
| 7367 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7368 | 1 \ |
| 7369 | -s "Handshake protocol not within min/max boundaries" \ |
| 7370 | -S "Protocol is TLSv1.2" |
| 7371 | |
| 7372 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7373 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7374 | 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] | 7375 | "$P_SRV" \ |
| 7376 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7377 | 1 \ |
| 7378 | -S "Handshake protocol not within min/max boundaries" \ |
| 7379 | -s "The handshake negotiation failed" \ |
| 7380 | -S "Protocol is TLSv1.3" |
| 7381 | |
| 7382 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7383 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7384 | 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] | 7385 | "$P_SRV min_version=tls13" \ |
| 7386 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7387 | 1 \ |
| 7388 | -s "Handshake protocol not within min/max boundaries" \ |
| 7389 | -S "Protocol is TLSv1.2" |
| 7390 | |
| 7391 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7392 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7393 | 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] | 7394 | "$P_SRV max_version=tls12" \ |
| 7395 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7396 | 1 \ |
| 7397 | -S "Handshake protocol not within min/max boundaries" \ |
| 7398 | -s "The handshake negotiation failed" \ |
| 7399 | -S "Protocol is TLSv1.3" |
| 7400 | |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7401 | # Tests of version negotiation on server side against OpenSSL client |
| 7402 | |
| 7403 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_2 |
| 7404 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7405 | 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] | 7406 | "$P_SRV" \ |
| 7407 | "$O_NEXT_CLI -tls1_2" \ |
| 7408 | 0 \ |
| 7409 | -S "mbedtls_ssl_handshake returned" \ |
| 7410 | -s "Protocol is TLSv1.2" |
| 7411 | |
| 7412 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7413 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7414 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7415 | 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] | 7416 | "$P_SRV max_version=tls12" \ |
| 7417 | "$O_NEXT_CLI -tls1_2" \ |
| 7418 | 0 \ |
| 7419 | -S "mbedtls_ssl_handshake returned" \ |
| 7420 | -s "Protocol is TLSv1.2" |
| 7421 | |
| 7422 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7423 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7424 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7425 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7426 | 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] | 7427 | "$P_SRV" \ |
| 7428 | "$O_NEXT_CLI -tls1_3" \ |
| 7429 | 0 \ |
| 7430 | -S "mbedtls_ssl_handshake returned" \ |
| 7431 | -s "Protocol is TLSv1.3" |
| 7432 | |
| 7433 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7434 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7435 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7436 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7437 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7438 | 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] | 7439 | "$P_SRV min_version=tls13" \ |
| 7440 | "$O_NEXT_CLI -tls1_3" \ |
| 7441 | 0 \ |
| 7442 | -S "mbedtls_ssl_handshake returned" \ |
| 7443 | -s "Protocol is TLSv1.3" |
| 7444 | |
| 7445 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7446 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7447 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7448 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7449 | 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] | 7450 | "$P_SRV" \ |
| 7451 | "$O_NEXT_CLI" \ |
| 7452 | 0 \ |
| 7453 | -S "mbedtls_ssl_handshake returned" \ |
| 7454 | -s "Protocol is TLSv1.3" |
| 7455 | |
| 7456 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7457 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7458 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7459 | 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] | 7460 | "$P_SRV" \ |
| 7461 | "$O_NEXT_CLI -no_middlebox" \ |
| 7462 | 0 \ |
| 7463 | -S "mbedtls_ssl_handshake returned" \ |
| 7464 | -s "Protocol is TLSv1.3" |
| 7465 | |
| 7466 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7467 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7468 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7469 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7470 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7471 | 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] | 7472 | "$P_SRV min_version=tls13" \ |
| 7473 | "$O_NEXT_CLI" \ |
| 7474 | 0 \ |
| 7475 | -S "mbedtls_ssl_handshake returned" \ |
| 7476 | -s "Protocol is TLSv1.3" |
| 7477 | |
| 7478 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7479 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7480 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7481 | 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] | 7482 | "$P_SRV" \ |
| 7483 | "$O_NEXT_CLI" \ |
| 7484 | 0 \ |
| 7485 | -S "mbedtls_ssl_handshake returned" \ |
| 7486 | -s "Protocol is TLSv1.2" |
| 7487 | |
| 7488 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7489 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7490 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7491 | run_test "Server version nego O->m: cli 1.2+1.3, srv max=1.2 -> 1.2" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7492 | "$P_SRV max_version=tls12" \ |
| 7493 | "$O_NEXT_CLI" \ |
| 7494 | 0 \ |
| 7495 | -S "mbedtls_ssl_handshake returned" \ |
| 7496 | -s "Protocol is TLSv1.2" |
| 7497 | |
| 7498 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7499 | run_test "Not supported version O->m: cli 1.0, srv (1.2)+(1.3)" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7500 | "$P_SRV" \ |
| 7501 | "$O_CLI -tls1" \ |
| 7502 | 1 \ |
| 7503 | -s "Handshake protocol not within min/max boundaries" \ |
| 7504 | -S "Protocol is TLSv1.0" |
| 7505 | |
| 7506 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7507 | 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] | 7508 | "$P_SRV" \ |
| 7509 | "$O_CLI -tls1_1" \ |
| 7510 | 1 \ |
| 7511 | -s "Handshake protocol not within min/max boundaries" \ |
| 7512 | -S "Protocol is TLSv1.1" |
| 7513 | |
| 7514 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7515 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7516 | 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] | 7517 | "$P_SRV" \ |
| 7518 | "$O_NEXT_CLI -tls1_2" \ |
| 7519 | 1 \ |
| 7520 | -s "Handshake protocol not within min/max boundaries" \ |
| 7521 | -S "Protocol is TLSv1.2" |
| 7522 | |
| 7523 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7524 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7525 | 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] | 7526 | "$P_SRV" \ |
| 7527 | "$O_NEXT_CLI -tls1_3" \ |
| 7528 | 1 \ |
| 7529 | -S "Handshake protocol not within min/max boundaries" \ |
| 7530 | -s "The handshake negotiation failed" \ |
| 7531 | -S "Protocol is TLSv1.3" |
| 7532 | |
| 7533 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7534 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7535 | 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] | 7536 | "$P_SRV min_version=tls13" \ |
| 7537 | "$O_NEXT_CLI -tls1_2" \ |
| 7538 | 1 \ |
| 7539 | -s "Handshake protocol not within min/max boundaries" \ |
| 7540 | -S "Protocol is TLSv1.2" |
| 7541 | |
| 7542 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7543 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7544 | 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] | 7545 | "$P_SRV max_version=tls12" \ |
| 7546 | "$O_NEXT_CLI -tls1_3" \ |
| 7547 | 1 \ |
| 7548 | -S "Handshake protocol not within min/max boundaries" \ |
| 7549 | -s "The handshake negotiation failed" \ |
| 7550 | -S "Protocol is TLSv1.3" |
| 7551 | |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7552 | # Tests of version negotiation on client side against GnuTLS and OpenSSL server |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7553 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7554 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7555 | run_test "Not supported version: srv max TLS 1.0" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7556 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 7557 | "$P_CLI" \ |
| 7558 | 1 \ |
| 7559 | -s "Error in protocol version" \ |
| 7560 | -c "Handshake protocol not within min/max boundaries" \ |
| 7561 | -S "Version: TLS1.0" \ |
| 7562 | -C "Protocol is TLSv1.0" |
| 7563 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7565 | run_test "Not supported version: srv max TLS 1.1" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7566 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 7567 | "$P_CLI" \ |
| 7568 | 1 \ |
| 7569 | -s "Error in protocol version" \ |
| 7570 | -c "Handshake protocol not within min/max boundaries" \ |
| 7571 | -S "Version: TLS1.1" \ |
| 7572 | -C "Protocol is TLSv1.1" |
| 7573 | |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7574 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7575 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7576 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7577 | skip_handshake_stage_check |
| 7578 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7579 | 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] | 7580 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \ |
| 7581 | "$P_CLI debug_level=4" \ |
| 7582 | 1 \ |
| 7583 | -s "Client's version: 3.3" \ |
| 7584 | -S "Version: TLS1.0" \ |
| 7585 | -C "Protocol is TLSv1.0" |
| 7586 | |
| 7587 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7588 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7589 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7590 | skip_handshake_stage_check |
| 7591 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7592 | 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] | 7593 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \ |
| 7594 | "$P_CLI debug_level=4" \ |
| 7595 | 1 \ |
| 7596 | -s "Client's version: 3.3" \ |
| 7597 | -S "Version: TLS1.1" \ |
| 7598 | -C "Protocol is TLSv1.1" |
| 7599 | |
| 7600 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7601 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7602 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7603 | skip_handshake_stage_check |
| 7604 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7605 | 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] | 7606 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \ |
| 7607 | "$P_CLI force_version=tls13 debug_level=4" \ |
| 7608 | 1 \ |
| 7609 | -s "Client's version: 3.3" \ |
| 7610 | -c "is a fatal alert message (msg 40)" \ |
| 7611 | -S "Version: TLS1.2" \ |
| 7612 | -C "Protocol is TLSv1.2" |
| 7613 | |
| 7614 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7615 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7616 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7617 | skip_handshake_stage_check |
| 7618 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7619 | 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] | 7620 | "$O_NEXT_SRV -msg -tls1" \ |
| 7621 | "$P_CLI debug_level=4" \ |
| 7622 | 1 \ |
| 7623 | -s "fatal protocol_version" \ |
| 7624 | -c "is a fatal alert message (msg 70)" \ |
| 7625 | -S "Version: TLS1.0" \ |
| 7626 | -C "Protocol : TLSv1.0" |
| 7627 | |
| 7628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7629 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7630 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7631 | skip_handshake_stage_check |
| 7632 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7633 | 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] | 7634 | "$O_NEXT_SRV -msg -tls1_1" \ |
| 7635 | "$P_CLI debug_level=4" \ |
| 7636 | 1 \ |
| 7637 | -s "fatal protocol_version" \ |
| 7638 | -c "is a fatal alert message (msg 70)" \ |
| 7639 | -S "Version: TLS1.1" \ |
| 7640 | -C "Protocol : TLSv1.1" |
| 7641 | |
| 7642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7643 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7644 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7645 | skip_handshake_stage_check |
| 7646 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7647 | 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] | 7648 | "$O_NEXT_SRV -msg -tls1_2" \ |
| 7649 | "$P_CLI force_version=tls13 debug_level=4" \ |
| 7650 | 1 \ |
| 7651 | -s "fatal protocol_version" \ |
| 7652 | -c "is a fatal alert message (msg 70)" \ |
| 7653 | -S "Version: TLS1.2" \ |
| 7654 | -C "Protocol : TLSv1.2" |
| 7655 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7656 | # Tests for ALPN extension |
| 7657 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7658 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7659 | "$P_SRV debug_level=3" \ |
| 7660 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7661 | 0 \ |
| 7662 | -C "client hello, adding alpn extension" \ |
| 7663 | -S "found alpn extension" \ |
| 7664 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7665 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7666 | -C "found alpn extension " \ |
| 7667 | -C "Application Layer Protocol is" \ |
| 7668 | -S "Application Layer Protocol is" |
| 7669 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7670 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7671 | "$P_SRV debug_level=3" \ |
| 7672 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7673 | 0 \ |
| 7674 | -c "client hello, adding alpn extension" \ |
| 7675 | -s "found alpn extension" \ |
| 7676 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7677 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7678 | -C "found alpn extension " \ |
| 7679 | -c "Application Layer Protocol is (none)" \ |
| 7680 | -S "Application Layer Protocol is" |
| 7681 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7682 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7683 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7684 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7685 | 0 \ |
| 7686 | -C "client hello, adding alpn extension" \ |
| 7687 | -S "found alpn extension" \ |
| 7688 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7689 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7690 | -C "found alpn extension " \ |
| 7691 | -C "Application Layer Protocol is" \ |
| 7692 | -s "Application Layer Protocol is (none)" |
| 7693 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7694 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7695 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7696 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7697 | 0 \ |
| 7698 | -c "client hello, adding alpn extension" \ |
| 7699 | -s "found alpn extension" \ |
| 7700 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7701 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7702 | -c "found alpn extension" \ |
| 7703 | -c "Application Layer Protocol is abc" \ |
| 7704 | -s "Application Layer Protocol is abc" |
| 7705 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7706 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7707 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7708 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7709 | 0 \ |
| 7710 | -c "client hello, adding alpn extension" \ |
| 7711 | -s "found alpn extension" \ |
| 7712 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7713 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7714 | -c "found alpn extension" \ |
| 7715 | -c "Application Layer Protocol is abc" \ |
| 7716 | -s "Application Layer Protocol is abc" |
| 7717 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7718 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7719 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7720 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7721 | 0 \ |
| 7722 | -c "client hello, adding alpn extension" \ |
| 7723 | -s "found alpn extension" \ |
| 7724 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7725 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7726 | -c "found alpn extension" \ |
| 7727 | -c "Application Layer Protocol is 1234" \ |
| 7728 | -s "Application Layer Protocol is 1234" |
| 7729 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7730 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7731 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 7732 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7733 | 1 \ |
| 7734 | -c "client hello, adding alpn extension" \ |
| 7735 | -s "found alpn extension" \ |
| 7736 | -c "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7737 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7738 | -C "found alpn extension" \ |
| 7739 | -C "Application Layer Protocol is 1234" \ |
| 7740 | -S "Application Layer Protocol is 1234" |
| 7741 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 7742 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7743 | # Tests for keyUsage in leaf certificates, part 1: |
| 7744 | # server-side certificate/suite selection |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7745 | # |
| 7746 | # This is only about 1.2 (for 1.3, all key exchanges use signatures). |
| 7747 | # In 4.0 this will probably go away as all TLS 1.2 key exchanges will use |
| 7748 | # signatures too, following the removal of RSA #8170 and static ECDH #9201. |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7749 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7750 | run_test "keyUsage srv 1.2: RSA, digitalSignature -> (EC)DHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7751 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7752 | crt_file=$DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7753 | "$P_CLI" \ |
| 7754 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 7755 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7756 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7757 | run_test "keyUsage srv 1.2: RSA, keyEncipherment -> RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7758 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7759 | crt_file=$DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7760 | "$P_CLI" \ |
| 7761 | 0 \ |
| 7762 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 7763 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7764 | run_test "keyUsage srv 1.2: RSA, keyAgreement -> fail" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7765 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7766 | crt_file=$DATA_FILES_PATH/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 7767 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7768 | 1 \ |
| 7769 | -C "Ciphersuite is " |
| 7770 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 7771 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7772 | run_test "keyUsage srv 1.2: ECC, digitalSignature -> ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7773 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7774 | crt_file=$DATA_FILES_PATH/server5.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7775 | "$P_CLI" \ |
| 7776 | 0 \ |
| 7777 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 7778 | |
| 7779 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7780 | run_test "keyUsage srv 1.2: ECC, keyAgreement -> ECDH-" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7781 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7782 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7783 | "$P_CLI" \ |
| 7784 | 0 \ |
| 7785 | -c "Ciphersuite is TLS-ECDH-" |
| 7786 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7787 | run_test "keyUsage srv 1.2: ECC, keyEncipherment -> fail" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7788 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7789 | crt_file=$DATA_FILES_PATH/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 7790 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7791 | 1 \ |
| 7792 | -C "Ciphersuite is " |
| 7793 | |
| 7794 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7795 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7796 | # |
| 7797 | # TLS 1.3 uses only signature, but for 1.2 it depends on the key exchange. |
| 7798 | # In 4.0 this will probably change as all TLS 1.2 key exchanges will use |
| 7799 | # signatures too, following the removal of RSA #8170 and static ECDH #9201. |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7800 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7801 | run_test "keyUsage cli 1.2: DigitalSignature+KeyEncipherment, RSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7802 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7803 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7804 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7805 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7806 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7807 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7808 | -C "Processing of the Certificate handshake message failed" \ |
| 7809 | -c "Ciphersuite is TLS-" |
| 7810 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7811 | run_test "keyUsage cli 1.2: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7812 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7813 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7814 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7815 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7816 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7817 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7818 | -C "Processing of the Certificate handshake message failed" \ |
| 7819 | -c "Ciphersuite is TLS-" |
| 7820 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7821 | run_test "keyUsage cli 1.2: KeyEncipherment, RSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7822 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7823 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7824 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7825 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7826 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7827 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7828 | -C "Processing of the Certificate handshake message failed" \ |
| 7829 | -c "Ciphersuite is TLS-" |
| 7830 | |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7831 | run_test "keyUsage cli 1.2: KeyEncipherment, DHE-RSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7832 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7833 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7834 | "$P_CLI debug_level=3 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7835 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7836 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7837 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7838 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7839 | -C "Ciphersuite is TLS-" \ |
| 7840 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7841 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7842 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7843 | |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7844 | run_test "keyUsage cli 1.2: KeyEncipherment, DHE-RSA: fail (soft)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7845 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7846 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7847 | "$P_CLI debug_level=3 auth_mode=optional \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7848 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7849 | 0 \ |
| 7850 | -c "bad certificate (usage extensions)" \ |
| 7851 | -C "Processing of the Certificate handshake message failed" \ |
| 7852 | -c "Ciphersuite is TLS-" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7853 | -C "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7854 | -c "! Usage does not match the keyUsage extension" |
| 7855 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7856 | run_test "keyUsage cli 1.2: DigitalSignature, DHE-RSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7857 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7858 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7859 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7860 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7861 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7862 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7863 | -C "Processing of the Certificate handshake message failed" \ |
| 7864 | -c "Ciphersuite is TLS-" |
| 7865 | |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7866 | run_test "keyUsage cli 1.2: DigitalSignature, RSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7867 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7868 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7869 | "$P_CLI debug_level=3 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7870 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7871 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7872 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7873 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7874 | -C "Ciphersuite is TLS-" \ |
| 7875 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7876 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7877 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7878 | |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7879 | run_test "keyUsage cli 1.2: DigitalSignature, RSA: fail (soft)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7880 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7881 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7882 | "$P_CLI debug_level=3 auth_mode=optional \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7883 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7884 | 0 \ |
| 7885 | -c "bad certificate (usage extensions)" \ |
| 7886 | -C "Processing of the Certificate handshake message failed" \ |
| 7887 | -c "Ciphersuite is TLS-" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7888 | -C "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7889 | -c "! Usage does not match the keyUsage extension" |
| 7890 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7891 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7892 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7893 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7894 | run_test "keyUsage cli 1.3: DigitalSignature, RSA: OK" \ |
| 7895 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7896 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds.crt" \ |
| 7897 | "$P_CLI debug_level=3" \ |
| 7898 | 0 \ |
| 7899 | -C "bad certificate (usage extensions)" \ |
| 7900 | -C "Processing of the Certificate handshake message failed" \ |
| 7901 | -c "Ciphersuite is" |
| 7902 | |
| 7903 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7904 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7905 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7906 | run_test "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7907 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7908 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds_ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7909 | "$P_CLI debug_level=3" \ |
| 7910 | 0 \ |
| 7911 | -C "bad certificate (usage extensions)" \ |
| 7912 | -C "Processing of the Certificate handshake message failed" \ |
| 7913 | -c "Ciphersuite is" |
| 7914 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7915 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7916 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7917 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7918 | run_test "keyUsage cli 1.3: KeyEncipherment, RSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7919 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7920 | -cert $DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7921 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7922 | 1 \ |
| 7923 | -c "bad certificate (usage extensions)" \ |
| 7924 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7925 | -C "Ciphersuite is" \ |
| 7926 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7927 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7928 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7929 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7930 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7931 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7932 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7933 | run_test "keyUsage cli 1.3: KeyAgreement, RSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7934 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7935 | -cert $DATA_FILES_PATH/server2-sha256.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7936 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7937 | 1 \ |
| 7938 | -c "bad certificate (usage extensions)" \ |
| 7939 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7940 | -C "Ciphersuite is" \ |
| 7941 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7942 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7943 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7944 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7945 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7946 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7947 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7948 | run_test "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7949 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 7950 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7951 | "$P_CLI debug_level=3" \ |
| 7952 | 0 \ |
| 7953 | -C "bad certificate (usage extensions)" \ |
| 7954 | -C "Processing of the Certificate handshake message failed" \ |
| 7955 | -c "Ciphersuite is" |
| 7956 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7957 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7958 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7959 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7960 | run_test "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7961 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 7962 | -cert $DATA_FILES_PATH/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7963 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7964 | 1 \ |
| 7965 | -c "bad certificate (usage extensions)" \ |
| 7966 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7967 | -C "Ciphersuite is" \ |
| 7968 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7969 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7970 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7971 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7972 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7973 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7974 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7975 | run_test "keyUsage cli 1.3: KeyAgreement, ECDSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7976 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 7977 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7978 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7979 | 1 \ |
| 7980 | -c "bad certificate (usage extensions)" \ |
| 7981 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7982 | -C "Ciphersuite is" \ |
| 7983 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7984 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7985 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7986 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7987 | # Tests for keyUsage in leaf certificates, part 3: |
| 7988 | # server-side checking of client cert |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7989 | # |
| 7990 | # Here, both 1.2 and 1.3 only use signatures. |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7991 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7992 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7993 | run_test "keyUsage cli-auth 1.2: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7994 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7995 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7996 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7997 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 7998 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7999 | -S "bad certificate (usage extensions)" \ |
| 8000 | -S "Processing of the Certificate handshake message failed" |
| 8001 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8002 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8003 | run_test "keyUsage cli-auth 1.2: RSA, DigitalSignature+KeyEncipherment: OK" \ |
| 8004 | "$P_SRV debug_level=1 auth_mode=optional" \ |
| 8005 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8006 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
| 8007 | 0 \ |
| 8008 | -s "Verifying peer X.509 certificate... ok" \ |
| 8009 | -S "bad certificate (usage extensions)" \ |
| 8010 | -S "Processing of the Certificate handshake message failed" |
| 8011 | |
| 8012 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8013 | run_test "keyUsage cli-auth 1.2: RSA, KeyEncipherment: fail (soft)" \ |
| 8014 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8015 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8016 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8017 | 0 \ |
| 8018 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8019 | -S "send alert level=2 message=43" \ |
| 8020 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8021 | -S "Processing of the Certificate handshake message failed" |
| 8022 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8023 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8024 | run_test "keyUsage cli-auth 1.2: RSA, KeyEncipherment: fail (hard)" \ |
| 8025 | "$P_SRV debug_level=3 force_version=tls12 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8026 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8027 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8028 | 1 \ |
| 8029 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8030 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8031 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8032 | -s "Processing of the Certificate handshake message failed" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8033 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8034 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8035 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8036 | run_test "keyUsage cli-auth 1.2: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8037 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8038 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8039 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8040 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8041 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8042 | -S "bad certificate (usage extensions)" \ |
| 8043 | -S "Processing of the Certificate handshake message failed" |
| 8044 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8045 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8046 | run_test "keyUsage cli-auth 1.2: ECDSA, KeyAgreement: fail (soft)" \ |
| 8047 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8048 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8049 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8050 | 0 \ |
| 8051 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8052 | -S "send alert level=2 message=43" \ |
| 8053 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8054 | -S "Processing of the Certificate handshake message failed" |
| 8055 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8056 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8057 | run_test "keyUsage cli-auth 1.2: ECDSA, KeyAgreement: fail (hard)" \ |
| 8058 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 8059 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8060 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
| 8061 | 1 \ |
| 8062 | -s "bad certificate (usage extensions)" \ |
| 8063 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8064 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8065 | -s "Processing of the Certificate handshake message failed" |
| 8066 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8067 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8068 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8069 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8070 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8071 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8072 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8073 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
| 8074 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8075 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8076 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8077 | -S "bad certificate (usage extensions)" \ |
| 8078 | -S "Processing of the Certificate handshake message failed" |
| 8079 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8080 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8081 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8082 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8083 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature+KeyEncipherment: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8084 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8085 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8086 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds_ke.crt" \ |
| 8087 | 0 \ |
| 8088 | -s "Verifying peer X.509 certificate... ok" \ |
| 8089 | -S "bad certificate (usage extensions)" \ |
| 8090 | -S "Processing of the Certificate handshake message failed" |
| 8091 | |
| 8092 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 8093 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8094 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 8095 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ |
| 8096 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
| 8097 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8098 | -cert $DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8099 | 0 \ |
| 8100 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8101 | -S "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8102 | -s "! Usage does not match the keyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8103 | -S "Processing of the Certificate handshake message failed" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8104 | |
| 8105 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 8106 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8107 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 8108 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (hard)" \ |
| 8109 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=required" \ |
Manuel Pégourié-Gonnard | cdd5b07 | 2024-08-12 09:50:18 +0200 | [diff] [blame] | 8110 | "$P_CLI key_file=$DATA_FILES_PATH/server2.key \ |
| 8111 | crt_file=$DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
| 8112 | 1 \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8113 | -s "bad certificate (usage extensions)" \ |
| 8114 | -s "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8115 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8116 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8117 | -s "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8118 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8119 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8120 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8121 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8122 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8123 | run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8124 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8125 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8126 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8127 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8128 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8129 | -S "bad certificate (usage extensions)" \ |
| 8130 | -S "Processing of the Certificate handshake message failed" |
| 8131 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8132 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8133 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8134 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8135 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8136 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8137 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8138 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8139 | 0 \ |
| 8140 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8141 | -s "! Usage does not match the keyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8142 | -S "Processing of the Certificate handshake message failed" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8143 | |
| 8144 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 8145 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8146 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 8147 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (hard)" \ |
| 8148 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=required" \ |
Manuel Pégourié-Gonnard | cdd5b07 | 2024-08-12 09:50:18 +0200 | [diff] [blame] | 8149 | "$P_CLI key_file=$DATA_FILES_PATH/server5.key \ |
| 8150 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
| 8151 | 1 \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8152 | -s "bad certificate (usage extensions)" \ |
| 8153 | -s "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8154 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8155 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8156 | -s "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8157 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8158 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8159 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 8160 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8161 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8162 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8163 | crt_file=$DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8164 | "$P_CLI" \ |
| 8165 | 0 |
| 8166 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8167 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8168 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8169 | crt_file=$DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8170 | "$P_CLI" \ |
| 8171 | 0 |
| 8172 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8173 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8174 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8175 | crt_file=$DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8176 | "$P_CLI" \ |
| 8177 | 0 |
| 8178 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8179 | run_test "extKeyUsage srv: codeSign -> fail" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8180 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8181 | crt_file=$DATA_FILES_PATH/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 8182 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8183 | 1 |
| 8184 | |
| 8185 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 8186 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8187 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8188 | run_test "extKeyUsage cli 1.2: serverAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8189 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8190 | -cert $DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8191 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8192 | 0 \ |
| 8193 | -C "bad certificate (usage extensions)" \ |
| 8194 | -C "Processing of the Certificate handshake message failed" \ |
| 8195 | -c "Ciphersuite is TLS-" |
| 8196 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8197 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8198 | run_test "extKeyUsage cli 1.2: serverAuth,clientAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8199 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8200 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8201 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8202 | 0 \ |
| 8203 | -C "bad certificate (usage extensions)" \ |
| 8204 | -C "Processing of the Certificate handshake message failed" \ |
| 8205 | -c "Ciphersuite is TLS-" |
| 8206 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8207 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8208 | run_test "extKeyUsage cli 1.2: codeSign,anyEKU -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8209 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8210 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8211 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8212 | 0 \ |
| 8213 | -C "bad certificate (usage extensions)" \ |
| 8214 | -C "Processing of the Certificate handshake message failed" \ |
| 8215 | -c "Ciphersuite is TLS-" |
| 8216 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8217 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 04db1fb | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8218 | run_test "extKeyUsage cli 1.2: codeSign -> fail (soft)" \ |
| 8219 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8220 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
| 8221 | "$P_CLI debug_level=3 auth_mode=optional" \ |
| 8222 | 0 \ |
| 8223 | -c "bad certificate (usage extensions)" \ |
| 8224 | -C "Processing of the Certificate handshake message failed" \ |
| 8225 | -c "Ciphersuite is TLS-" \ |
| 8226 | -C "send alert level=2 message=43" \ |
| 8227 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8228 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8229 | |
| 8230 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8231 | run_test "extKeyUsage cli 1.2: codeSign -> fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8232 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8233 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8234 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8235 | 1 \ |
| 8236 | -c "bad certificate (usage extensions)" \ |
| 8237 | -c "Processing of the Certificate handshake message failed" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8238 | -C "Ciphersuite is TLS-" \ |
| 8239 | -c "send alert level=2 message=43" \ |
| 8240 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8241 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8242 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8243 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8244 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8245 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8246 | run_test "extKeyUsage cli 1.3: serverAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8247 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8248 | -cert $DATA_FILES_PATH/server5.eku-srv.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8249 | "$P_CLI debug_level=1" \ |
| 8250 | 0 \ |
| 8251 | -C "bad certificate (usage extensions)" \ |
| 8252 | -C "Processing of the Certificate handshake message failed" \ |
| 8253 | -c "Ciphersuite is" |
| 8254 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8255 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8256 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8257 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8258 | run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8259 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8260 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8261 | "$P_CLI debug_level=1" \ |
| 8262 | 0 \ |
| 8263 | -C "bad certificate (usage extensions)" \ |
| 8264 | -C "Processing of the Certificate handshake message failed" \ |
| 8265 | -c "Ciphersuite is" |
| 8266 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8267 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8268 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8269 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8270 | run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8271 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8272 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8273 | "$P_CLI debug_level=1" \ |
| 8274 | 0 \ |
| 8275 | -C "bad certificate (usage extensions)" \ |
| 8276 | -C "Processing of the Certificate handshake message failed" \ |
| 8277 | -c "Ciphersuite is" |
| 8278 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8279 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8280 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8281 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8282 | run_test "extKeyUsage cli 1.3: codeSign -> fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8283 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8284 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8285 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8286 | 1 \ |
| 8287 | -c "bad certificate (usage extensions)" \ |
| 8288 | -c "Processing of the Certificate handshake message failed" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8289 | -C "Ciphersuite is" \ |
| 8290 | -c "send alert level=2 message=43" \ |
| 8291 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8292 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8293 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8294 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 8295 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8296 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8297 | run_test "extKeyUsage cli-auth 1.2: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8298 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8299 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8300 | -cert $DATA_FILES_PATH/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8301 | 0 \ |
| 8302 | -S "bad certificate (usage extensions)" \ |
| 8303 | -S "Processing of the Certificate handshake message failed" |
| 8304 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8305 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8306 | run_test "extKeyUsage cli-auth 1.2: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8307 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8308 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8309 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8310 | 0 \ |
| 8311 | -S "bad certificate (usage extensions)" \ |
| 8312 | -S "Processing of the Certificate handshake message failed" |
| 8313 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8314 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8315 | run_test "extKeyUsage cli-auth 1.2: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8316 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8317 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8318 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8319 | 0 \ |
| 8320 | -S "bad certificate (usage extensions)" \ |
| 8321 | -S "Processing of the Certificate handshake message failed" |
| 8322 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8323 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8324 | run_test "extKeyUsage cli-auth 1.2: codeSign -> fail (soft)" \ |
| 8325 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8326 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8327 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8328 | 0 \ |
| 8329 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8330 | -S "send alert level=2 message=43" \ |
| 8331 | -s "! Usage does not match the extendedKeyUsage extension" \ |
| 8332 | -S "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8333 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8334 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8335 | run_test "extKeyUsage cli-auth 1.2: codeSign -> fail (hard)" \ |
| 8336 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8337 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8338 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8339 | 1 \ |
| 8340 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8341 | -s "send alert level=2 message=43" \ |
| 8342 | -s "! Usage does not match the extendedKeyUsage extension" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8343 | -s "Processing of the Certificate handshake message failed" |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8344 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8345 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8346 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8347 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8348 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8349 | run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8350 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8351 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8352 | -cert $DATA_FILES_PATH/server5.eku-cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8353 | 0 \ |
| 8354 | -S "bad certificate (usage extensions)" \ |
| 8355 | -S "Processing of the Certificate handshake message failed" |
| 8356 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8357 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8358 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8359 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8360 | run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8361 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8362 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8363 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8364 | 0 \ |
| 8365 | -S "bad certificate (usage extensions)" \ |
| 8366 | -S "Processing of the Certificate handshake message failed" |
| 8367 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8368 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8369 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8370 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8371 | run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8372 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8373 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8374 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8375 | 0 \ |
| 8376 | -S "bad certificate (usage extensions)" \ |
| 8377 | -S "Processing of the Certificate handshake message failed" |
| 8378 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8379 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8380 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8381 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8382 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8383 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8384 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8385 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8386 | 0 \ |
| 8387 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8388 | -S "send alert level=2 message=43" \ |
| 8389 | -s "! Usage does not match the extendedKeyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8390 | -S "Processing of the Certificate handshake message failed" |
| 8391 | |
Elena Uziunaite | 04db1fb | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8392 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 8393 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8394 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 8395 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (hard)" \ |
| 8396 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=required" \ |
| 8397 | "$P_CLI key_file=$DATA_FILES_PATH/server5.key \ |
| 8398 | crt_file=$DATA_FILES_PATH/server5.eku-cs.crt" \ |
| 8399 | 1 \ |
| 8400 | -s "bad certificate (usage extensions)" \ |
| 8401 | -s "send alert level=2 message=43" \ |
| 8402 | -s "! Usage does not match the extendedKeyUsage extension" \ |
| 8403 | -s "Processing of the Certificate handshake message failed" |
| 8404 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8405 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8406 | # Tests for DHM parameters loading |
| 8407 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8408 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8409 | "$P_SRV" \ |
| 8410 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8411 | debug_level=3" \ |
| 8412 | 0 \ |
| 8413 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 8414 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8415 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8416 | run_test "DHM parameters: other parameters" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8417 | "$P_SRV dhm_file=$DATA_FILES_PATH/dhparams.pem" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8418 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8419 | debug_level=3" \ |
| 8420 | 0 \ |
| 8421 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 8422 | -c "value of 'DHM: G ' (2 bits)" |
| 8423 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8424 | # Tests for DHM client-side size checking |
| 8425 | |
| 8426 | run_test "DHM size: server default, client default, OK" \ |
| 8427 | "$P_SRV" \ |
| 8428 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8429 | debug_level=1" \ |
| 8430 | 0 \ |
| 8431 | -C "DHM prime too short:" |
| 8432 | |
| 8433 | run_test "DHM size: server default, client 2048, OK" \ |
| 8434 | "$P_SRV" \ |
| 8435 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8436 | debug_level=1 dhmlen=2048" \ |
| 8437 | 0 \ |
| 8438 | -C "DHM prime too short:" |
| 8439 | |
| 8440 | run_test "DHM size: server 1024, client default, OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8441 | "$P_SRV dhm_file=$DATA_FILES_PATH/dhparams.pem" \ |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8442 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8443 | debug_level=1" \ |
| 8444 | 0 \ |
| 8445 | -C "DHM prime too short:" |
| 8446 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8447 | run_test "DHM size: server 999, client 999, OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8448 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.999.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8449 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8450 | debug_level=1 dhmlen=999" \ |
| 8451 | 0 \ |
| 8452 | -C "DHM prime too short:" |
| 8453 | |
| 8454 | run_test "DHM size: server 1000, client 1000, OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8455 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8456 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8457 | debug_level=1 dhmlen=1000" \ |
| 8458 | 0 \ |
| 8459 | -C "DHM prime too short:" |
| 8460 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8461 | run_test "DHM size: server 1000, client default, rejected" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8462 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8463 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8464 | debug_level=1" \ |
| 8465 | 1 \ |
| 8466 | -c "DHM prime too short:" |
| 8467 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8468 | run_test "DHM size: server 1000, client 1001, rejected" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8469 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8470 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8471 | debug_level=1 dhmlen=1001" \ |
| 8472 | 1 \ |
| 8473 | -c "DHM prime too short:" |
| 8474 | |
| 8475 | run_test "DHM size: server 999, client 1000, rejected" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8476 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.999.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8477 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8478 | debug_level=1 dhmlen=1000" \ |
| 8479 | 1 \ |
| 8480 | -c "DHM prime too short:" |
| 8481 | |
| 8482 | run_test "DHM size: server 998, client 999, rejected" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8483 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.998.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8484 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8485 | debug_level=1 dhmlen=999" \ |
| 8486 | 1 \ |
| 8487 | -c "DHM prime too short:" |
| 8488 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8489 | run_test "DHM size: server default, client 2049, rejected" \ |
| 8490 | "$P_SRV" \ |
| 8491 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8492 | debug_level=1 dhmlen=2049" \ |
| 8493 | 1 \ |
| 8494 | -c "DHM prime too short:" |
| 8495 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8496 | # Tests for PSK callback |
| 8497 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8498 | run_test "PSK callback: psk, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8499 | "$P_SRV psk=73776f726466697368 psk_identity=foo" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8500 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8501 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8502 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8503 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 8504 | -S "SSL - Unknown identity received" \ |
| 8505 | -S "SSL - Verification of the message MAC failed" |
| 8506 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8507 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8508 | run_test "PSK callback: opaque psk on client, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8509 | "$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] | 8510 | "$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] | 8511 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8512 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8513 | -C "session hash for extended master secret"\ |
| 8514 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8515 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8516 | -S "SSL - Unknown identity received" \ |
| 8517 | -S "SSL - Verification of the message MAC failed" |
| 8518 | |
| 8519 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8520 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8521 | "$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] | 8522 | "$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] | 8523 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8524 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8525 | -C "session hash for extended master secret"\ |
| 8526 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8527 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8528 | -S "SSL - Unknown identity received" \ |
| 8529 | -S "SSL - Verification of the message MAC failed" |
| 8530 | |
| 8531 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8532 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8533 | "$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] | 8534 | "$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] | 8535 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8536 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8537 | -c "session hash for extended master secret"\ |
| 8538 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8539 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8540 | -S "SSL - Unknown identity received" \ |
| 8541 | -S "SSL - Verification of the message MAC failed" |
| 8542 | |
| 8543 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8544 | 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] | 8545 | "$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] | 8546 | "$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] | 8547 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8548 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8549 | -c "session hash for extended master secret"\ |
| 8550 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8551 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8552 | -S "SSL - Unknown identity received" \ |
| 8553 | -S "SSL - Verification of the message MAC failed" |
| 8554 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8555 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8556 | run_test "PSK callback: opaque rsa-psk on client, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8557 | "$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] | 8558 | "$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] | 8559 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8560 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8561 | -C "session hash for extended master secret"\ |
| 8562 | -S "session hash for extended master secret"\ |
| 8563 | -S "SSL - The handshake negotiation failed" \ |
| 8564 | -S "SSL - Unknown identity received" \ |
| 8565 | -S "SSL - Verification of the message MAC failed" |
| 8566 | |
| 8567 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8568 | 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] | 8569 | "$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] | 8570 | "$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] | 8571 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8572 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8573 | -C "session hash for extended master secret"\ |
| 8574 | -S "session hash for extended master secret"\ |
| 8575 | -S "SSL - The handshake negotiation failed" \ |
| 8576 | -S "SSL - Unknown identity received" \ |
| 8577 | -S "SSL - Verification of the message MAC failed" |
| 8578 | |
| 8579 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8580 | run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8581 | "$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] | 8582 | "$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] | 8583 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8584 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8585 | -c "session hash for extended master secret"\ |
| 8586 | -s "session hash for extended master secret"\ |
| 8587 | -S "SSL - The handshake negotiation failed" \ |
| 8588 | -S "SSL - Unknown identity received" \ |
| 8589 | -S "SSL - Verification of the message MAC failed" |
| 8590 | |
| 8591 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8592 | 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] | 8593 | "$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] | 8594 | "$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] | 8595 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8596 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8597 | -c "session hash for extended master secret"\ |
| 8598 | -s "session hash for extended master secret"\ |
| 8599 | -S "SSL - The handshake negotiation failed" \ |
| 8600 | -S "SSL - Unknown identity received" \ |
| 8601 | -S "SSL - Verification of the message MAC failed" |
| 8602 | |
| 8603 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8604 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8605 | "$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] | 8606 | "$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] | 8607 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8608 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8609 | -C "session hash for extended master secret"\ |
| 8610 | -S "session hash for extended master secret"\ |
| 8611 | -S "SSL - The handshake negotiation failed" \ |
| 8612 | -S "SSL - Unknown identity received" \ |
| 8613 | -S "SSL - Verification of the message MAC failed" |
| 8614 | |
| 8615 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8616 | 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] | 8617 | "$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] | 8618 | "$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] | 8619 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8620 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8621 | -C "session hash for extended master secret"\ |
| 8622 | -S "session hash for extended master secret"\ |
| 8623 | -S "SSL - The handshake negotiation failed" \ |
| 8624 | -S "SSL - Unknown identity received" \ |
| 8625 | -S "SSL - Verification of the message MAC failed" |
| 8626 | |
| 8627 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8628 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8629 | "$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] | 8630 | "$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] | 8631 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8632 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8633 | -c "session hash for extended master secret"\ |
| 8634 | -s "session hash for extended master secret"\ |
| 8635 | -S "SSL - The handshake negotiation failed" \ |
| 8636 | -S "SSL - Unknown identity received" \ |
| 8637 | -S "SSL - Verification of the message MAC failed" |
| 8638 | |
| 8639 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8640 | 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] | 8641 | "$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] | 8642 | "$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] | 8643 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8644 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8645 | -c "session hash for extended master secret"\ |
| 8646 | -s "session hash for extended master secret"\ |
| 8647 | -S "SSL - The handshake negotiation failed" \ |
| 8648 | -S "SSL - Unknown identity received" \ |
| 8649 | -S "SSL - Verification of the message MAC failed" |
| 8650 | |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8651 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8652 | run_test "PSK callback: opaque dhe-psk on client, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8653 | "$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] | 8654 | "$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] | 8655 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8656 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8657 | -C "session hash for extended master secret"\ |
| 8658 | -S "session hash for extended master secret"\ |
| 8659 | -S "SSL - The handshake negotiation failed" \ |
| 8660 | -S "SSL - Unknown identity received" \ |
| 8661 | -S "SSL - Verification of the message MAC failed" |
| 8662 | |
| 8663 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8664 | 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] | 8665 | "$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] | 8666 | "$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] | 8667 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8668 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8669 | -C "session hash for extended master secret"\ |
| 8670 | -S "session hash for extended master secret"\ |
| 8671 | -S "SSL - The handshake negotiation failed" \ |
| 8672 | -S "SSL - Unknown identity received" \ |
| 8673 | -S "SSL - Verification of the message MAC failed" |
| 8674 | |
| 8675 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8676 | run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8677 | "$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] | 8678 | "$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] | 8679 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8680 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8681 | -c "session hash for extended master secret"\ |
| 8682 | -s "session hash for extended master secret"\ |
| 8683 | -S "SSL - The handshake negotiation failed" \ |
| 8684 | -S "SSL - Unknown identity received" \ |
| 8685 | -S "SSL - Verification of the message MAC failed" |
| 8686 | |
| 8687 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8688 | 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] | 8689 | "$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] | 8690 | "$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] | 8691 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8692 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8693 | -c "session hash for extended master secret"\ |
| 8694 | -s "session hash for extended master secret"\ |
| 8695 | -S "SSL - The handshake negotiation failed" \ |
| 8696 | -S "SSL - Unknown identity received" \ |
| 8697 | -S "SSL - Verification of the message MAC failed" |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8698 | |
| 8699 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8700 | 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] | 8701 | "$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] | 8702 | "$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] | 8703 | psk_identity=foo psk=73776f726466697368" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8704 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8705 | -C "session hash for extended master secret"\ |
| 8706 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8707 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8708 | -S "SSL - Unknown identity received" \ |
| 8709 | -S "SSL - Verification of the message MAC failed" |
| 8710 | |
| 8711 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8712 | 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] | 8713 | "$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] | 8714 | "$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] | 8715 | psk_identity=foo psk=73776f726466697368" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8716 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8717 | -C "session hash for extended master secret"\ |
| 8718 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8719 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8720 | -S "SSL - Unknown identity received" \ |
| 8721 | -S "SSL - Verification of the message MAC failed" |
| 8722 | |
| 8723 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8724 | 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] | 8725 | "$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] | 8726 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8727 | "$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] | 8728 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8729 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8730 | -c "session hash for extended master secret"\ |
| 8731 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8732 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8733 | -S "SSL - Unknown identity received" \ |
| 8734 | -S "SSL - Verification of the message MAC failed" |
| 8735 | |
| 8736 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8737 | 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] | 8738 | "$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] | 8739 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8740 | "$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] | 8741 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8742 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8743 | -c "session hash for extended master secret"\ |
| 8744 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8745 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8746 | -S "SSL - Unknown identity received" \ |
| 8747 | -S "SSL - Verification of the message MAC failed" |
| 8748 | |
| 8749 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8750 | 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] | 8751 | "$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] | 8752 | "$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] | 8753 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8754 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8755 | -C "session hash for extended master secret"\ |
| 8756 | -S "session hash for extended master secret"\ |
| 8757 | -S "SSL - The handshake negotiation failed" \ |
| 8758 | -S "SSL - Unknown identity received" \ |
| 8759 | -S "SSL - Verification of the message MAC failed" |
| 8760 | |
| 8761 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8762 | 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] | 8763 | "$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] | 8764 | "$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] | 8765 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8766 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8767 | -C "session hash for extended master secret"\ |
| 8768 | -S "session hash for extended master secret"\ |
| 8769 | -S "SSL - The handshake negotiation failed" \ |
| 8770 | -S "SSL - Unknown identity received" \ |
| 8771 | -S "SSL - Verification of the message MAC failed" |
| 8772 | |
| 8773 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8774 | 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] | 8775 | "$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] | 8776 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8777 | "$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] | 8778 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8779 | 0 \ |
| 8780 | -c "session hash for extended master secret"\ |
| 8781 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8782 | -S "SSL - The handshake negotiation failed" \ |
| 8783 | -S "SSL - Unknown identity received" \ |
| 8784 | -S "SSL - Verification of the message MAC failed" |
| 8785 | |
| 8786 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8787 | 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] | 8788 | "$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] | 8789 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8790 | "$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] | 8791 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8792 | 0 \ |
| 8793 | -c "session hash for extended master secret"\ |
| 8794 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8795 | -S "SSL - The handshake negotiation failed" \ |
| 8796 | -S "SSL - Unknown identity received" \ |
| 8797 | -S "SSL - Verification of the message MAC failed" |
| 8798 | |
| 8799 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8800 | 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] | 8801 | "$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] | 8802 | "$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] | 8803 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8804 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8805 | -C "session hash for extended master secret"\ |
| 8806 | -S "session hash for extended master secret"\ |
| 8807 | -S "SSL - The handshake negotiation failed" \ |
| 8808 | -S "SSL - Unknown identity received" \ |
| 8809 | -S "SSL - Verification of the message MAC failed" |
| 8810 | |
| 8811 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8812 | 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] | 8813 | "$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] | 8814 | "$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] | 8815 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8816 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8817 | -C "session hash for extended master secret"\ |
| 8818 | -S "session hash for extended master secret"\ |
| 8819 | -S "SSL - The handshake negotiation failed" \ |
| 8820 | -S "SSL - Unknown identity received" \ |
| 8821 | -S "SSL - Verification of the message MAC failed" |
| 8822 | |
| 8823 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8824 | 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] | 8825 | "$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] | 8826 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8827 | "$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] | 8828 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8829 | 0 \ |
| 8830 | -c "session hash for extended master secret"\ |
| 8831 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8832 | -S "SSL - The handshake negotiation failed" \ |
| 8833 | -S "SSL - Unknown identity received" \ |
| 8834 | -S "SSL - Verification of the message MAC failed" |
| 8835 | |
| 8836 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8837 | 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] | 8838 | "$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] | 8839 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8840 | "$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] | 8841 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8842 | 0 \ |
| 8843 | -c "session hash for extended master secret"\ |
| 8844 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8845 | -S "SSL - The handshake negotiation failed" \ |
| 8846 | -S "SSL - Unknown identity received" \ |
| 8847 | -S "SSL - Verification of the message MAC failed" |
| 8848 | |
| 8849 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8850 | 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] | 8851 | "$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] | 8852 | "$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] | 8853 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8854 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8855 | -C "session hash for extended master secret"\ |
| 8856 | -S "session hash for extended master secret"\ |
| 8857 | -S "SSL - The handshake negotiation failed" \ |
| 8858 | -S "SSL - Unknown identity received" \ |
| 8859 | -S "SSL - Verification of the message MAC failed" |
| 8860 | |
| 8861 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8862 | 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] | 8863 | "$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] | 8864 | "$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] | 8865 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8866 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8867 | -C "session hash for extended master secret"\ |
| 8868 | -S "session hash for extended master secret"\ |
| 8869 | -S "SSL - The handshake negotiation failed" \ |
| 8870 | -S "SSL - Unknown identity received" \ |
| 8871 | -S "SSL - Verification of the message MAC failed" |
| 8872 | |
| 8873 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8874 | 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] | 8875 | "$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] | 8876 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8877 | "$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] | 8878 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8879 | 0 \ |
| 8880 | -c "session hash for extended master secret"\ |
| 8881 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8882 | -S "SSL - The handshake negotiation failed" \ |
| 8883 | -S "SSL - Unknown identity received" \ |
| 8884 | -S "SSL - Verification of the message MAC failed" |
| 8885 | |
| 8886 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8887 | 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] | 8888 | "$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] | 8889 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8890 | "$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] | 8891 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8892 | 0 \ |
| 8893 | -c "session hash for extended master secret"\ |
| 8894 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8895 | -S "SSL - The handshake negotiation failed" \ |
| 8896 | -S "SSL - Unknown identity received" \ |
| 8897 | -S "SSL - Verification of the message MAC failed" |
| 8898 | |
| 8899 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8900 | 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] | 8901 | "$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" \ |
| 8902 | "$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] | 8903 | psk_identity=def psk=beef" \ |
| 8904 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8905 | -C "session hash for extended master secret"\ |
| 8906 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8907 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8908 | -S "SSL - Unknown identity received" \ |
| 8909 | -S "SSL - Verification of the message MAC failed" |
| 8910 | |
| 8911 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8912 | 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] | 8913 | "$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" \ |
| 8914 | "$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] | 8915 | psk_identity=def psk=beef" \ |
| 8916 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8917 | -C "session hash for extended master secret"\ |
| 8918 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8919 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8920 | -S "SSL - Unknown identity received" \ |
| 8921 | -S "SSL - Verification of the message MAC failed" |
| 8922 | |
| 8923 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8924 | 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] | 8925 | "$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] | 8926 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8927 | "$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] | 8928 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8929 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8930 | -c "session hash for extended master secret"\ |
| 8931 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8932 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8933 | -S "SSL - Unknown identity received" \ |
| 8934 | -S "SSL - Verification of the message MAC failed" |
| 8935 | |
| 8936 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8937 | 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] | 8938 | "$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] | 8939 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8940 | "$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] | 8941 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8942 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8943 | -c "session hash for extended master secret"\ |
| 8944 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8945 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8946 | -S "SSL - Unknown identity received" \ |
| 8947 | -S "SSL - Verification of the message MAC failed" |
| 8948 | |
| 8949 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8950 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ |
| 8951 | "$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" \ |
| 8952 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 8953 | psk_identity=def psk=beef" \ |
| 8954 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8955 | -C "session hash for extended master secret"\ |
| 8956 | -S "session hash for extended master secret"\ |
| 8957 | -S "SSL - The handshake negotiation failed" \ |
| 8958 | -S "SSL - Unknown identity received" \ |
| 8959 | -S "SSL - Verification of the message MAC failed" |
| 8960 | |
| 8961 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8962 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ |
| 8963 | "$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" \ |
| 8964 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 8965 | psk_identity=def psk=beef" \ |
| 8966 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8967 | -C "session hash for extended master secret"\ |
| 8968 | -S "session hash for extended master secret"\ |
| 8969 | -S "SSL - The handshake negotiation failed" \ |
| 8970 | -S "SSL - Unknown identity received" \ |
| 8971 | -S "SSL - Verification of the message MAC failed" |
| 8972 | |
| 8973 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8974 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ |
| 8975 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 8976 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8977 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 8978 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8979 | 0 \ |
| 8980 | -c "session hash for extended master secret"\ |
| 8981 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8982 | -S "SSL - The handshake negotiation failed" \ |
| 8983 | -S "SSL - Unknown identity received" \ |
| 8984 | -S "SSL - Verification of the message MAC failed" |
| 8985 | |
| 8986 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8987 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \ |
| 8988 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 8989 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8990 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 8991 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8992 | 0 \ |
| 8993 | -c "session hash for extended master secret"\ |
| 8994 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8995 | -S "SSL - The handshake negotiation failed" \ |
| 8996 | -S "SSL - Unknown identity received" \ |
| 8997 | -S "SSL - Verification of the message MAC failed" |
| 8998 | |
| 8999 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9000 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 9001 | "$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" \ |
| 9002 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9003 | psk_identity=def psk=beef" \ |
| 9004 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9005 | -C "session hash for extended master secret"\ |
| 9006 | -S "session hash for extended master secret"\ |
| 9007 | -S "SSL - The handshake negotiation failed" \ |
| 9008 | -S "SSL - Unknown identity received" \ |
| 9009 | -S "SSL - Verification of the message MAC failed" |
| 9010 | |
| 9011 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9012 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 9013 | "$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" \ |
| 9014 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9015 | psk_identity=def psk=beef" \ |
| 9016 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9017 | -C "session hash for extended master secret"\ |
| 9018 | -S "session hash for extended master secret"\ |
| 9019 | -S "SSL - The handshake negotiation failed" \ |
| 9020 | -S "SSL - Unknown identity received" \ |
| 9021 | -S "SSL - Verification of the message MAC failed" |
| 9022 | |
| 9023 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9024 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 9025 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9026 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 9027 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9028 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9029 | 0 \ |
| 9030 | -c "session hash for extended master secret"\ |
| 9031 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9032 | -S "SSL - The handshake negotiation failed" \ |
| 9033 | -S "SSL - Unknown identity received" \ |
| 9034 | -S "SSL - Verification of the message MAC failed" |
| 9035 | |
| 9036 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9037 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 9038 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9039 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 9040 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9041 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9042 | 0 \ |
| 9043 | -c "session hash for extended master secret"\ |
| 9044 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9045 | -S "SSL - The handshake negotiation failed" \ |
| 9046 | -S "SSL - Unknown identity received" \ |
| 9047 | -S "SSL - Verification of the message MAC failed" |
| 9048 | |
| 9049 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9050 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ |
| 9051 | "$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" \ |
| 9052 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9053 | psk_identity=def psk=beef" \ |
| 9054 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9055 | -C "session hash for extended master secret"\ |
| 9056 | -S "session hash for extended master secret"\ |
| 9057 | -S "SSL - The handshake negotiation failed" \ |
| 9058 | -S "SSL - Unknown identity received" \ |
| 9059 | -S "SSL - Verification of the message MAC failed" |
| 9060 | |
| 9061 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9062 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ |
| 9063 | "$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" \ |
| 9064 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9065 | psk_identity=def psk=beef" \ |
| 9066 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9067 | -C "session hash for extended master secret"\ |
| 9068 | -S "session hash for extended master secret"\ |
| 9069 | -S "SSL - The handshake negotiation failed" \ |
| 9070 | -S "SSL - Unknown identity received" \ |
| 9071 | -S "SSL - Verification of the message MAC failed" |
| 9072 | |
| 9073 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9074 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \ |
| 9075 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9076 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 9077 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9078 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9079 | 0 \ |
| 9080 | -c "session hash for extended master secret"\ |
| 9081 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9082 | -S "SSL - The handshake negotiation failed" \ |
| 9083 | -S "SSL - Unknown identity received" \ |
| 9084 | -S "SSL - Verification of the message MAC failed" |
| 9085 | |
| 9086 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9087 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \ |
| 9088 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9089 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 9090 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9091 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9092 | 0 \ |
| 9093 | -c "session hash for extended master secret"\ |
| 9094 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9095 | -S "SSL - The handshake negotiation failed" \ |
| 9096 | -S "SSL - Unknown identity received" \ |
| 9097 | -S "SSL - Verification of the message MAC failed" |
| 9098 | |
| 9099 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9100 | 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] | 9101 | "$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] | 9102 | "$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] | 9103 | psk_identity=def psk=beef" \ |
| 9104 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9105 | -C "session hash for extended master secret"\ |
| 9106 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9107 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9108 | -S "SSL - Unknown identity received" \ |
| 9109 | -S "SSL - Verification of the message MAC failed" |
| 9110 | |
| 9111 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9112 | 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] | 9113 | "$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] | 9114 | "$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] | 9115 | psk_identity=def psk=beef" \ |
| 9116 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9117 | -C "session hash for extended master secret"\ |
| 9118 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9119 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9120 | -S "SSL - Unknown identity received" \ |
| 9121 | -S "SSL - Verification of the message MAC failed" |
| 9122 | |
| 9123 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9124 | 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] | 9125 | "$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] | 9126 | "$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] | 9127 | psk_identity=def psk=beef" \ |
| 9128 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9129 | -C "session hash for extended master secret"\ |
| 9130 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9131 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9132 | -S "SSL - Unknown identity received" \ |
| 9133 | -S "SSL - Verification of the message MAC failed" |
| 9134 | |
| 9135 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9136 | 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] | 9137 | "$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] | 9138 | "$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] | 9139 | psk_identity=def psk=beef" \ |
| 9140 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9141 | -C "session hash for extended master secret"\ |
| 9142 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9143 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9144 | -S "SSL - Unknown identity received" \ |
| 9145 | -S "SSL - Verification of the message MAC failed" |
| 9146 | |
| 9147 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9148 | 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] | 9149 | "$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] | 9150 | "$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] | 9151 | psk_identity=def psk=beef" \ |
| 9152 | 1 \ |
| 9153 | -s "SSL - Verification of the message MAC failed" |
| 9154 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9155 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 9156 | "$P_SRV" \ |
| 9157 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9158 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 9159 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 9160 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9161 | -S "SSL - Unknown identity received" \ |
| 9162 | -S "SSL - Verification of the message MAC failed" |
| 9163 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9164 | run_test "PSK callback: callback overrides other settings" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9165 | "$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] | 9166 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9167 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9168 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9169 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9170 | -s "SSL - Unknown identity received" \ |
| 9171 | -S "SSL - Verification of the message MAC failed" |
| 9172 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9173 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9174 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9175 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9176 | psk_identity=abc psk=dead" \ |
| 9177 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9178 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9179 | -S "SSL - Unknown identity received" \ |
| 9180 | -S "SSL - Verification of the message MAC failed" |
| 9181 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9182 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9183 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9184 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9185 | psk_identity=def psk=beef" \ |
| 9186 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9187 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9188 | -S "SSL - Unknown identity received" \ |
| 9189 | -S "SSL - Verification of the message MAC failed" |
| 9190 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9191 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9192 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9193 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9194 | psk_identity=ghi psk=beef" \ |
| 9195 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9196 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9197 | -s "SSL - Unknown identity received" \ |
| 9198 | -S "SSL - Verification of the message MAC failed" |
| 9199 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9200 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9201 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9202 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9203 | psk_identity=abc psk=beef" \ |
| 9204 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9205 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9206 | -S "SSL - Unknown identity received" \ |
| 9207 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 9208 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9209 | # Tests for EC J-PAKE |
| 9210 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9211 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9213 | run_test "ECJPAKE: client not configured" \ |
| 9214 | "$P_SRV debug_level=3" \ |
| 9215 | "$P_CLI debug_level=3" \ |
| 9216 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 9217 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9218 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9219 | -S "found ecjpake kkpp extension" \ |
| 9220 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9221 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9222 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9223 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9224 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9225 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9226 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9227 | run_test "ECJPAKE: server not configured" \ |
| 9228 | "$P_SRV debug_level=3" \ |
| 9229 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 9230 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9231 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 9232 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9233 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9234 | -s "found ecjpake kkpp extension" \ |
| 9235 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9236 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9237 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9238 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9239 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9240 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9241 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9242 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9243 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9244 | run_test "ECJPAKE: working, TLS" \ |
| 9245 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9246 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 9247 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 9248 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 9249 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9250 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9251 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9252 | -s "found ecjpake kkpp extension" \ |
| 9253 | -S "skip ecjpake kkpp extension" \ |
| 9254 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9255 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9256 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9257 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9258 | -S "SSL - Verification of the message MAC failed" |
| 9259 | |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9260 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | a6b69da | 2022-11-30 16:44:49 +0100 | [diff] [blame] | 9261 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9262 | run_test "ECJPAKE: opaque password client+server, working, TLS" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9263 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9264 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 9265 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9266 | 0 \ |
| 9267 | -c "add ciphersuite: c0ff" \ |
| 9268 | -c "adding ecjpake_kkpp extension" \ |
Valerio Setti | 661b9bc | 2022-11-29 17:19:25 +0100 | [diff] [blame] | 9269 | -c "using opaque password" \ |
| 9270 | -s "using opaque password" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9271 | -C "re-using cached ecjpake parameters" \ |
| 9272 | -s "found ecjpake kkpp extension" \ |
| 9273 | -S "skip ecjpake kkpp extension" \ |
| 9274 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9275 | -s "server hello, ecjpake kkpp extension" \ |
| 9276 | -c "found ecjpake_kkpp extension" \ |
| 9277 | -S "SSL - The handshake negotiation failed" \ |
| 9278 | -S "SSL - Verification of the message MAC failed" |
| 9279 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9280 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9281 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9282 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9283 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9284 | run_test "ECJPAKE: opaque password client only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9285 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9286 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 9287 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9288 | 0 \ |
| 9289 | -c "add ciphersuite: c0ff" \ |
| 9290 | -c "adding ecjpake_kkpp extension" \ |
| 9291 | -c "using opaque password" \ |
| 9292 | -S "using opaque password" \ |
| 9293 | -C "re-using cached ecjpake parameters" \ |
| 9294 | -s "found ecjpake kkpp extension" \ |
| 9295 | -S "skip ecjpake kkpp extension" \ |
| 9296 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9297 | -s "server hello, ecjpake kkpp extension" \ |
| 9298 | -c "found ecjpake_kkpp extension" \ |
| 9299 | -S "SSL - The handshake negotiation failed" \ |
| 9300 | -S "SSL - Verification of the message MAC failed" |
| 9301 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9302 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9303 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9304 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9305 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9306 | run_test "ECJPAKE: opaque password server only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9307 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9308 | "$P_CLI debug_level=3 ecjpake_pw=bla\ |
| 9309 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9310 | 0 \ |
| 9311 | -c "add ciphersuite: c0ff" \ |
| 9312 | -c "adding ecjpake_kkpp extension" \ |
| 9313 | -C "using opaque password" \ |
| 9314 | -s "using opaque password" \ |
| 9315 | -C "re-using cached ecjpake parameters" \ |
| 9316 | -s "found ecjpake kkpp extension" \ |
| 9317 | -S "skip ecjpake kkpp extension" \ |
| 9318 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9319 | -s "server hello, ecjpake kkpp extension" \ |
| 9320 | -c "found ecjpake_kkpp extension" \ |
| 9321 | -S "SSL - The handshake negotiation failed" \ |
| 9322 | -S "SSL - Verification of the message MAC failed" |
| 9323 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9324 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9325 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9326 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 9327 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9328 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 9329 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9330 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9331 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9332 | -s "SSL - Verification of the message MAC failed" |
| 9333 | |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9334 | server_needs_more_time 1 |
| 9335 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9336 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9337 | run_test "ECJPAKE_OPAQUE_PW: opaque password mismatch, TLS" \ |
| 9338 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9339 | "$P_CLI debug_level=3 ecjpake_pw=bad ecjpake_pw_opaque=1 \ |
| 9340 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9341 | 1 \ |
| 9342 | -c "using opaque password" \ |
| 9343 | -s "using opaque password" \ |
| 9344 | -C "re-using cached ecjpake parameters" \ |
| 9345 | -s "SSL - Verification of the message MAC failed" |
| 9346 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9347 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9348 | run_test "ECJPAKE: working, DTLS" \ |
| 9349 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 9350 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 9351 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9352 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9353 | -c "re-using cached ecjpake parameters" \ |
| 9354 | -S "SSL - Verification of the message MAC failed" |
| 9355 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9356 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9357 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 9358 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 9359 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 9360 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9361 | 0 \ |
| 9362 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9363 | -S "SSL - Verification of the message MAC failed" |
| 9364 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9365 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9366 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9367 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 9368 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 9369 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 9370 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9371 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9372 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9373 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9374 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 9375 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9376 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 9377 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 9378 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 9379 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 9380 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9381 | 0 |
| 9382 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 9383 | # Test for ClientHello without extensions |
| 9384 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9385 | # Without extensions, ECC is impossible (no curve negotiation). |
| 9386 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 9387 | requires_gnutls |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9388 | run_test "ClientHello without extensions: RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 9389 | "$P_SRV force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9390 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 9391 | 0 \ |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9392 | -s "Ciphersuite is .*-RSA-WITH-.*" \ |
| 9393 | -S "Ciphersuite is .*-EC.*" \ |
| 9394 | -s "dumping 'client hello extensions' (0 bytes)" |
| 9395 | |
Gilles Peskine | f287691 | 2024-05-13 21:18:41 +0200 | [diff] [blame] | 9396 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_PSK_ENABLED |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9397 | requires_gnutls |
| 9398 | run_test "ClientHello without extensions: PSK" \ |
| 9399 | "$P_SRV force_version=tls12 debug_level=3 psk=73776f726466697368" \ |
| 9400 | "$G_CLI --priority=NORMAL:+PSK:-RSA:-DHE-RSA:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION --pskusername=Client_identity --pskkey=73776f726466697368 localhost" \ |
| 9401 | 0 \ |
| 9402 | -s "Ciphersuite is .*-PSK-.*" \ |
| 9403 | -S "Ciphersuite is .*-EC.*" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 9404 | -s "dumping 'client hello extensions' (0 bytes)" |
| 9405 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9406 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9407 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9408 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9409 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9410 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9411 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9412 | "$P_CLI request_size=100" \ |
| 9413 | 0 \ |
| 9414 | -s "Read from client: 100 bytes read$" |
| 9415 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9416 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9417 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 9418 | "$P_SRV buffer_size=100" \ |
| 9419 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9420 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9421 | -s "Read from client: 101 bytes read (100 + 1)" |
| 9422 | |
| 9423 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9424 | requires_max_content_len 200 |
| 9425 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 9426 | "$P_SRV buffer_size=100" \ |
| 9427 | "$P_CLI request_size=200" \ |
| 9428 | 0 \ |
| 9429 | -s "Read from client: 200 bytes read (100 + 100)" |
| 9430 | |
| 9431 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9432 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
Waleed Elmelegy | bae705c | 2024-01-01 14:21:21 +0000 | [diff] [blame] | 9433 | "$P_SRV buffer_size=100 force_version=tls12" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9434 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 9435 | 0 \ |
| 9436 | -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] | 9437 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9438 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9439 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9440 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9441 | "$P_SRV force_version=tls12" \ |
| 9442 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9443 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9444 | 0 \ |
| 9445 | -s "Read from client: 1 bytes read" |
| 9446 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9447 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9448 | "$P_SRV force_version=tls12" \ |
| 9449 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 9450 | 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] | 9451 | 0 \ |
| 9452 | -s "Read from client: 1 bytes read" |
| 9453 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9454 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9455 | "$P_SRV force_version=tls12" \ |
| 9456 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 9457 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9458 | 0 \ |
| 9459 | -s "Read from client: 1 bytes read" |
| 9460 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9461 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9462 | "$P_SRV force_version=tls12" \ |
| 9463 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9464 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 9465 | 0 \ |
| 9466 | -s "Read from client: 1 bytes read" |
| 9467 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9468 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9469 | "$P_SRV force_version=tls12" \ |
| 9470 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9471 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 9472 | 0 \ |
| 9473 | -s "Read from client: 1 bytes read" |
| 9474 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9475 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9476 | run_test "Small client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9477 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9478 | "$P_CLI request_size=1 \ |
| 9479 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9480 | 0 \ |
| 9481 | -s "Read from client: 1 bytes read" |
| 9482 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9483 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9484 | run_test "Small client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9485 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9486 | "$P_CLI request_size=1 \ |
| 9487 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9488 | 0 \ |
| 9489 | -s "Read from client: 1 bytes read" |
| 9490 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9491 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9492 | |
| 9493 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9494 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9495 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9496 | "$P_CLI dtls=1 request_size=1 \ |
| 9497 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9498 | 0 \ |
| 9499 | -s "Read from client: 1 bytes read" |
| 9500 | |
| 9501 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9502 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9503 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9504 | "$P_CLI dtls=1 request_size=1 \ |
| 9505 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9506 | 0 \ |
| 9507 | -s "Read from client: 1 bytes read" |
| 9508 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9509 | # Tests for small server packets |
| 9510 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9511 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9512 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9513 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9514 | 0 \ |
| 9515 | -c "Read from server: 1 bytes read" |
| 9516 | |
| 9517 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9518 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9519 | "$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] | 9520 | 0 \ |
| 9521 | -c "Read from server: 1 bytes read" |
| 9522 | |
| 9523 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9524 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9525 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9526 | 0 \ |
| 9527 | -c "Read from server: 1 bytes read" |
| 9528 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9529 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9530 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9531 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9532 | 0 \ |
| 9533 | -c "Read from server: 1 bytes read" |
| 9534 | |
| 9535 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9536 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9537 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9538 | 0 \ |
| 9539 | -c "Read from server: 1 bytes read" |
| 9540 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9541 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9542 | run_test "Small server packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9543 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9544 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9545 | 0 \ |
| 9546 | -c "Read from server: 1 bytes read" |
| 9547 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9548 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9549 | run_test "Small server packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9550 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9551 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9552 | 0 \ |
| 9553 | -c "Read from server: 1 bytes read" |
| 9554 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9555 | # Tests for small server packets in DTLS |
| 9556 | |
| 9557 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9558 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9559 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9560 | "$P_CLI dtls=1 \ |
| 9561 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9562 | 0 \ |
| 9563 | -c "Read from server: 1 bytes read" |
| 9564 | |
| 9565 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9566 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9567 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9568 | "$P_CLI dtls=1 \ |
| 9569 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9570 | 0 \ |
| 9571 | -c "Read from server: 1 bytes read" |
| 9572 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9573 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9574 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9575 | # How many fragments do we expect to write $1 bytes? |
| 9576 | fragments_for_write() { |
| 9577 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 9578 | } |
| 9579 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9580 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9581 | "$P_SRV force_version=tls12" \ |
| 9582 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9583 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9584 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9585 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9586 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9587 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9588 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9589 | "$P_SRV force_version=tls12" \ |
| 9590 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 9591 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9592 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9593 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 9594 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9595 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9596 | "$P_SRV force_version=tls12" \ |
| 9597 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 9598 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9599 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9600 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9601 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9602 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9603 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9604 | "$P_SRV force_version=tls12" \ |
| 9605 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9606 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 9607 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9608 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9609 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9610 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9611 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9612 | "$P_SRV force_version=tls12" \ |
| 9613 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9614 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 9615 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9616 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9617 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9618 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9619 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9620 | run_test "Large client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9621 | "$P_SRV" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9622 | "$P_CLI request_size=16383 \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9623 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9624 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9625 | -c "16383 bytes written in $(fragments_for_write 16383) fragments" \ |
| 9626 | -s "Read from client: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9627 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9628 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9629 | run_test "Large client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9630 | "$P_SRV" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9631 | "$P_CLI request_size=16383 \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9632 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9633 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9634 | -c "16383 bytes written in $(fragments_for_write 16383) fragments" \ |
| 9635 | -s "Read from client: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9636 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9637 | # 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] | 9638 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9639 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9640 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9641 | 0 \ |
| 9642 | -c "Read from server: 16384 bytes read" |
| 9643 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9644 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9645 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9646 | "$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] | 9647 | 0 \ |
| 9648 | -s "16384 bytes written in 1 fragments" \ |
| 9649 | -c "Read from server: 16384 bytes read" |
| 9650 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9651 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9652 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9653 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9654 | 0 \ |
| 9655 | -c "Read from server: 16384 bytes read" |
| 9656 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9657 | 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] | 9658 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 9659 | "$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] | 9660 | 0 \ |
| 9661 | -s "16384 bytes written in 1 fragments" \ |
| 9662 | -c "Read from server: 16384 bytes read" |
| 9663 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9664 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9665 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9666 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9667 | 0 \ |
| 9668 | -c "Read from server: 16384 bytes read" |
| 9669 | |
| 9670 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9671 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9672 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9673 | 0 \ |
| 9674 | -c "Read from server: 16384 bytes read" |
| 9675 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9676 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9677 | run_test "Large server packet TLS 1.3 AEAD" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9678 | "$P_SRV response_size=16383" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9679 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9680 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9681 | -c "Read from server: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9682 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9683 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9684 | run_test "Large server packet TLS 1.3 AEAD shorter tag" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9685 | "$P_SRV response_size=16383" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9686 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9687 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9688 | -c "Read from server: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9689 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9690 | # Tests for restartable ECC |
| 9691 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9692 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 9693 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9694 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9695 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9696 | run_test "EC restart: TLS, default" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9697 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9698 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9699 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9700 | debug_level=1" \ |
| 9701 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9702 | -C "x509_verify_cert.*4b00" \ |
| 9703 | -C "mbedtls_pk_verify.*4b00" \ |
| 9704 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9705 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9706 | |
| 9707 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9708 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9709 | run_test "EC restart: TLS, max_ops=0" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9710 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9711 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9712 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9713 | debug_level=1 ec_max_ops=0" \ |
| 9714 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9715 | -C "x509_verify_cert.*4b00" \ |
| 9716 | -C "mbedtls_pk_verify.*4b00" \ |
| 9717 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9718 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9719 | |
| 9720 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9721 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9722 | run_test "EC restart: TLS, max_ops=65535" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9723 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9724 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9725 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9726 | debug_level=1 ec_max_ops=65535" \ |
| 9727 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9728 | -C "x509_verify_cert.*4b00" \ |
| 9729 | -C "mbedtls_pk_verify.*4b00" \ |
| 9730 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9731 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9732 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9733 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9734 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9735 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9736 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9737 | run_test "EC restart: TLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9738 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9739 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9740 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9741 | debug_level=1 ec_max_ops=1000" \ |
| 9742 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9743 | -c "x509_verify_cert.*4b00" \ |
| 9744 | -c "mbedtls_pk_verify.*4b00" \ |
| 9745 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9746 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9747 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9748 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9749 | # everything except ECDH (where TLS calls PSA directly). |
| 9750 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9751 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9752 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9753 | run_test "EC restart: TLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9754 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9755 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9756 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9757 | debug_level=1 ec_max_ops=1000" \ |
| 9758 | 0 \ |
| 9759 | -c "x509_verify_cert.*4b00" \ |
| 9760 | -c "mbedtls_pk_verify.*4b00" \ |
| 9761 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9762 | -c "mbedtls_pk_sign.*4b00" |
| 9763 | |
| 9764 | # This works the same with & without USE_PSA as we never get to ECDH: |
| 9765 | # 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] | 9766 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9767 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9768 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9769 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9770 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9771 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9772 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9773 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9774 | debug_level=1 ec_max_ops=1000" \ |
| 9775 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9776 | -c "x509_verify_cert.*4b00" \ |
| 9777 | -C "mbedtls_pk_verify.*4b00" \ |
| 9778 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9779 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9780 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9781 | -c "! mbedtls_ssl_handshake returned" \ |
| 9782 | -c "X509 - Certificate verification failed" |
| 9783 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9784 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9785 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9786 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9787 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9788 | 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] | 9789 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9790 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9791 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9792 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9793 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9794 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 9795 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9796 | -c "x509_verify_cert.*4b00" \ |
| 9797 | -c "mbedtls_pk_verify.*4b00" \ |
| 9798 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9799 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9800 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9801 | -C "! mbedtls_ssl_handshake returned" \ |
| 9802 | -C "X509 - Certificate verification failed" |
| 9803 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9804 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9805 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9806 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9807 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9808 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9809 | 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] | 9810 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9811 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9812 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9813 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9814 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9815 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 9816 | 0 \ |
| 9817 | -c "x509_verify_cert.*4b00" \ |
| 9818 | -c "mbedtls_pk_verify.*4b00" \ |
| 9819 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9820 | -c "mbedtls_pk_sign.*4b00" \ |
| 9821 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9822 | -C "! mbedtls_ssl_handshake returned" \ |
| 9823 | -C "X509 - Certificate verification failed" |
| 9824 | |
| 9825 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9826 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9827 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9828 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9829 | 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] | 9830 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9831 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9832 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9833 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9834 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9835 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 9836 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9837 | -C "x509_verify_cert.*4b00" \ |
| 9838 | -c "mbedtls_pk_verify.*4b00" \ |
| 9839 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9840 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9841 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 9842 | -C "! mbedtls_ssl_handshake returned" \ |
| 9843 | -C "X509 - Certificate verification failed" |
| 9844 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9845 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9846 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9847 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9848 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9849 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9850 | 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] | 9851 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9852 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9853 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9854 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9855 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9856 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 9857 | 0 \ |
| 9858 | -C "x509_verify_cert.*4b00" \ |
| 9859 | -c "mbedtls_pk_verify.*4b00" \ |
| 9860 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9861 | -c "mbedtls_pk_sign.*4b00" \ |
| 9862 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 9863 | -C "! mbedtls_ssl_handshake returned" \ |
| 9864 | -C "X509 - Certificate verification failed" |
| 9865 | |
| 9866 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9867 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9868 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9869 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9870 | run_test "EC restart: DTLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9871 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9872 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9873 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9874 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 9875 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9876 | -c "x509_verify_cert.*4b00" \ |
| 9877 | -c "mbedtls_pk_verify.*4b00" \ |
| 9878 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9879 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9880 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9881 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9882 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9883 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9884 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9885 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9886 | run_test "EC restart: DTLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9887 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9888 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9889 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9890 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 9891 | 0 \ |
| 9892 | -c "x509_verify_cert.*4b00" \ |
| 9893 | -c "mbedtls_pk_verify.*4b00" \ |
| 9894 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9895 | -c "mbedtls_pk_sign.*4b00" |
| 9896 | |
| 9897 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9898 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9899 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9900 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9901 | run_test "EC restart: TLS, max_ops=1000 no client auth (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9902 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9903 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9904 | debug_level=1 ec_max_ops=1000" \ |
| 9905 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9906 | -c "x509_verify_cert.*4b00" \ |
| 9907 | -c "mbedtls_pk_verify.*4b00" \ |
| 9908 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9909 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9910 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9911 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9912 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9913 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9914 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9915 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9916 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9917 | run_test "EC restart: TLS, max_ops=1000 no client auth (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9918 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9919 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9920 | debug_level=1 ec_max_ops=1000" \ |
| 9921 | 0 \ |
| 9922 | -c "x509_verify_cert.*4b00" \ |
| 9923 | -c "mbedtls_pk_verify.*4b00" \ |
| 9924 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9925 | -C "mbedtls_pk_sign.*4b00" |
| 9926 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9927 | # Restartable is only for ECDHE-ECDSA, with another ciphersuite we expect no |
| 9928 | # restartable behaviour at all (not even client auth). |
| 9929 | # This is the same as "EC restart: TLS, max_ops=1000" except with ECDHE-RSA, |
| 9930 | # and all 4 assertions negated. |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9931 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9932 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9933 | run_test "EC restart: TLS, max_ops=1000, ECDHE-RSA" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9934 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9935 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9936 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9937 | debug_level=1 ec_max_ops=1000" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9938 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9939 | -C "x509_verify_cert.*4b00" \ |
| 9940 | -C "mbedtls_pk_verify.*4b00" \ |
| 9941 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9942 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9943 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9944 | # Tests of asynchronous private key support in SSL |
| 9945 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9946 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9947 | run_test "SSL async private: sign, delay=0" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9948 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9949 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9950 | "$P_CLI" \ |
| 9951 | 0 \ |
| 9952 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9953 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9954 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9955 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9956 | run_test "SSL async private: sign, delay=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9957 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9958 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9959 | "$P_CLI" \ |
| 9960 | 0 \ |
| 9961 | -s "Async sign callback: using key slot " \ |
| 9962 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9963 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 9964 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 9965 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 9966 | run_test "SSL async private: sign, delay=2" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9967 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 9968 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 9969 | "$P_CLI" \ |
| 9970 | 0 \ |
| 9971 | -s "Async sign callback: using key slot " \ |
| 9972 | -U "Async sign callback: using key slot " \ |
| 9973 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 9974 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 9975 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 9976 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9977 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 9978 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 9979 | run_test "SSL async private: sign, SNI" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9980 | "$P_SRV force_version=tls12 debug_level=3 \ |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 9981 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9982 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 9983 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 9984 | "$P_CLI server_name=polarssl.example" \ |
| 9985 | 0 \ |
| 9986 | -s "Async sign callback: using key slot " \ |
| 9987 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 9988 | -s "parse ServerName extension" \ |
| 9989 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 9990 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 9991 | |
| 9992 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9993 | run_test "SSL async private: decrypt, delay=0" \ |
| 9994 | "$P_SRV \ |
| 9995 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 9996 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9997 | 0 \ |
| 9998 | -s "Async decrypt callback: using key slot " \ |
| 9999 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10000 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10001 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10002 | run_test "SSL async private: decrypt, delay=1" \ |
| 10003 | "$P_SRV \ |
| 10004 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 10005 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10006 | 0 \ |
| 10007 | -s "Async decrypt callback: using key slot " \ |
| 10008 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 10009 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10010 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10011 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10012 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10013 | "$P_SRV psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10014 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10015 | "$P_CLI psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10016 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 10017 | 0 \ |
| 10018 | -s "Async decrypt callback: using key slot " \ |
| 10019 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10020 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10021 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10022 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10023 | "$P_SRV psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10024 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10025 | "$P_CLI psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10026 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 10027 | 0 \ |
| 10028 | -s "Async decrypt callback: using key slot " \ |
| 10029 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 10030 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10031 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10032 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10033 | run_test "SSL async private: sign callback not present" \ |
| 10034 | "$P_SRV \ |
| 10035 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10036 | "$P_CLI force_version=tls12; [ \$? -eq 1 ] && |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10037 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10038 | 0 \ |
| 10039 | -S "Async sign callback" \ |
| 10040 | -s "! mbedtls_ssl_handshake returned" \ |
| 10041 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 10042 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 10043 | -s "Successful connection" |
| 10044 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10045 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10046 | run_test "SSL async private: decrypt callback not present" \ |
| 10047 | "$P_SRV debug_level=1 \ |
| 10048 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 10049 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 10050 | [ \$? -eq 1 ] && $P_CLI force_version=tls12" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10051 | 0 \ |
| 10052 | -S "Async decrypt callback" \ |
| 10053 | -s "! mbedtls_ssl_handshake returned" \ |
| 10054 | -s "got no RSA private key" \ |
| 10055 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 10056 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10057 | |
| 10058 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10059 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10060 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10061 | "$P_SRV \ |
| 10062 | async_operations=s async_private_delay1=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10063 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10064 | key_file2=$DATA_FILES_PATH/server2.key crt_file2=$DATA_FILES_PATH/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10065 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10066 | 0 \ |
| 10067 | -s "Async sign callback: using key slot 0," \ |
| 10068 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10069 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10070 | |
| 10071 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10072 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10073 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10074 | "$P_SRV \ |
| 10075 | async_operations=s async_private_delay2=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10076 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10077 | key_file2=$DATA_FILES_PATH/server2.key crt_file2=$DATA_FILES_PATH/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10078 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10079 | 0 \ |
| 10080 | -s "Async sign callback: using key slot 0," \ |
| 10081 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10082 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10083 | |
| 10084 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10085 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 10086 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10087 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 10088 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10089 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10090 | key_file2=$DATA_FILES_PATH/server2.key crt_file2=$DATA_FILES_PATH/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10091 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10092 | 0 \ |
| 10093 | -s "Async sign callback: using key slot 1," \ |
| 10094 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10095 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10096 | |
| 10097 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10098 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10099 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10100 | "$P_SRV \ |
| 10101 | async_operations=s async_private_delay1=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10102 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10103 | key_file2=$DATA_FILES_PATH/server2.key crt_file2=$DATA_FILES_PATH/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10104 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10105 | 0 \ |
| 10106 | -s "Async sign callback: no key matches this certificate." |
| 10107 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10108 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10109 | run_test "SSL async private: sign, error in start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10110 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10111 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10112 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10113 | "$P_CLI" \ |
| 10114 | 1 \ |
| 10115 | -s "Async sign callback: injected error" \ |
| 10116 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 10117 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10118 | -s "! mbedtls_ssl_handshake returned" |
| 10119 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10120 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10121 | run_test "SSL async private: sign, cancel after start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10122 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10123 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10124 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10125 | "$P_CLI" \ |
| 10126 | 1 \ |
| 10127 | -s "Async sign callback: using key slot " \ |
| 10128 | -S "Async resume" \ |
| 10129 | -s "Async cancel" |
| 10130 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10131 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10132 | run_test "SSL async private: sign, error in resume" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10133 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10134 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10135 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10136 | "$P_CLI" \ |
| 10137 | 1 \ |
| 10138 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10139 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 10140 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10141 | -s "! mbedtls_ssl_handshake returned" |
| 10142 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10143 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10144 | run_test "SSL async private: decrypt, error in start" \ |
| 10145 | "$P_SRV \ |
| 10146 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10147 | async_private_error=1" \ |
| 10148 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10149 | 1 \ |
| 10150 | -s "Async decrypt callback: injected error" \ |
| 10151 | -S "Async resume" \ |
| 10152 | -S "Async cancel" \ |
| 10153 | -s "! mbedtls_ssl_handshake returned" |
| 10154 | |
| 10155 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 10156 | run_test "SSL async private: decrypt, cancel after start" \ |
| 10157 | "$P_SRV \ |
| 10158 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10159 | async_private_error=2" \ |
| 10160 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10161 | 1 \ |
| 10162 | -s "Async decrypt callback: using key slot " \ |
| 10163 | -S "Async resume" \ |
| 10164 | -s "Async cancel" |
| 10165 | |
| 10166 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 10167 | run_test "SSL async private: decrypt, error in resume" \ |
| 10168 | "$P_SRV \ |
| 10169 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10170 | async_private_error=3" \ |
| 10171 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10172 | 1 \ |
| 10173 | -s "Async decrypt callback: using key slot " \ |
| 10174 | -s "Async resume callback: decrypt done but injected error" \ |
| 10175 | -S "Async cancel" \ |
| 10176 | -s "! mbedtls_ssl_handshake returned" |
| 10177 | |
| 10178 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10179 | run_test "SSL async private: cancel after start then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10180 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10181 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10182 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10183 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 10184 | 0 \ |
| 10185 | -s "Async cancel" \ |
| 10186 | -s "! mbedtls_ssl_handshake returned" \ |
| 10187 | -s "Async resume" \ |
| 10188 | -s "Successful connection" |
| 10189 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10190 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10191 | run_test "SSL async private: error in resume then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10192 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10193 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10194 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10195 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 10196 | 0 \ |
| 10197 | -s "! mbedtls_ssl_handshake returned" \ |
| 10198 | -s "Async resume" \ |
| 10199 | -s "Successful connection" |
| 10200 | |
| 10201 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10202 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 10203 | # Note: the function "detect_required_features()" is not able to detect more than |
| 10204 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 10205 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 10206 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10207 | 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] | 10208 | "$P_SRV \ |
| 10209 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10210 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10211 | key_file2=$DATA_FILES_PATH/server2.key crt_file2=$DATA_FILES_PATH/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10212 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 10213 | [ \$? -eq 1 ] && |
| 10214 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10215 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 10216 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10217 | -S "Async resume" \ |
| 10218 | -s "Async cancel" \ |
| 10219 | -s "! mbedtls_ssl_handshake returned" \ |
| 10220 | -s "Async sign callback: no key matches this certificate." \ |
| 10221 | -s "Successful connection" |
| 10222 | |
| 10223 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10224 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 10225 | # Note: the function "detect_required_features()" is not able to detect more than |
| 10226 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 10227 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 10228 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10229 | 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] | 10230 | "$P_SRV \ |
| 10231 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10232 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10233 | key_file2=$DATA_FILES_PATH/server2.key crt_file2=$DATA_FILES_PATH/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10234 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 10235 | [ \$? -eq 1 ] && |
| 10236 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10237 | 0 \ |
| 10238 | -s "Async resume" \ |
| 10239 | -s "! mbedtls_ssl_handshake returned" \ |
| 10240 | -s "Async sign callback: no key matches this certificate." \ |
| 10241 | -s "Successful connection" |
| 10242 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10243 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10244 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10245 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10246 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10247 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10248 | exchanges=2 renegotiation=1" \ |
| 10249 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10250 | 0 \ |
| 10251 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10252 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10253 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10254 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10255 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10256 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10257 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10258 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10259 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10260 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 10261 | 0 \ |
| 10262 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10263 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 10264 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10265 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10266 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10267 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10268 | "$P_SRV \ |
| 10269 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10270 | exchanges=2 renegotiation=1" \ |
| 10271 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 10272 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10273 | 0 \ |
| 10274 | -s "Async decrypt callback: using key slot " \ |
| 10275 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10276 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10277 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10278 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10279 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10280 | "$P_SRV \ |
| 10281 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10282 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10283 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 10284 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10285 | 0 \ |
| 10286 | -s "Async decrypt callback: using key slot " \ |
| 10287 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10288 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10289 | # Tests for ECC extensions (rfc 4492) |
| 10290 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10291 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10292 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10293 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 10294 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10295 | "$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] | 10296 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 10297 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10298 | -C "client hello, adding supported_point_formats extension" \ |
| 10299 | -S "found supported elliptic curves extension" \ |
| 10300 | -S "found supported point formats extension" |
| 10301 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10302 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10303 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10304 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10305 | "$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] | 10306 | "$P_CLI debug_level=3" \ |
| 10307 | 0 \ |
| 10308 | -C "found supported_point_formats extension" \ |
| 10309 | -S "server hello, supported_point_formats extension" |
| 10310 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10311 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10312 | run_test "Force an ECC ciphersuite in the client side" \ |
| 10313 | "$P_SRV debug_level=3" \ |
| 10314 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10315 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 10316 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10317 | -c "client hello, adding supported_point_formats extension" \ |
| 10318 | -s "found supported elliptic curves extension" \ |
| 10319 | -s "found supported point formats extension" |
| 10320 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10321 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10322 | run_test "Force an ECC ciphersuite in the server side" \ |
| 10323 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10324 | "$P_CLI debug_level=3" \ |
| 10325 | 0 \ |
| 10326 | -c "found supported_point_formats extension" \ |
| 10327 | -s "server hello, supported_point_formats extension" |
| 10328 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10329 | # Tests for DTLS HelloVerifyRequest |
| 10330 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10331 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10332 | run_test "DTLS cookie: enabled" \ |
| 10333 | "$P_SRV dtls=1 debug_level=2" \ |
| 10334 | "$P_CLI dtls=1 debug_level=2" \ |
| 10335 | 0 \ |
| 10336 | -s "cookie verification failed" \ |
| 10337 | -s "cookie verification passed" \ |
| 10338 | -S "cookie verification skipped" \ |
| 10339 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10340 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10341 | -S "SSL - The requested feature is not available" |
| 10342 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10343 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10344 | run_test "DTLS cookie: disabled" \ |
| 10345 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 10346 | "$P_CLI dtls=1 debug_level=2" \ |
| 10347 | 0 \ |
| 10348 | -S "cookie verification failed" \ |
| 10349 | -S "cookie verification passed" \ |
| 10350 | -s "cookie verification skipped" \ |
| 10351 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10352 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10353 | -S "SSL - The requested feature is not available" |
| 10354 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10355 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10356 | run_test "DTLS cookie: default (failing)" \ |
| 10357 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 10358 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 10359 | 1 \ |
| 10360 | -s "cookie verification failed" \ |
| 10361 | -S "cookie verification passed" \ |
| 10362 | -S "cookie verification skipped" \ |
| 10363 | -C "received hello verify request" \ |
| 10364 | -S "hello verification requested" \ |
| 10365 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10366 | |
| 10367 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10368 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10369 | run_test "DTLS cookie: enabled, IPv6" \ |
| 10370 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 10371 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 10372 | 0 \ |
| 10373 | -s "cookie verification failed" \ |
| 10374 | -s "cookie verification passed" \ |
| 10375 | -S "cookie verification skipped" \ |
| 10376 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10377 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10378 | -S "SSL - The requested feature is not available" |
| 10379 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10380 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 10381 | run_test "DTLS cookie: enabled, nbio" \ |
| 10382 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 10383 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10384 | 0 \ |
| 10385 | -s "cookie verification failed" \ |
| 10386 | -s "cookie verification passed" \ |
| 10387 | -S "cookie verification skipped" \ |
| 10388 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10389 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 10390 | -S "SSL - The requested feature is not available" |
| 10391 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10392 | # Tests for client reconnecting from the same port with DTLS |
| 10393 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10394 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10395 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10396 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10397 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 10398 | "$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] | 10399 | 0 \ |
| 10400 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10401 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10402 | -S "Client initiated reconnection from same port" |
| 10403 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10404 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10405 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10406 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10407 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 10408 | "$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] | 10409 | 0 \ |
| 10410 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10411 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10412 | -s "Client initiated reconnection from same port" |
| 10413 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10414 | 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] | 10415 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10416 | 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] | 10417 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 10418 | "$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] | 10419 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10420 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10421 | -s "Client initiated reconnection from same port" |
| 10422 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10423 | 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] | 10424 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10425 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 10426 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 10427 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 10428 | 0 \ |
| 10429 | -S "The operation timed out" \ |
| 10430 | -s "Client initiated reconnection from same port" |
| 10431 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10432 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10433 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 10434 | "$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] | 10435 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 10436 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10437 | -s "The operation timed out" \ |
| 10438 | -S "Client initiated reconnection from same port" |
| 10439 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10440 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 10441 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 10442 | -p "$P_PXY inject_clihlo=1" \ |
| 10443 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 10444 | "$P_CLI dtls=1 exchanges=2" \ |
| 10445 | 0 \ |
| 10446 | -s "possible client reconnect from the same port" \ |
| 10447 | -S "Client initiated reconnection from same port" |
| 10448 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10449 | # Tests for various cases of client authentication with DTLS |
| 10450 | # (focused on handshake flows and message parsing) |
| 10451 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10452 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10453 | run_test "DTLS client auth: required" \ |
| 10454 | "$P_SRV dtls=1 auth_mode=required" \ |
| 10455 | "$P_CLI dtls=1" \ |
| 10456 | 0 \ |
| 10457 | -s "Verifying peer X.509 certificate... ok" |
| 10458 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10459 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10460 | run_test "DTLS client auth: optional, client has no cert" \ |
| 10461 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 10462 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 10463 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10464 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10465 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10467 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10468 | "$P_SRV dtls=1 auth_mode=none" \ |
| 10469 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 10470 | 0 \ |
| 10471 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10472 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10473 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 10474 | run_test "DTLS wrong PSK: badmac alert" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10475 | "$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] | 10476 | "$P_CLI dtls=1 psk=73776f726466697374" \ |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 10477 | 1 \ |
| 10478 | -s "SSL - Verification of the message MAC failed" \ |
| 10479 | -c "SSL - A fatal alert message was received from our peer" |
| 10480 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10481 | # Tests for receiving fragmented handshake messages with DTLS |
| 10482 | |
| 10483 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10485 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 10486 | "$G_SRV -u --mtu 2048 -a" \ |
| 10487 | "$P_CLI dtls=1 debug_level=2" \ |
| 10488 | 0 \ |
| 10489 | -C "found fragmented DTLS handshake message" \ |
| 10490 | -C "error" |
| 10491 | |
| 10492 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10493 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10494 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 10495 | "$G_SRV -u --mtu 512" \ |
| 10496 | "$P_CLI dtls=1 debug_level=2" \ |
| 10497 | 0 \ |
| 10498 | -c "found fragmented DTLS handshake message" \ |
| 10499 | -C "error" |
| 10500 | |
| 10501 | requires_gnutls |
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 | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10503 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 10504 | "$G_SRV -u --mtu 128" \ |
| 10505 | "$P_CLI dtls=1 debug_level=2" \ |
| 10506 | 0 \ |
| 10507 | -c "found fragmented DTLS handshake message" \ |
| 10508 | -C "error" |
| 10509 | |
| 10510 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10511 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10512 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 10513 | "$G_SRV -u --mtu 128" \ |
| 10514 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10515 | 0 \ |
| 10516 | -c "found fragmented DTLS handshake message" \ |
| 10517 | -C "error" |
| 10518 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10519 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10520 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10521 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10522 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 10523 | "$G_SRV -u --mtu 256" \ |
| 10524 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 10525 | 0 \ |
| 10526 | -c "found fragmented DTLS handshake message" \ |
| 10527 | -c "client hello, adding renegotiation extension" \ |
| 10528 | -c "found renegotiation extension" \ |
| 10529 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 10530 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10531 | -C "error" \ |
| 10532 | -s "Extra-header:" |
| 10533 | |
| 10534 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10535 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10536 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10537 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 10538 | "$G_SRV -u --mtu 256" \ |
| 10539 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 10540 | 0 \ |
| 10541 | -c "found fragmented DTLS handshake message" \ |
| 10542 | -c "client hello, adding renegotiation extension" \ |
| 10543 | -c "found renegotiation extension" \ |
| 10544 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 10545 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10546 | -C "error" \ |
| 10547 | -s "Extra-header:" |
| 10548 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10549 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10550 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 10551 | "$O_SRV -dtls -mtu 2048" \ |
| 10552 | "$P_CLI dtls=1 debug_level=2" \ |
| 10553 | 0 \ |
| 10554 | -C "found fragmented DTLS handshake message" \ |
| 10555 | -C "error" |
| 10556 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10557 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10558 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 10559 | "$O_SRV -dtls -mtu 256" \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10560 | "$P_CLI dtls=1 debug_level=2" \ |
| 10561 | 0 \ |
| 10562 | -c "found fragmented DTLS handshake message" \ |
| 10563 | -C "error" |
| 10564 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10565 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10566 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 10567 | "$O_SRV -dtls -mtu 256" \ |
| 10568 | "$P_CLI dtls=1 debug_level=2" \ |
| 10569 | 0 \ |
| 10570 | -c "found fragmented DTLS handshake message" \ |
| 10571 | -C "error" |
| 10572 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10574 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 10575 | "$O_SRV -dtls -mtu 256" \ |
| 10576 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10577 | 0 \ |
| 10578 | -c "found fragmented DTLS handshake message" \ |
| 10579 | -C "error" |
| 10580 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10581 | # Tests for sending fragmented handshake messages with DTLS |
| 10582 | # |
| 10583 | # Use client auth when we need the client to send large messages, |
| 10584 | # and use large cert chains on both sides too (the long chains we have all use |
| 10585 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 10586 | # Sizes reached (UDP payload): |
| 10587 | # - 2037B for server certificate |
| 10588 | # - 1542B for client certificate |
| 10589 | # - 1013B for newsessionticket |
| 10590 | # - all others below 512B |
| 10591 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 10592 | |
| 10593 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10594 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10595 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10596 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10597 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10598 | run_test "DTLS fragmenting: none (for reference)" \ |
| 10599 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10600 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10601 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10602 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10603 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10604 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10605 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10606 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10607 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10608 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10609 | 0 \ |
| 10610 | -S "found fragmented DTLS handshake message" \ |
| 10611 | -C "found fragmented DTLS handshake message" \ |
| 10612 | -C "error" |
| 10613 | |
| 10614 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10615 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10616 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10617 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10618 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10619 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10620 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10621 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10622 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10623 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10624 | max_frag_len=1024" \ |
| 10625 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10626 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10627 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10628 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10629 | max_frag_len=2048" \ |
| 10630 | 0 \ |
| 10631 | -S "found fragmented DTLS handshake message" \ |
| 10632 | -c "found fragmented DTLS handshake message" \ |
| 10633 | -C "error" |
| 10634 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 10635 | # With the MFL extension, the server has no way of forcing |
| 10636 | # the client to not exceed a certain MTU; hence, the following |
| 10637 | # test can't be replicated with an MTU proxy such as the one |
| 10638 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10639 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10640 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10641 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10642 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10643 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10644 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10645 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10646 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10647 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10648 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10649 | max_frag_len=512" \ |
| 10650 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10651 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10652 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10653 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 10654 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10655 | 0 \ |
| 10656 | -S "found fragmented DTLS handshake message" \ |
| 10657 | -c "found fragmented DTLS handshake message" \ |
| 10658 | -C "error" |
| 10659 | |
| 10660 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10661 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10662 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10663 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10665 | 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] | 10666 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10667 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10668 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10669 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10670 | max_frag_len=2048" \ |
| 10671 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10672 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10673 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10674 | hs_timeout=2500-60000 \ |
| 10675 | max_frag_len=1024" \ |
| 10676 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10677 | -S "found fragmented DTLS handshake message" \ |
| 10678 | -c "found fragmented DTLS handshake message" \ |
| 10679 | -C "error" |
| 10680 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10681 | # While not required by the standard defining the MFL extension |
| 10682 | # (according to which it only applies to records, not to datagrams), |
| 10683 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 10684 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 10685 | # to the peer. |
| 10686 | # The next test checks that no datagrams significantly larger than the |
| 10687 | # negotiated MFL are sent. |
| 10688 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10689 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10690 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10691 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10692 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10693 | 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] | 10694 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10695 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10696 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10697 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10698 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10699 | max_frag_len=2048" \ |
| 10700 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10701 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10702 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10703 | hs_timeout=2500-60000 \ |
| 10704 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10705 | 0 \ |
| 10706 | -S "found fragmented DTLS handshake message" \ |
| 10707 | -c "found fragmented DTLS handshake message" \ |
| 10708 | -C "error" |
| 10709 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10710 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10711 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10712 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10713 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10714 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10715 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10716 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10717 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10718 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10719 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10720 | max_frag_len=2048" \ |
| 10721 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10722 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10723 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10724 | hs_timeout=2500-60000 \ |
| 10725 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10726 | 0 \ |
| 10727 | -s "found fragmented DTLS handshake message" \ |
| 10728 | -c "found fragmented DTLS handshake message" \ |
| 10729 | -C "error" |
| 10730 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10731 | # While not required by the standard defining the MFL extension |
| 10732 | # (according to which it only applies to records, not to datagrams), |
| 10733 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 10734 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 10735 | # to the peer. |
| 10736 | # The next test checks that no datagrams significantly larger than the |
| 10737 | # negotiated MFL are sent. |
| 10738 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10739 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10740 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10741 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10742 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10743 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 10744 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10745 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10746 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10747 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10748 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10749 | max_frag_len=2048" \ |
| 10750 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10751 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10752 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10753 | hs_timeout=2500-60000 \ |
| 10754 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10755 | 0 \ |
| 10756 | -s "found fragmented DTLS handshake message" \ |
| 10757 | -c "found fragmented DTLS handshake message" \ |
| 10758 | -C "error" |
| 10759 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10760 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10761 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10762 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10763 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10764 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 10765 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10766 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10767 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10768 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10769 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10770 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10771 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10772 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10773 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10774 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10775 | 0 \ |
| 10776 | -S "found fragmented DTLS handshake message" \ |
| 10777 | -C "found fragmented DTLS handshake message" \ |
| 10778 | -C "error" |
| 10779 | |
| 10780 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10781 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10782 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10783 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10784 | run_test "DTLS fragmenting: client (MTU)" \ |
| 10785 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10786 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10787 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10788 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10789 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10790 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10791 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10792 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10793 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10794 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10795 | 0 \ |
| 10796 | -s "found fragmented DTLS handshake message" \ |
| 10797 | -C "found fragmented DTLS handshake message" \ |
| 10798 | -C "error" |
| 10799 | |
| 10800 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10801 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10802 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10804 | run_test "DTLS fragmenting: server (MTU)" \ |
| 10805 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10806 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10807 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10808 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10809 | mtu=512" \ |
| 10810 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10811 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10812 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10813 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10814 | mtu=2048" \ |
| 10815 | 0 \ |
| 10816 | -S "found fragmented DTLS handshake message" \ |
| 10817 | -c "found fragmented DTLS handshake message" \ |
| 10818 | -C "error" |
| 10819 | |
| 10820 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10821 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10822 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10823 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10824 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10825 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10826 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10827 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10828 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10829 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 10830 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10831 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10832 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10833 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10834 | hs_timeout=2500-60000 \ |
| 10835 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10836 | 0 \ |
| 10837 | -s "found fragmented DTLS handshake message" \ |
| 10838 | -c "found fragmented DTLS handshake message" \ |
| 10839 | -C "error" |
| 10840 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10841 | # 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] | 10842 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10843 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10844 | requires_hash_alg SHA_256 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10845 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10846 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 10847 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 10848 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10849 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10850 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10851 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 10852 | mtu=512" \ |
| 10853 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10854 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10855 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10856 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10857 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10858 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10859 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10860 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10861 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10862 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10863 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10864 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10865 | # 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] | 10866 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 10867 | # retransmissions, but in some cases (like both the server and client using |
| 10868 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 10869 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 10870 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10871 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10872 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10873 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 10874 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10875 | -p "$P_PXY mtu=508" \ |
| 10876 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10877 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10878 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10879 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10880 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10881 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10882 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10883 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10884 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10885 | 0 \ |
| 10886 | -s "found fragmented DTLS handshake message" \ |
| 10887 | -c "found fragmented DTLS handshake message" \ |
| 10888 | -C "error" |
| 10889 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10890 | # 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] | 10891 | only_with_valgrind |
| 10892 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10893 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10894 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 10895 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10896 | -p "$P_PXY mtu=508" \ |
| 10897 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10898 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10899 | key_file=$DATA_FILES_PATH/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10900 | hs_timeout=250-10000" \ |
| 10901 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10902 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10903 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10904 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10905 | hs_timeout=250-10000" \ |
| 10906 | 0 \ |
| 10907 | -s "found fragmented DTLS handshake message" \ |
| 10908 | -c "found fragmented DTLS handshake message" \ |
| 10909 | -C "error" |
| 10910 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10911 | # 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] | 10912 | # OTOH the client might resend if the server is to slow to reset after sending |
| 10913 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10914 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10915 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10916 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10917 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10918 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10919 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10920 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10921 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10922 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10923 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10924 | hs_timeout=10000-60000 \ |
| 10925 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10926 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10927 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10928 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10929 | hs_timeout=10000-60000 \ |
| 10930 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10931 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10932 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10933 | -s "found fragmented DTLS handshake message" \ |
| 10934 | -c "found fragmented DTLS handshake message" \ |
| 10935 | -C "error" |
| 10936 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10937 | # 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] | 10938 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 10939 | # OTOH the client might resend if the server is to slow to reset after sending |
| 10940 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10941 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10942 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10943 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10944 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10945 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10946 | -p "$P_PXY mtu=512" \ |
| 10947 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10948 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10949 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10950 | hs_timeout=10000-60000 \ |
| 10951 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10952 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10953 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10954 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10955 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10956 | hs_timeout=10000-60000 \ |
| 10957 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10958 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10959 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10960 | -s "found fragmented DTLS handshake message" \ |
| 10961 | -c "found fragmented DTLS handshake message" \ |
| 10962 | -C "error" |
| 10963 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10964 | not_with_valgrind # spurious autoreduction due to timeout |
| 10965 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10966 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10967 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10968 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10969 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10970 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10971 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10972 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10973 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10974 | hs_timeout=10000-60000 \ |
| 10975 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10976 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10977 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10978 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10979 | hs_timeout=10000-60000 \ |
| 10980 | mtu=1024 nbio=2" \ |
| 10981 | 0 \ |
| 10982 | -S "autoreduction" \ |
| 10983 | -s "found fragmented DTLS handshake message" \ |
| 10984 | -c "found fragmented DTLS handshake message" \ |
| 10985 | -C "error" |
| 10986 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10987 | # 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] | 10988 | not_with_valgrind # spurious autoreduction due to timeout |
| 10989 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10990 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10991 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10992 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 10993 | -p "$P_PXY mtu=512" \ |
| 10994 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10995 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10996 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10997 | hs_timeout=10000-60000 \ |
| 10998 | mtu=512 nbio=2" \ |
| 10999 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11000 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11001 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11002 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 11003 | hs_timeout=10000-60000 \ |
| 11004 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11005 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11006 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11007 | -s "found fragmented DTLS handshake message" \ |
| 11008 | -c "found fragmented DTLS handshake message" \ |
| 11009 | -C "error" |
| 11010 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11011 | # 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] | 11012 | # This ensures things still work after session_reset(). |
| 11013 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11014 | # Since we don't support reading fragmented ClientHello yet, |
| 11015 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 11016 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11017 | # An autoreduction on the client-side might happen if the server is |
| 11018 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 11019 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11020 | # resumed listening, which would result in a spurious autoreduction. |
| 11021 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11022 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11023 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11024 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11025 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 11026 | -p "$P_PXY mtu=1450" \ |
| 11027 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11028 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11029 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11030 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11031 | mtu=1450" \ |
| 11032 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11033 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11034 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11035 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11036 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 11037 | 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] | 11038 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11039 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11040 | -s "found fragmented DTLS handshake message" \ |
| 11041 | -c "found fragmented DTLS handshake message" \ |
| 11042 | -C "error" |
| 11043 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11044 | # An autoreduction on the client-side might happen if the server is |
| 11045 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11046 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11047 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11048 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11049 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11050 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11051 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11052 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 11053 | -p "$P_PXY mtu=512" \ |
| 11054 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11055 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11056 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11057 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11058 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11059 | mtu=512" \ |
| 11060 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11061 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11062 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11063 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Ronald Cron | 60f7666 | 2023-11-28 17:52:42 +0100 | [diff] [blame] | 11064 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11065 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11066 | mtu=512" \ |
| 11067 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11068 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11069 | -s "found fragmented DTLS handshake message" \ |
| 11070 | -c "found fragmented DTLS handshake message" \ |
| 11071 | -C "error" |
| 11072 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11073 | # An autoreduction on the client-side might happen if the server is |
| 11074 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11075 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11076 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11077 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11078 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11079 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11080 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11081 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 11082 | -p "$P_PXY mtu=512" \ |
| 11083 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11084 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11085 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11086 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11087 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11088 | mtu=512" \ |
| 11089 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11090 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11091 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11092 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11093 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11094 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11095 | mtu=512" \ |
| 11096 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11097 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11098 | -s "found fragmented DTLS handshake message" \ |
| 11099 | -c "found fragmented DTLS handshake message" \ |
| 11100 | -C "error" |
| 11101 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11102 | # An autoreduction on the client-side might happen if the server is |
| 11103 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11104 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11105 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11106 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11107 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11108 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11109 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11110 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11111 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11112 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11113 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11114 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11115 | exchanges=2 renegotiation=1 \ |
| 11116 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11117 | hs_timeout=10000-60000 \ |
| 11118 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11119 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11120 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11121 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11122 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11123 | hs_timeout=10000-60000 \ |
| 11124 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11125 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11126 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11127 | -s "found fragmented DTLS handshake message" \ |
| 11128 | -c "found fragmented DTLS handshake message" \ |
| 11129 | -C "error" |
| 11130 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11131 | # An autoreduction on the client-side might happen if the server is |
| 11132 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11133 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11134 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11135 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11136 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11137 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11138 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11139 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11140 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11141 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11142 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11143 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11144 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11145 | exchanges=2 renegotiation=1 \ |
| 11146 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11147 | hs_timeout=10000-60000 \ |
| 11148 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11149 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11150 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11151 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11152 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11153 | hs_timeout=10000-60000 \ |
| 11154 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11155 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11156 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11157 | -s "found fragmented DTLS handshake message" \ |
| 11158 | -c "found fragmented DTLS handshake message" \ |
| 11159 | -C "error" |
| 11160 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11161 | # An autoreduction on the client-side might happen if the server is |
| 11162 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11163 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11164 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11165 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11166 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11167 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11168 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11169 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11170 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11171 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11172 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11173 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11174 | exchanges=2 renegotiation=1 \ |
| 11175 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11176 | hs_timeout=10000-60000 \ |
| 11177 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11178 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11179 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11180 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11181 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11182 | hs_timeout=10000-60000 \ |
| 11183 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11184 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11185 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11186 | -s "found fragmented DTLS handshake message" \ |
| 11187 | -c "found fragmented DTLS handshake message" \ |
| 11188 | -C "error" |
| 11189 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11190 | # 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] | 11191 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11192 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11193 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11194 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11195 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 11196 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11197 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11198 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11199 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11200 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11201 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11202 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11203 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11204 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11205 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11206 | 0 \ |
| 11207 | -s "found fragmented DTLS handshake message" \ |
| 11208 | -c "found fragmented DTLS handshake message" \ |
| 11209 | -C "error" |
| 11210 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11211 | # 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] | 11212 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11213 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11214 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11215 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11216 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 11217 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 11218 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11219 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11220 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11221 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 11222 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11223 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11224 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11225 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11226 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 11227 | 0 \ |
| 11228 | -s "found fragmented DTLS handshake message" \ |
| 11229 | -c "found fragmented DTLS handshake message" \ |
| 11230 | -C "error" |
| 11231 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11232 | # interop tests for DTLS fragmentating with reliable connection |
| 11233 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11234 | # here and below we just want to test that the we fragment in a way that |
| 11235 | # pleases other implementations, so we don't need the peer to fragment |
| 11236 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11237 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 11238 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11239 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11240 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 11241 | "$G_SRV -u" \ |
| 11242 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11243 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11244 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11245 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11246 | 0 \ |
| 11247 | -c "fragmenting handshake message" \ |
| 11248 | -C "error" |
| 11249 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 11250 | # We use --insecure for the GnuTLS client because it expects |
| 11251 | # the hostname / IP it connects to to be the name used in the |
| 11252 | # certificate obtained from the server. Here, however, it |
| 11253 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 11254 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 11255 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 11256 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11257 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11258 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 11259 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 11260 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11261 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11262 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Valerio Setti | 3b2c028 | 2023-03-08 10:22:29 +0100 | [diff] [blame] | 11263 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11264 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11265 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11266 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 11267 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11268 | 0 \ |
| 11269 | -s "fragmenting handshake message" |
| 11270 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11271 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11272 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11273 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11274 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 11275 | "$O_SRV -dtls1_2 -verify 10" \ |
| 11276 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11277 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11278 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11279 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11280 | 0 \ |
| 11281 | -c "fragmenting handshake message" \ |
| 11282 | -C "error" |
| 11283 | |
| 11284 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11285 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11286 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11287 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 11288 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11289 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11290 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11291 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11292 | "$O_CLI -dtls1_2" \ |
| 11293 | 0 \ |
| 11294 | -s "fragmenting handshake message" |
| 11295 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11296 | # interop tests for DTLS fragmentating with unreliable connection |
| 11297 | # |
| 11298 | # again we just want to test that the we fragment in a way that |
| 11299 | # pleases other implementations, so we don't need the peer to fragment |
| 11300 | requires_gnutls_next |
| 11301 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11302 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11303 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11304 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11305 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 11306 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11307 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11308 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11309 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11310 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11311 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11312 | 0 \ |
| 11313 | -c "fragmenting handshake message" \ |
| 11314 | -C "error" |
| 11315 | |
| 11316 | requires_gnutls_next |
| 11317 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11318 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11319 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11320 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11321 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 11322 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11323 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11324 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11325 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11326 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11327 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11328 | 0 \ |
| 11329 | -s "fragmenting handshake message" |
| 11330 | |
Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 11331 | ## The test below requires 1.1.1a or higher version of openssl, otherwise |
| 11332 | ## 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] | 11333 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11334 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11335 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11336 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11337 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11338 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 11339 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11340 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11341 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11342 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11343 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11344 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11345 | 0 \ |
| 11346 | -c "fragmenting handshake message" \ |
| 11347 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11348 | |
Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 11349 | ## the test below will time out with certain seed. |
Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 11350 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 11351 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11352 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11353 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11354 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11355 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11356 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 11357 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11358 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11359 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11360 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11361 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11362 | "$O_CLI -dtls1_2" \ |
| 11363 | 0 \ |
| 11364 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11365 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11366 | # Tests for DTLS-SRTP (RFC 5764) |
| 11367 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11368 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11369 | run_test "DTLS-SRTP all profiles supported" \ |
| 11370 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11371 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11372 | 0 \ |
| 11373 | -s "found use_srtp extension" \ |
| 11374 | -s "found srtp profile" \ |
| 11375 | -s "selected srtp profile" \ |
| 11376 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11377 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11378 | -c "client hello, adding use_srtp extension" \ |
| 11379 | -c "found use_srtp extension" \ |
| 11380 | -c "found srtp profile" \ |
| 11381 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11382 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11383 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11384 | -C "error" |
| 11385 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11386 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11387 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11388 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11389 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 11390 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11391 | "$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] | 11392 | 0 \ |
| 11393 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11394 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 11395 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11396 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11397 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11398 | -c "client hello, adding use_srtp extension" \ |
| 11399 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11400 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11401 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11402 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11403 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11404 | -C "error" |
| 11405 | |
| 11406 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11407 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11408 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11409 | "$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] | 11410 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11411 | 0 \ |
| 11412 | -s "found use_srtp extension" \ |
| 11413 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11414 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11415 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11416 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11417 | -c "client hello, adding use_srtp extension" \ |
| 11418 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11419 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11420 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11421 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11422 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11423 | -C "error" |
| 11424 | |
| 11425 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11426 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11427 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 11428 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11429 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11430 | 0 \ |
| 11431 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11432 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11433 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11434 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11435 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11436 | -c "client hello, adding use_srtp extension" \ |
| 11437 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11438 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11439 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11440 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11441 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11442 | -C "error" |
| 11443 | |
| 11444 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11445 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11446 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 11447 | "$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] | 11448 | "$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] | 11449 | 0 \ |
| 11450 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11451 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11452 | -S "selected srtp profile" \ |
| 11453 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11454 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11455 | -c "client hello, adding use_srtp extension" \ |
| 11456 | -C "found use_srtp extension" \ |
| 11457 | -C "found srtp profile" \ |
| 11458 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11459 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11460 | -C "error" |
| 11461 | |
| 11462 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11463 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11464 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 11465 | "$P_SRV dtls=1 debug_level=3" \ |
| 11466 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11467 | 0 \ |
| 11468 | -s "found use_srtp extension" \ |
| 11469 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11470 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11471 | -c "client hello, adding use_srtp extension" \ |
| 11472 | -C "found use_srtp extension" \ |
| 11473 | -C "found srtp profile" \ |
| 11474 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11475 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11476 | -C "error" |
| 11477 | |
| 11478 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11479 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11480 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 11481 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 11482 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11483 | 0 \ |
| 11484 | -s "found use_srtp extension" \ |
| 11485 | -s "found srtp profile" \ |
| 11486 | -s "selected srtp profile" \ |
| 11487 | -s "server hello, adding use_srtp extension" \ |
| 11488 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11489 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11490 | -c "client hello, adding use_srtp extension" \ |
| 11491 | -c "found use_srtp extension" \ |
| 11492 | -c "found srtp profile" \ |
| 11493 | -c "selected srtp profile" \ |
| 11494 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11495 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11496 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11497 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 11498 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11499 | -C "error" |
| 11500 | |
| 11501 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11502 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11503 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 11504 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11505 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11506 | 0 \ |
| 11507 | -s "found use_srtp extension" \ |
| 11508 | -s "found srtp profile" \ |
| 11509 | -s "selected srtp profile" \ |
| 11510 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11511 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 11512 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11513 | -S "dumping 'using mki' (8 bytes)" \ |
| 11514 | -c "client hello, adding use_srtp extension" \ |
| 11515 | -c "found use_srtp extension" \ |
| 11516 | -c "found srtp profile" \ |
| 11517 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11518 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 11519 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11520 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11521 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11522 | -C "dumping 'received mki' (8 bytes)" \ |
| 11523 | -C "error" |
| 11524 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11525 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11527 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 11528 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11529 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11530 | 0 \ |
| 11531 | -s "found use_srtp extension" \ |
| 11532 | -s "found srtp profile" \ |
| 11533 | -s "selected srtp profile" \ |
| 11534 | -s "server hello, adding use_srtp extension" \ |
| 11535 | -s "DTLS-SRTP key material is"\ |
| 11536 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11537 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 11538 | |
| 11539 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11540 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11541 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 11542 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11543 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11544 | 0 \ |
| 11545 | -s "found use_srtp extension" \ |
| 11546 | -s "found srtp profile" \ |
| 11547 | -s "selected srtp profile" \ |
| 11548 | -s "server hello, adding use_srtp extension" \ |
| 11549 | -s "DTLS-SRTP key material is"\ |
| 11550 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11551 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11552 | |
| 11553 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11554 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11555 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 11556 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11557 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11558 | 0 \ |
| 11559 | -s "found use_srtp extension" \ |
| 11560 | -s "found srtp profile" \ |
| 11561 | -s "selected srtp profile" \ |
| 11562 | -s "server hello, adding use_srtp extension" \ |
| 11563 | -s "DTLS-SRTP key material is"\ |
| 11564 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11565 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11566 | |
| 11567 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11568 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11569 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 11570 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11571 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11572 | 0 \ |
| 11573 | -s "found use_srtp extension" \ |
| 11574 | -s "found srtp profile" \ |
| 11575 | -s "selected srtp profile" \ |
| 11576 | -s "server hello, adding use_srtp extension" \ |
| 11577 | -s "DTLS-SRTP key material is"\ |
| 11578 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11579 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11580 | |
| 11581 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11582 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11583 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 11584 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11585 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11586 | 0 \ |
| 11587 | -s "found use_srtp extension" \ |
| 11588 | -s "found srtp profile" \ |
| 11589 | -s "selected srtp profile" \ |
| 11590 | -s "server hello, adding use_srtp extension" \ |
| 11591 | -s "DTLS-SRTP key material is"\ |
| 11592 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11593 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11594 | |
| 11595 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11596 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11597 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 11598 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 11599 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11600 | 0 \ |
| 11601 | -s "found use_srtp extension" \ |
| 11602 | -s "found srtp profile" \ |
| 11603 | -S "selected srtp profile" \ |
| 11604 | -S "server hello, adding use_srtp extension" \ |
| 11605 | -S "DTLS-SRTP key material is"\ |
| 11606 | -C "SRTP Extension negotiated, profile" |
| 11607 | |
| 11608 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11609 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11610 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 11611 | "$P_SRV dtls=1 debug_level=3" \ |
| 11612 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11613 | 0 \ |
| 11614 | -s "found use_srtp extension" \ |
| 11615 | -S "server hello, adding use_srtp extension" \ |
| 11616 | -S "DTLS-SRTP key material is"\ |
| 11617 | -C "SRTP Extension negotiated, profile" |
| 11618 | |
| 11619 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11620 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11621 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 11622 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11623 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11624 | 0 \ |
| 11625 | -c "client hello, adding use_srtp extension" \ |
| 11626 | -c "found use_srtp extension" \ |
| 11627 | -c "found srtp profile" \ |
| 11628 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 11629 | -c "DTLS-SRTP key material is"\ |
| 11630 | -C "error" |
| 11631 | |
| 11632 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11633 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11634 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 11635 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11636 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 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" \ |
| 11642 | -c "DTLS-SRTP key material is"\ |
| 11643 | -C "error" |
| 11644 | |
| 11645 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11646 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11647 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 11648 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11649 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11650 | 0 \ |
| 11651 | -c "client hello, adding use_srtp extension" \ |
| 11652 | -c "found use_srtp extension" \ |
| 11653 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11654 | -c "selected srtp profile" \ |
| 11655 | -c "DTLS-SRTP key material is"\ |
| 11656 | -C "error" |
| 11657 | |
| 11658 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11659 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11660 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 11661 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11662 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11663 | 0 \ |
| 11664 | -c "client hello, adding use_srtp extension" \ |
| 11665 | -c "found use_srtp extension" \ |
| 11666 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11667 | -c "selected srtp profile" \ |
| 11668 | -c "DTLS-SRTP key material is"\ |
| 11669 | -C "error" |
| 11670 | |
| 11671 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11672 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11673 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 11674 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11675 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11676 | 0 \ |
| 11677 | -c "client hello, adding use_srtp extension" \ |
| 11678 | -c "found use_srtp extension" \ |
| 11679 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11680 | -c "selected srtp profile" \ |
| 11681 | -c "DTLS-SRTP key material is"\ |
| 11682 | -C "error" |
| 11683 | |
| 11684 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11685 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11686 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 11687 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11688 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 11689 | 0 \ |
| 11690 | -c "client hello, adding use_srtp extension" \ |
| 11691 | -C "found use_srtp extension" \ |
| 11692 | -C "found srtp profile" \ |
| 11693 | -C "selected srtp profile" \ |
| 11694 | -C "DTLS-SRTP key material is"\ |
| 11695 | -C "error" |
| 11696 | |
| 11697 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11698 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11699 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 11700 | "$O_SRV -dtls" \ |
| 11701 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11702 | 0 \ |
| 11703 | -c "client hello, adding use_srtp extension" \ |
| 11704 | -C "found use_srtp extension" \ |
| 11705 | -C "found srtp profile" \ |
| 11706 | -C "selected srtp profile" \ |
| 11707 | -C "DTLS-SRTP key material is"\ |
| 11708 | -C "error" |
| 11709 | |
| 11710 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11711 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11712 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 11713 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11714 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11715 | 0 \ |
| 11716 | -c "client hello, adding use_srtp extension" \ |
| 11717 | -c "found use_srtp extension" \ |
| 11718 | -c "found srtp profile" \ |
| 11719 | -c "selected srtp profile" \ |
| 11720 | -c "DTLS-SRTP key material is"\ |
| 11721 | -c "DTLS-SRTP no mki value negotiated"\ |
| 11722 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11723 | -C "dumping 'received mki' (8 bytes)" \ |
| 11724 | -C "error" |
| 11725 | |
| 11726 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11727 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11728 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11729 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11730 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11731 | "$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] | 11732 | 0 \ |
| 11733 | -s "found use_srtp extension" \ |
| 11734 | -s "found srtp profile" \ |
| 11735 | -s "selected srtp profile" \ |
| 11736 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11737 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11738 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 11739 | |
| 11740 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11741 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11742 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11743 | 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] | 11744 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11745 | "$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] | 11746 | 0 \ |
| 11747 | -s "found use_srtp extension" \ |
| 11748 | -s "found srtp profile" \ |
| 11749 | -s "selected srtp profile" \ |
| 11750 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11751 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11752 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 11753 | |
| 11754 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11755 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11756 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11757 | 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] | 11758 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11759 | "$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] | 11760 | 0 \ |
| 11761 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11762 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11763 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11764 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11765 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11766 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 11767 | |
| 11768 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11769 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11770 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11771 | 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] | 11772 | "$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] | 11773 | "$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] | 11774 | 0 \ |
| 11775 | -s "found use_srtp extension" \ |
| 11776 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11777 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11778 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11779 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11780 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 11781 | |
| 11782 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11783 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11784 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11785 | 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] | 11786 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11787 | "$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] | 11788 | 0 \ |
| 11789 | -s "found use_srtp extension" \ |
| 11790 | -s "found srtp profile" \ |
| 11791 | -s "selected srtp profile" \ |
| 11792 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11793 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11794 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 11795 | |
| 11796 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11797 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11798 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11799 | 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] | 11800 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 11801 | "$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] | 11802 | 0 \ |
| 11803 | -s "found use_srtp extension" \ |
| 11804 | -s "found srtp profile" \ |
| 11805 | -S "selected srtp profile" \ |
| 11806 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11807 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11808 | -C "SRTP profile:" |
| 11809 | |
| 11810 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11811 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11812 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11813 | 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] | 11814 | "$P_SRV dtls=1 debug_level=3" \ |
| 11815 | "$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] | 11816 | 0 \ |
| 11817 | -s "found use_srtp extension" \ |
| 11818 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11819 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11820 | -C "SRTP profile:" |
| 11821 | |
| 11822 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11823 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11824 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11825 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 11826 | "$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" \ |
| 11827 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11828 | 0 \ |
| 11829 | -c "client hello, adding use_srtp extension" \ |
| 11830 | -c "found use_srtp extension" \ |
| 11831 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11832 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11833 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11834 | -C "error" |
| 11835 | |
| 11836 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11837 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11838 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11839 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 11840 | "$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" \ |
| 11841 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11842 | 0 \ |
| 11843 | -c "client hello, adding use_srtp extension" \ |
| 11844 | -c "found use_srtp extension" \ |
| 11845 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11846 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11847 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11848 | -C "error" |
| 11849 | |
| 11850 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11851 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11852 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11853 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 11854 | "$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" \ |
| 11855 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11856 | 0 \ |
| 11857 | -c "client hello, adding use_srtp extension" \ |
| 11858 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11859 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11860 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11861 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11862 | -C "error" |
| 11863 | |
| 11864 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11865 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11866 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11867 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 11868 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11869 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11870 | 0 \ |
| 11871 | -c "client hello, adding use_srtp extension" \ |
| 11872 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11873 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11874 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11875 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11876 | -C "error" |
| 11877 | |
| 11878 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11879 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11880 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11881 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 11882 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11883 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11884 | 0 \ |
| 11885 | -c "client hello, adding use_srtp extension" \ |
| 11886 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11887 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11888 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11889 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11890 | -C "error" |
| 11891 | |
| 11892 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11893 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11895 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 11896 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11897 | "$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] | 11898 | 0 \ |
| 11899 | -c "client hello, adding use_srtp extension" \ |
| 11900 | -C "found use_srtp extension" \ |
| 11901 | -C "found srtp profile" \ |
| 11902 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11903 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11904 | -C "error" |
| 11905 | |
| 11906 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11907 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11908 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11909 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 11910 | "$G_SRV -u" \ |
| 11911 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11912 | 0 \ |
| 11913 | -c "client hello, adding use_srtp extension" \ |
| 11914 | -C "found use_srtp extension" \ |
| 11915 | -C "found srtp profile" \ |
| 11916 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11917 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11918 | -C "error" |
| 11919 | |
| 11920 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11921 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11922 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11923 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 11924 | "$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" \ |
| 11925 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11926 | 0 \ |
| 11927 | -c "client hello, adding use_srtp extension" \ |
| 11928 | -c "found use_srtp extension" \ |
| 11929 | -c "found srtp profile" \ |
| 11930 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11931 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 11932 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11933 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11934 | -c "dumping 'received mki' (8 bytes)" \ |
| 11935 | -C "error" |
| 11936 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 11937 | # Tests for specific things with "unreliable" UDP connection |
| 11938 | |
| 11939 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11940 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 11941 | run_test "DTLS proxy: reference" \ |
| 11942 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 11943 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 11944 | "$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] | 11945 | 0 \ |
| 11946 | -C "replayed record" \ |
| 11947 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 11948 | -C "Buffer record from epoch" \ |
| 11949 | -S "Buffer record from epoch" \ |
| 11950 | -C "ssl_buffer_message" \ |
| 11951 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 11952 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11953 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 11954 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11955 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 11956 | -c "HTTP/1.0 200 OK" |
| 11957 | |
| 11958 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11959 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11960 | run_test "DTLS proxy: duplicate every packet" \ |
| 11961 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 11962 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 11963 | "$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] | 11964 | 0 \ |
| 11965 | -c "replayed record" \ |
| 11966 | -s "replayed record" \ |
| 11967 | -c "record from another epoch" \ |
| 11968 | -s "record from another epoch" \ |
| 11969 | -S "resend" \ |
| 11970 | -s "Extra-header:" \ |
| 11971 | -c "HTTP/1.0 200 OK" |
| 11972 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11973 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11974 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 11975 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11976 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 11977 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 11978 | 0 \ |
| 11979 | -c "replayed record" \ |
| 11980 | -S "replayed record" \ |
| 11981 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11982 | -s "record from another epoch" \ |
| 11983 | -c "resend" \ |
| 11984 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11985 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11986 | -c "HTTP/1.0 200 OK" |
| 11987 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11988 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11989 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 11990 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11991 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 11992 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 11993 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11994 | -c "next record in same datagram" \ |
| 11995 | -s "next record in same datagram" |
| 11996 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11997 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11998 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 11999 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12000 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 12001 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 12002 | 0 \ |
| 12003 | -c "next record in same datagram" \ |
| 12004 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12005 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12006 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 12007 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 12008 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12009 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 12010 | "$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] | 12011 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12012 | -c "discarding invalid record (mac)" \ |
| 12013 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12014 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12015 | -c "HTTP/1.0 200 OK" \ |
| 12016 | -S "too many records with bad MAC" \ |
| 12017 | -S "Verification of the message MAC failed" |
| 12018 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12019 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12020 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 12021 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12022 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 12023 | "$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] | 12024 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12025 | -C "discarding invalid record (mac)" \ |
| 12026 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12027 | -S "Extra-header:" \ |
| 12028 | -C "HTTP/1.0 200 OK" \ |
| 12029 | -s "too many records with bad MAC" \ |
| 12030 | -s "Verification of the message MAC failed" |
| 12031 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12032 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12033 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 12034 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12035 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 12036 | "$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] | 12037 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12038 | -c "discarding invalid record (mac)" \ |
| 12039 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12040 | -s "Extra-header:" \ |
| 12041 | -c "HTTP/1.0 200 OK" \ |
| 12042 | -S "too many records with bad MAC" \ |
| 12043 | -S "Verification of the message MAC failed" |
| 12044 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12045 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12046 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 12047 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12048 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 12049 | "$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] | 12050 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12051 | -c "discarding invalid record (mac)" \ |
| 12052 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12053 | -s "Extra-header:" \ |
| 12054 | -c "HTTP/1.0 200 OK" \ |
| 12055 | -s "too many records with bad MAC" \ |
| 12056 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12057 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12058 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12059 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 12060 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 12061 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 12062 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12063 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 12064 | -c "record from another epoch" \ |
| 12065 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12066 | -s "Extra-header:" \ |
| 12067 | -c "HTTP/1.0 200 OK" |
| 12068 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 12069 | # Tests for reordering support with DTLS |
| 12070 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12071 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12073 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 12074 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12075 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12076 | hs_timeout=2500-60000" \ |
| 12077 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12078 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 12079 | 0 \ |
| 12080 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12081 | -c "Next handshake message has been buffered - load"\ |
| 12082 | -S "Buffering HS message" \ |
| 12083 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12084 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12085 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12086 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12087 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 12088 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12089 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12090 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12091 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 12092 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12093 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12094 | hs_timeout=2500-60000" \ |
| 12095 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12096 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12097 | 0 \ |
| 12098 | -c "Buffering HS message" \ |
| 12099 | -c "found fragmented DTLS handshake message"\ |
| 12100 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 12101 | -c "Next handshake message has been buffered - load"\ |
| 12102 | -S "Buffering HS message" \ |
| 12103 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12104 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12105 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12106 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 12107 | -S "Remember CCS message" |
| 12108 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12109 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 12110 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 12111 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 12112 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12113 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12114 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12115 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12116 | 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] | 12117 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12118 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12119 | hs_timeout=2500-60000" \ |
| 12120 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12121 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12122 | 0 \ |
| 12123 | -c "Buffering HS message" \ |
| 12124 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12125 | -C "attempt to make space by freeing buffered messages" \ |
| 12126 | -S "Buffering HS message" \ |
| 12127 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12128 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12129 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12130 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12131 | -S "Remember CCS message" |
| 12132 | |
| 12133 | # The size constraints ensure that the delayed certificate message can't |
| 12134 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 12135 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12136 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12137 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 12138 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12139 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12140 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 12141 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12142 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12143 | hs_timeout=2500-60000" \ |
| 12144 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12145 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12146 | 0 \ |
| 12147 | -c "Buffering HS message" \ |
| 12148 | -c "attempt to make space by freeing buffered future messages" \ |
| 12149 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12150 | -S "Buffering HS message" \ |
| 12151 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12152 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12153 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12154 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12155 | -S "Remember CCS message" |
| 12156 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12157 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12158 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12159 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 12160 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12161 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 12162 | hs_timeout=2500-60000" \ |
| 12163 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12164 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12165 | 0 \ |
| 12166 | -C "Buffering HS message" \ |
| 12167 | -C "Next handshake message has been buffered - load"\ |
| 12168 | -s "Buffering HS message" \ |
| 12169 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12170 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12171 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12172 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12173 | -S "Remember CCS message" |
| 12174 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12175 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12176 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12177 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12178 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 12179 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12180 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12181 | hs_timeout=2500-60000" \ |
| 12182 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12183 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12184 | 0 \ |
| 12185 | -C "Buffering HS message" \ |
| 12186 | -C "Next handshake message has been buffered - load"\ |
| 12187 | -S "Buffering HS message" \ |
| 12188 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12189 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12190 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12191 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12192 | -S "Remember CCS message" |
| 12193 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12194 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12195 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12196 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 12197 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12198 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12199 | hs_timeout=2500-60000" \ |
| 12200 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12201 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12202 | 0 \ |
| 12203 | -C "Buffering HS message" \ |
| 12204 | -C "Next handshake message has been buffered - load"\ |
| 12205 | -S "Buffering HS message" \ |
| 12206 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12207 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12208 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12209 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12210 | -s "Remember CCS message" |
| 12211 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12213 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12214 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12215 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12216 | hs_timeout=2500-60000" \ |
| 12217 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12218 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 12219 | 0 \ |
| 12220 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12221 | -s "Found buffered record from current epoch - load" \ |
| 12222 | -c "Buffer record from epoch 1" \ |
| 12223 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12224 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12225 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 12226 | # from the server are delayed, so that the encrypted Finished message |
| 12227 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 12228 | # in afterwards, the encrypted Finished message must be freed in order |
| 12229 | # to make space for the NewSessionTicket to be reassembled. |
| 12230 | # This works only in very particular circumstances: |
| 12231 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 12232 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 12233 | # the encrypted Finished message. |
| 12234 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 12235 | # needs to be fragmented. |
| 12236 | # - All messages sent by the server must be small enough to be either sent |
| 12237 | # without fragmentation or be reassembled within the bounds of |
| 12238 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 12239 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 12240 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 12241 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12242 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 12243 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12244 | "$P_SRV mtu=140 response_size=90 dgram_packing=0 psk=73776f726466697368 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 12245 | "$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] | 12246 | 0 \ |
| 12247 | -s "Buffer record from epoch 1" \ |
| 12248 | -s "Found buffered record from current epoch - load" \ |
| 12249 | -c "Buffer record from epoch 1" \ |
| 12250 | -C "Found buffered record from current epoch - load" \ |
| 12251 | -c "Enough space available after freeing future epoch record" |
| 12252 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 12253 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 12254 | |
| 12255 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12256 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 12257 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Gilles Peskine | 4c1347c | 2024-09-07 19:50:46 +0200 | [diff] [blame] | 12258 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12259 | psk=73776f726466697368" \ |
| 12260 | "$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] | 12261 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12262 | 0 \ |
| 12263 | -s "Extra-header:" \ |
| 12264 | -c "HTTP/1.0 200 OK" |
| 12265 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12266 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12267 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 12268 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12269 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 12270 | "$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] | 12271 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 12272 | 0 \ |
| 12273 | -s "Extra-header:" \ |
| 12274 | -c "HTTP/1.0 200 OK" |
| 12275 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12276 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12277 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12278 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 12279 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12280 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 12281 | "$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] | 12282 | 0 \ |
| 12283 | -s "Extra-header:" \ |
| 12284 | -c "HTTP/1.0 200 OK" |
| 12285 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12286 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12287 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12288 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 12289 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12290 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 12291 | "$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] | 12292 | 0 \ |
| 12293 | -s "Extra-header:" \ |
| 12294 | -c "HTTP/1.0 200 OK" |
| 12295 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12296 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12297 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12298 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12299 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 12300 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12301 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 12302 | "$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] | 12303 | 0 \ |
| 12304 | -s "Extra-header:" \ |
| 12305 | -c "HTTP/1.0 200 OK" |
| 12306 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12307 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12308 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12309 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12310 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 12311 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12312 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 12313 | "$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] | 12314 | 0 \ |
| 12315 | -s "Extra-header:" \ |
| 12316 | -c "HTTP/1.0 200 OK" |
| 12317 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12318 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12319 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12320 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12321 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 12322 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12323 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 nbio=2 tickets=1 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 12324 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12325 | "$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] | 12326 | 0 \ |
| 12327 | -s "Extra-header:" \ |
| 12328 | -c "HTTP/1.0 200 OK" |
| 12329 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12330 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 12331 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 12332 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 12333 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12334 | "$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] | 12335 | psk=73776f726466697368 debug_level=3" \ |
| 12336 | "$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] | 12337 | 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] | 12338 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12339 | 0 \ |
| 12340 | -s "a session has been resumed" \ |
| 12341 | -c "a session has been resumed" \ |
| 12342 | -s "Extra-header:" \ |
| 12343 | -c "HTTP/1.0 200 OK" |
| 12344 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12345 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 12346 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 12347 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 12348 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12349 | "$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] | 12350 | psk=73776f726466697368 debug_level=3 nbio=2" \ |
| 12351 | "$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] | 12352 | 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] | 12353 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 12354 | 0 \ |
| 12355 | -s "a session has been resumed" \ |
| 12356 | -c "a session has been resumed" \ |
| 12357 | -s "Extra-header:" \ |
| 12358 | -c "HTTP/1.0 200 OK" |
| 12359 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12360 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12361 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12362 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 12363 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12364 | "$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] | 12365 | psk=73776f726466697368 renegotiation=1 debug_level=2" \ |
| 12366 | "$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] | 12367 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 12368 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12369 | 0 \ |
| 12370 | -c "=> renegotiate" \ |
| 12371 | -s "=> renegotiate" \ |
| 12372 | -s "Extra-header:" \ |
| 12373 | -c "HTTP/1.0 200 OK" |
| 12374 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12375 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12376 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12377 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 12378 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12379 | "$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] | 12380 | psk=73776f726466697368 renegotiation=1 debug_level=2" \ |
| 12381 | "$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] | 12382 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12383 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12384 | 0 \ |
| 12385 | -c "=> renegotiate" \ |
| 12386 | -s "=> renegotiate" \ |
| 12387 | -s "Extra-header:" \ |
| 12388 | -c "HTTP/1.0 200 OK" |
| 12389 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12390 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12391 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12392 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 12393 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12394 | "$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] | 12395 | psk=73776f726466697368 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12396 | debug_level=2" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12397 | "$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] | 12398 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12399 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12400 | 0 \ |
| 12401 | -c "=> renegotiate" \ |
| 12402 | -s "=> renegotiate" \ |
| 12403 | -s "Extra-header:" \ |
| 12404 | -c "HTTP/1.0 200 OK" |
| 12405 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12406 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12407 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12408 | 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] | 12409 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12410 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12411 | psk=73776f726466697368 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12412 | debug_level=2 nbio=2" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12413 | "$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] | 12414 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12415 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12416 | 0 \ |
| 12417 | -c "=> renegotiate" \ |
| 12418 | -s "=> renegotiate" \ |
| 12419 | -s "Extra-header:" \ |
| 12420 | -c "HTTP/1.0 200 OK" |
| 12421 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12422 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 12423 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 12424 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error |
| 12425 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12426 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12427 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12428 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12429 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 12430 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 12431 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ |
| 12432 | "$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] | 12433 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 12434 | -c "HTTP/1.0 200 OK" |
| 12435 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12436 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12437 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12438 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12439 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12440 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 12441 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12442 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12443 | "$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] | 12444 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12445 | -c "HTTP/1.0 200 OK" |
| 12446 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12447 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12448 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12449 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12450 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12451 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 12452 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12453 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12454 | "$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] | 12455 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12456 | -c "HTTP/1.0 200 OK" |
| 12457 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 12458 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12459 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12460 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12461 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12462 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 12463 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 12464 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12465 | "$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] | 12466 | 0 \ |
| 12467 | -s "Extra-header:" \ |
| 12468 | -c "Extra-header:" |
| 12469 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12470 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12471 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12472 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12473 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12474 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 12475 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12476 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12477 | "$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] | 12478 | 0 \ |
| 12479 | -s "Extra-header:" \ |
| 12480 | -c "Extra-header:" |
| 12481 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12482 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12483 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12484 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12485 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12486 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 12487 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12488 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12489 | "$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] | 12490 | 0 \ |
| 12491 | -s "Extra-header:" \ |
| 12492 | -c "Extra-header:" |
| 12493 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12495 | run_test "export keys functionality" \ |
| 12496 | "$P_SRV eap_tls=1 debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 12497 | "$P_CLI force_version=tls12 eap_tls=1 debug_level=3" \ |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12498 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 12499 | -c "EAP-TLS key material is:"\ |
| 12500 | -s "EAP-TLS key material is:"\ |
| 12501 | -c "EAP-TLS IV is:" \ |
| 12502 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12503 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 12504 | # openssl feature tests: check if tls1.3 exists. |
| 12505 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12506 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 12507 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 12508 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 12509 | 0 \ |
| 12510 | -c "TLS 1.3" \ |
| 12511 | -s "TLS 1.3" |
| 12512 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 12513 | # 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] | 12514 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 12515 | requires_gnutls_next_no_ticket |
| 12516 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12517 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 12518 | "$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] | 12519 | "$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] | 12520 | 0 \ |
| 12521 | -s "Version: TLS1.3" \ |
| 12522 | -c "Version: TLS1.3" |
| 12523 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 12524 | # TLS1.3 test cases |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12525 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12526 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12527 | requires_ciphersuite_enabled TLS1-3-CHACHA20-POLY1305-SHA256 |
Valerio Setti | cf29c5d | 2023-09-01 09:03:41 +0200 | [diff] [blame] | 12528 | requires_any_configs_enabled "PSA_WANT_ECC_MONTGOMERY_255" |
| 12529 | requires_any_configs_enabled "PSA_WANT_ECC_SECP_R1_256" |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12530 | run_test "TLS 1.3: Default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12531 | "$P_SRV allow_sha1=0 debug_level=3 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key force_version=tls13" \ |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12532 | "$P_CLI allow_sha1=0" \ |
| 12533 | 0 \ |
| 12534 | -s "Protocol is TLSv1.3" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12535 | -s "Ciphersuite is TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12536 | -s "ECDH/FFDH group: " \ |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12537 | -s "selected signature algorithm ecdsa_secp256r1_sha256" |
| 12538 | |
Ronald Cron | 587cfe6 | 2024-02-08 08:56:09 +0100 | [diff] [blame] | 12539 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12540 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12541 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 12542 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 12543 | run_test "Establish TLS 1.2 then TLS 1.3 session" \ |
| 12544 | "$P_SRV" \ |
| 12545 | "( $P_CLI force_version=tls12; \ |
| 12546 | $P_CLI force_version=tls13 )" \ |
| 12547 | 0 \ |
| 12548 | -s "Protocol is TLSv1.2" \ |
| 12549 | -s "Protocol is TLSv1.3" \ |
| 12550 | |
Ronald Cron | 90abb22 | 2024-02-08 09:02:49 +0100 | [diff] [blame] | 12551 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12552 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12553 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 12554 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 12555 | run_test "Establish TLS 1.3 then TLS 1.2 session" \ |
| 12556 | "$P_SRV" \ |
| 12557 | "( $P_CLI force_version=tls13; \ |
| 12558 | $P_CLI force_version=tls12 )" \ |
| 12559 | 0 \ |
| 12560 | -s "Protocol is TLSv1.3" \ |
| 12561 | -s "Protocol is TLSv1.2" \ |
| 12562 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12563 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12564 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12565 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12566 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12567 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12568 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12569 | "$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] | 12570 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 12571 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12572 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12573 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12574 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12575 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12576 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12577 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12578 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12579 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12580 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12581 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12582 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12583 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12584 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12585 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12586 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 12587 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12588 | -c "=> parse certificate verify" \ |
| 12589 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12590 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12591 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 12592 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12593 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 12594 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 12595 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 12596 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12597 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12598 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12599 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12600 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12601 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12602 | "$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] | 12603 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 12604 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12605 | -s "SERVER HELLO was queued" \ |
| 12606 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12607 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12608 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12609 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12610 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12611 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12612 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12613 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12614 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12615 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12616 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12617 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12618 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12619 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12620 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 12621 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12622 | -c "=> parse certificate verify" \ |
| 12623 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12624 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12625 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 12626 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12627 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12628 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12629 | requires_openssl_tls1_3_with_compatible_ephemeral |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12630 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12631 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12632 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12633 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12634 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12635 | run_test "TLS 1.3: alpn - openssl" \ |
| 12636 | "$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] | 12637 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12638 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12639 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12640 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12641 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12642 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12643 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12644 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12645 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12646 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12647 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12648 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12649 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12650 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12651 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12652 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12653 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12654 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12655 | -c "=> parse certificate verify" \ |
| 12656 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12657 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 12658 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12659 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12660 | -c "HTTP/1.0 200 ok" \ |
| 12661 | -c "Application Layer Protocol is h2" |
| 12662 | |
| 12663 | requires_gnutls_tls1_3 |
| 12664 | requires_gnutls_next_no_ticket |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12665 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12666 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12667 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12668 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12669 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12670 | run_test "TLS 1.3: alpn - gnutls" \ |
| 12671 | "$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] | 12672 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12673 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12674 | -s "SERVER HELLO was queued" \ |
| 12675 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12676 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12677 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12678 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12679 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12680 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12681 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12682 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12683 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12684 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12685 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12686 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12687 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12688 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12689 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12690 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12691 | -c "=> parse certificate verify" \ |
| 12692 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12693 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 12694 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12695 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12696 | -c "HTTP/1.0 200 OK" \ |
| 12697 | -c "Application Layer Protocol is h2" |
| 12698 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12699 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12700 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 12701 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12702 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12703 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12704 | run_test "TLS 1.3: server alpn - openssl" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12705 | "$P_SRV debug_level=3 tickets=0 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key alpn=h2" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12706 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ |
| 12707 | 0 \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12708 | -s "found alpn extension" \ |
| 12709 | -s "server side, adding alpn extension" \ |
| 12710 | -s "Protocol is TLSv1.3" \ |
| 12711 | -s "HTTP/1.0 200 OK" \ |
| 12712 | -s "Application Layer Protocol is h2" |
| 12713 | |
| 12714 | requires_gnutls_tls1_3 |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12715 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 12716 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12717 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12718 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12719 | run_test "TLS 1.3: server alpn - gnutls" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12720 | "$P_SRV debug_level=3 tickets=0 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key alpn=h2" \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12721 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ |
| 12722 | 0 \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12723 | -s "found alpn extension" \ |
| 12724 | -s "server side, adding alpn extension" \ |
| 12725 | -s "Protocol is TLSv1.3" \ |
| 12726 | -s "HTTP/1.0 200 OK" \ |
| 12727 | -s "Application Layer Protocol is h2" |
| 12728 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12729 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12730 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12731 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12732 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12733 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12734 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12735 | "$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] | 12736 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12737 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12738 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12739 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12740 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12741 | -c "HTTP/1.0 200 ok" \ |
| 12742 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12743 | |
| 12744 | requires_gnutls_tls1_3 |
| 12745 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12746 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12747 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12748 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12749 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12750 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12751 | "$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] | 12752 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12753 | 0 \ |
| 12754 | -c "got a certificate request" \ |
| 12755 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 12756 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12757 | -c "HTTP/1.0 200 OK" \ |
| 12758 | -c "Protocol is TLSv1.3" |
| 12759 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12760 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12761 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12762 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12763 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12764 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12765 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12766 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12767 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cli2.crt key_file=$DATA_FILES_PATH/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 12768 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12769 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12770 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12771 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12772 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12773 | |
| 12774 | requires_gnutls_tls1_3 |
| 12775 | requires_gnutls_next_no_ticket |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12776 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12777 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12778 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12779 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12780 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12781 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/cli2.crt \ |
| 12782 | key_file=$DATA_FILES_PATH/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 12783 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12784 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12785 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12786 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12787 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12788 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12789 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12790 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12791 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12792 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12793 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12794 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12795 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12796 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12797 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12798 | 0 \ |
| 12799 | -c "got a certificate request" \ |
| 12800 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12801 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12802 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12803 | |
| 12804 | requires_gnutls_tls1_3 |
| 12805 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12806 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12807 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12808 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12809 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12810 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12811 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12812 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12813 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12814 | 0 \ |
| 12815 | -c "got a certificate request" \ |
| 12816 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12817 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12818 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12819 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12820 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12821 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12822 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12823 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12824 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12825 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12826 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12827 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12828 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12829 | 0 \ |
| 12830 | -c "got a certificate request" \ |
| 12831 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12832 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12833 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12834 | |
| 12835 | requires_gnutls_tls1_3 |
| 12836 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12837 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12838 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12839 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12840 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12841 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12842 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12843 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12844 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12845 | 0 \ |
| 12846 | -c "got a certificate request" \ |
| 12847 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12848 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12849 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12850 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12851 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12852 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12853 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12854 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12855 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12856 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12857 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12858 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12859 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12860 | 0 \ |
| 12861 | -c "got a certificate request" \ |
| 12862 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12863 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12864 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12865 | |
| 12866 | requires_gnutls_tls1_3 |
| 12867 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12868 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12869 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12870 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12871 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12872 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12873 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12874 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12875 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12876 | 0 \ |
| 12877 | -c "got a certificate request" \ |
| 12878 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12879 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12880 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12881 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12882 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12883 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12884 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12885 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12886 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12887 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12888 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12889 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12890 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12891 | key_file=$DATA_FILES_PATH/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12892 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12893 | -c "got a certificate request" \ |
| 12894 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12895 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12896 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12897 | |
| 12898 | requires_gnutls_tls1_3 |
| 12899 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12900 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12901 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12902 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12903 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12904 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12905 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12906 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12907 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12908 | key_file=$DATA_FILES_PATH/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12909 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12910 | -c "got a certificate request" \ |
| 12911 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12912 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12913 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12914 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12915 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12916 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12917 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12918 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12919 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12920 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12921 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 12922 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12923 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12924 | key_file=$DATA_FILES_PATH/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12925 | 0 \ |
| 12926 | -c "got a certificate request" \ |
| 12927 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12928 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12929 | -c "Protocol is TLSv1.3" |
| 12930 | |
| 12931 | requires_gnutls_tls1_3 |
| 12932 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12933 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12934 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12935 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12936 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12937 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12938 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 12939 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12940 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12941 | key_file=$DATA_FILES_PATH/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12942 | 0 \ |
| 12943 | -c "got a certificate request" \ |
| 12944 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12945 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12946 | -c "Protocol is TLSv1.3" |
| 12947 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12948 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12949 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12950 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12951 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12952 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12953 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12954 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 12955 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12956 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12957 | key_file=$DATA_FILES_PATH/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12958 | 0 \ |
| 12959 | -c "got a certificate request" \ |
| 12960 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12961 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12962 | -c "Protocol is TLSv1.3" |
| 12963 | |
| 12964 | requires_gnutls_tls1_3 |
| 12965 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12966 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12967 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12968 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12969 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12970 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12971 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 12972 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12973 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12974 | key_file=$DATA_FILES_PATH/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12975 | 0 \ |
| 12976 | -c "got a certificate request" \ |
| 12977 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12978 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12979 | -c "Protocol is TLSv1.3" |
| 12980 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12981 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12982 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12983 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12984 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12985 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12986 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 12987 | 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] | 12988 | "$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] | 12989 | -sigalgs ecdsa_secp256r1_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12990 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12991 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512" \ |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12992 | 1 \ |
| 12993 | -c "got a certificate request" \ |
| 12994 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12995 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 12996 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12997 | |
| 12998 | requires_gnutls_tls1_3 |
| 12999 | requires_gnutls_next_no_ticket |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 13000 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13001 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13002 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13003 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13004 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 13005 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 13006 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13007 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13008 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512" \ |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 13009 | 1 \ |
| 13010 | -c "got a certificate request" \ |
| 13011 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13012 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13013 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 13014 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13015 | # Test using an opaque private key for client authentication |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13016 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13017 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13018 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13019 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13020 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13021 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 13022 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13023 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cli2.crt key_file=$DATA_FILES_PATH/cli2.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13024 | 0 \ |
| 13025 | -c "got a certificate request" \ |
| 13026 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13027 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13028 | -c "Protocol is TLSv1.3" |
| 13029 | |
| 13030 | requires_gnutls_tls1_3 |
| 13031 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13032 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13033 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13034 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13035 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13036 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 13037 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13038 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/cli2.crt \ |
| 13039 | key_file=$DATA_FILES_PATH/cli2.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13040 | 0 \ |
| 13041 | -c "got a certificate request" \ |
| 13042 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13043 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13044 | -c "Protocol is TLSv1.3" |
| 13045 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13046 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13047 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13048 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13049 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13050 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13051 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13052 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 13053 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13054 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 13055 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13056 | 0 \ |
| 13057 | -c "got a certificate request" \ |
| 13058 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13059 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13060 | -c "Protocol is TLSv1.3" |
| 13061 | |
| 13062 | requires_gnutls_tls1_3 |
| 13063 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13064 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13065 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13066 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13067 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13068 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13069 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 13070 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13071 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 13072 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13073 | 0 \ |
| 13074 | -c "got a certificate request" \ |
| 13075 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13076 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13077 | -c "Protocol is TLSv1.3" |
| 13078 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13079 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13080 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13081 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13082 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13083 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13084 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13085 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 13086 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13087 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 13088 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13089 | 0 \ |
| 13090 | -c "got a certificate request" \ |
| 13091 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13092 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13093 | -c "Protocol is TLSv1.3" |
| 13094 | |
| 13095 | requires_gnutls_tls1_3 |
| 13096 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13097 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13098 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13099 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13100 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13101 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13102 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 13103 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13104 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 13105 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13106 | 0 \ |
| 13107 | -c "got a certificate request" \ |
| 13108 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13109 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13110 | -c "Protocol is TLSv1.3" |
| 13111 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13112 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13113 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13114 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13115 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13116 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13117 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13118 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 13119 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13120 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13121 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13122 | 0 \ |
| 13123 | -c "got a certificate request" \ |
| 13124 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13125 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13126 | -c "Protocol is TLSv1.3" |
| 13127 | |
| 13128 | requires_gnutls_tls1_3 |
| 13129 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13130 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13131 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13132 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13133 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13134 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13135 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 13136 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13137 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13138 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13139 | 0 \ |
| 13140 | -c "got a certificate request" \ |
| 13141 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13142 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13143 | -c "Protocol is TLSv1.3" |
| 13144 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13145 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13146 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13147 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13148 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13149 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13150 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13151 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13152 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 13153 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13154 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13155 | key_file=$DATA_FILES_PATH/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13156 | 0 \ |
| 13157 | -c "got a certificate request" \ |
| 13158 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13159 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13160 | -c "Protocol is TLSv1.3" |
| 13161 | |
| 13162 | requires_gnutls_tls1_3 |
| 13163 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13164 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13165 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13166 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13167 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13168 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13169 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13170 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 13171 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13172 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13173 | key_file=$DATA_FILES_PATH/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13174 | 0 \ |
| 13175 | -c "got a certificate request" \ |
| 13176 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13177 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13178 | -c "Protocol is TLSv1.3" |
| 13179 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13180 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13181 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13182 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13183 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13184 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13185 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13186 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13187 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 13188 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13189 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13190 | key_file=$DATA_FILES_PATH/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13191 | 0 \ |
| 13192 | -c "got a certificate request" \ |
| 13193 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13194 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13195 | -c "Protocol is TLSv1.3" |
| 13196 | |
| 13197 | requires_gnutls_tls1_3 |
| 13198 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13199 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13200 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13201 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13202 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13203 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13204 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13205 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 13206 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13207 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13208 | key_file=$DATA_FILES_PATH/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13209 | 0 \ |
| 13210 | -c "got a certificate request" \ |
| 13211 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13212 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13213 | -c "Protocol is TLSv1.3" |
| 13214 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13215 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13216 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13217 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13218 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13219 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13220 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13221 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13222 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 13223 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13224 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13225 | key_file=$DATA_FILES_PATH/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13226 | 0 \ |
| 13227 | -c "got a certificate request" \ |
| 13228 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13229 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13230 | -c "Protocol is TLSv1.3" |
| 13231 | |
| 13232 | requires_gnutls_tls1_3 |
| 13233 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13234 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13235 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13236 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13237 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13238 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13239 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13240 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \ |
| 13241 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13242 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13243 | key_file=$DATA_FILES_PATH/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13244 | 0 \ |
| 13245 | -c "got a certificate request" \ |
| 13246 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13247 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13248 | -c "Protocol is TLSv1.3" |
| 13249 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13250 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13251 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13252 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13253 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13254 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13255 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13256 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13257 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 13258 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 13259 | -sigalgs ecdsa_secp256r1_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13260 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13261 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13262 | 1 \ |
| 13263 | -c "got a certificate request" \ |
| 13264 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13265 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13266 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13267 | |
| 13268 | requires_gnutls_tls1_3 |
| 13269 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13270 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13271 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13272 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13273 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13274 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13275 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13276 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 13277 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13278 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13279 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13280 | 1 \ |
| 13281 | -c "got a certificate request" \ |
| 13282 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13283 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13284 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13285 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13286 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13287 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13288 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13289 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13290 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13291 | 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] | 13292 | "$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] | 13293 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13294 | 0 \ |
| 13295 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13296 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13297 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13298 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13299 | -c "HTTP/1.0 200 ok" |
| 13300 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13301 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13302 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13303 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13304 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13305 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13306 | 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] | 13307 | "$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] | 13308 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 13309 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13310 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13311 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13312 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13313 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 13314 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13315 | |
| 13316 | requires_gnutls_tls1_3 |
| 13317 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13318 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13319 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13320 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13321 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13322 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13323 | 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] | 13324 | "$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] | 13325 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13326 | 0 \ |
| 13327 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13328 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13329 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13330 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13331 | -c "HTTP/1.0 200 OK" |
| 13332 | |
| 13333 | requires_gnutls_tls1_3 |
| 13334 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13335 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13336 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13337 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13338 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13339 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13340 | 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] | 13341 | "$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] | 13342 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 13343 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13344 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13345 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13346 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13347 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 13348 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13349 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13350 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13351 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 13352 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13353 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 13354 | run_test "TLS 1.3: Server side check - openssl" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13355 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13356 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 13357 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 13358 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13359 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13360 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13361 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 13362 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13363 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13364 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 13365 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13366 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13367 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13368 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13369 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13370 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13371 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13372 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13373 | "$O_NEXT_CLI -msg -debug -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key -tls1_3 -no_middlebox" \ |
XiaokangQian | 9a4e1dd | 2022-05-26 00:58:11 +0000 | [diff] [blame] | 13374 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13375 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13376 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13377 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13378 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13379 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 13380 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13381 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13382 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13383 | -s "=> parse client hello" \ |
| 13384 | -s "<= parse client hello" |
| 13385 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13386 | requires_gnutls_tls1_3 |
| 13387 | requires_gnutls_next_no_ticket |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13388 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 13389 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13390 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 13391 | run_test "TLS 1.3: Server side check - gnutls" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13392 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
XiaokangQian | 3f84d5d | 2022-04-19 06:36:17 +0000 | [diff] [blame] | 13393 | "$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] | 13394 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 13395 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13396 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13397 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13398 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 13399 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13400 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13401 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 13402 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 13403 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13404 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13405 | requires_gnutls_tls1_3 |
| 13406 | requires_gnutls_next_no_ticket |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13407 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13408 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13409 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13410 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13411 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13412 | "$G_NEXT_CLI localhost -d 4 --x509certfile $DATA_FILES_PATH/server5.crt --x509keyfile $DATA_FILES_PATH/server5.key --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 13413 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13414 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13415 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13416 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13417 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13418 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 13419 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13420 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13421 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13422 | -s "=> parse client hello" \ |
| 13423 | -s "<= parse client hello" |
| 13424 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13425 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13426 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 13427 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13428 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13429 | run_test "TLS 1.3: Server side check - mbedtls" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13430 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 13431 | "$P_CLI debug_level=4" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 13432 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13433 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13434 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13435 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13436 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13437 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13438 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13439 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 13440 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 13441 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 13442 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13443 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13444 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13445 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13446 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13447 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13448 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13449 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13450 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 13451 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13452 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13453 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13454 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13455 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13456 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13457 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13458 | -s "=> parse client hello" \ |
| 13459 | -s "<= parse client hello" |
| 13460 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13461 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13462 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13463 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13464 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13465 | run_test "TLS 1.3: Server side check - mbedtls with client empty certificate" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13466 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 13467 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13468 | 1 \ |
| 13469 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13470 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13471 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13472 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13473 | -s "=> write certificate request" \ |
| 13474 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 13475 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13476 | -s "=> parse client hello" \ |
| 13477 | -s "<= parse client hello" |
| 13478 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13479 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13480 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13481 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13482 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13483 | run_test "TLS 1.3: Server side check - mbedtls with optional client authentication" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13484 | "$P_SRV debug_level=4 auth_mode=optional crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 13485 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13486 | 0 \ |
| 13487 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13488 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13489 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13490 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13491 | -s "=> write certificate request" \ |
| 13492 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13493 | -s "=> parse client hello" \ |
| 13494 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13495 | |
| 13496 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13497 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13498 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13499 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13500 | requires_config_enabled PSA_WANT_ALG_ECDH |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13501 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13502 | "$P_SRV debug_level=4 groups=secp384r1" \ |
| 13503 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 13504 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13505 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13506 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13507 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13508 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 13509 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13510 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13511 | -s "=> write hello retry request" \ |
| 13512 | -s "<= write hello retry request" |
| 13513 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13514 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13515 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13516 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13517 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13518 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13519 | "$P_SRV debug_level=4 crt_file=none key_file=none" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 13520 | "$P_CLI debug_level=4" \ |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13521 | 1 \ |
| 13522 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13523 | -s "No certificate available." |
| 13524 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13525 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13526 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13527 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13528 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13529 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13530 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13531 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13532 | sni=localhost,$DATA_FILES_PATH/server5.crt,$DATA_FILES_PATH/server5.key,$DATA_FILES_PATH/test-ca_cat12.crt,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
| 13533 | "$O_NEXT_CLI -msg -debug -servername localhost -CAfile $DATA_FILES_PATH/test-ca_cat12.crt -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key -tls1_3" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13534 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13535 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13536 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13537 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 13538 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13539 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13540 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13541 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13542 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13543 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13544 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13545 | sni=localhost,$DATA_FILES_PATH/server5.crt,$DATA_FILES_PATH/server5.key,$DATA_FILES_PATH/test-ca_cat12.crt,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
| 13546 | "$G_NEXT_CLI localhost -d 4 --sni-hostname=localhost --x509certfile $DATA_FILES_PATH/server5.crt --x509keyfile $DATA_FILES_PATH/server5.key --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS -V" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13547 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13548 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13549 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13550 | |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 13551 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13552 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13553 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13554 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13555 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13556 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13557 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13558 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
| 13559 | "$P_CLI debug_level=4 server_name=localhost crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13560 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13561 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13562 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 13563 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 13564 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 13565 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 13566 | TEST_SUITE_NAME=${i##*/} |
| 13567 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 13568 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 13569 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 13570 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 13571 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13572 | # Test 1.3 compatibility mode |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13573 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13574 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13575 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13576 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13577 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13578 | 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] | 13579 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13580 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13581 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13582 | -s "Protocol is TLSv1.3" \ |
| 13583 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13584 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13585 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13586 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13587 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13588 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13589 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13590 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13591 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13592 | run_test "TLS 1.3 m->m both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13593 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13594 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13595 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13596 | -s "Protocol is TLSv1.3" \ |
| 13597 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13598 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13599 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13600 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13601 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13602 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13603 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13604 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13605 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13606 | 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] | 13607 | "$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] | 13608 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13609 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13610 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13611 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13612 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13613 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13614 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13615 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13616 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13617 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13618 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13619 | 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] | 13620 | "$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] | 13621 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13622 | 1 \ |
| 13623 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 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_CLI_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 m->O both with middlebox compat support" \ |
| 13631 | "$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] | 13632 | "$P_CLI debug_level=4" \ |
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 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13635 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13636 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13637 | requires_gnutls_tls1_3 |
| 13638 | requires_gnutls_next_no_ticket |
| 13639 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13640 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13641 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13642 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13643 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13644 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 13645 | "$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] | 13646 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13647 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13648 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13649 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13650 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13651 | |
| 13652 | requires_gnutls_tls1_3 |
| 13653 | requires_gnutls_next_no_ticket |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13654 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13655 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13656 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13657 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13658 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 13659 | "$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] | 13660 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13661 | 1 \ |
| 13662 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 13663 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13664 | requires_gnutls_tls1_3 |
| 13665 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13666 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13667 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13668 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13669 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13670 | run_test "TLS 1.3 m->G both with middlebox compat support" \ |
| 13671 | "$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] | 13672 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13673 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13674 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13675 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13676 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13677 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13678 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13679 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13680 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13681 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13682 | run_test "TLS 1.3 O->m both peers do not support middlebox compatibility" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13683 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13684 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13685 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13686 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13687 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13688 | -C "14 03 03 00 01" |
| 13689 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13690 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13691 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13692 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13693 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13694 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13695 | run_test "TLS 1.3 O->m server with middlebox compat support, not client" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13696 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13697 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13698 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13699 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13700 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" |
| 13701 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13702 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13703 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13704 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13705 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13706 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13707 | run_test "TLS 1.3 O->m both with middlebox compat support" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13708 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13709 | "$O_NEXT_CLI -msg -debug" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13710 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13711 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13712 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13713 | -c "14 03 03 00 01" |
| 13714 | |
| 13715 | requires_gnutls_tls1_3 |
| 13716 | requires_gnutls_next_no_ticket |
| 13717 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13718 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13719 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13720 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13721 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13722 | run_test "TLS 1.3 G->m both peers do not support middlebox compatibility" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13723 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13724 | "$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] | 13725 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13726 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13727 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13728 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 13729 | |
| 13730 | requires_gnutls_tls1_3 |
| 13731 | requires_gnutls_next_no_ticket |
| 13732 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13733 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13734 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13735 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13736 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13737 | run_test "TLS 1.3 G->m server with middlebox compat support, not client" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13738 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13739 | "$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] | 13740 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13741 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13742 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13743 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 13744 | -c "discarding change cipher spec in TLS1.3" |
| 13745 | |
| 13746 | requires_gnutls_tls1_3 |
| 13747 | requires_gnutls_next_no_ticket |
| 13748 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13749 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13750 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13751 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13752 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13753 | run_test "TLS 1.3 G->m both with middlebox compat support" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13754 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13755 | "$G_NEXT_CLI localhost --debug=10 --priority=NORMAL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13756 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13757 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13758 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13759 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 13760 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13761 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13762 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13763 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13764 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13765 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13766 | 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] | 13767 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 13768 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13769 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13770 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13771 | -c "Protocol is TLSv1.3" \ |
| 13772 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13773 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13774 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13775 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13776 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13777 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13778 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13779 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13780 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13781 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13782 | 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] | 13783 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 13784 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13785 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13786 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13787 | -c "Protocol is TLSv1.3" \ |
| 13788 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13789 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13790 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13791 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13792 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13793 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13794 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13795 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13796 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13797 | run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ |
| 13798 | "$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] | 13799 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13800 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13801 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13802 | -c "received HelloRetryRequest message" \ |
| 13803 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13804 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13805 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13806 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13807 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13808 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13809 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13810 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13811 | run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ |
| 13812 | "$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] | 13813 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13814 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13815 | -c "received HelloRetryRequest message" \ |
| 13816 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 13817 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13818 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13819 | requires_config_enabled MBEDTLS_DEBUG_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 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13823 | run_test "TLS 1.3 m->O HRR both with middlebox compat support" \ |
| 13824 | "$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] | 13825 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13826 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13827 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13828 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13829 | |
| 13830 | requires_gnutls_tls1_3 |
| 13831 | requires_gnutls_next_no_ticket |
| 13832 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13833 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13834 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13835 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13836 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13837 | run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ |
| 13838 | "$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] | 13839 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13840 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13841 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13842 | -c "received HelloRetryRequest message" \ |
| 13843 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13844 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13845 | |
| 13846 | requires_gnutls_tls1_3 |
| 13847 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13848 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13849 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13850 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13851 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13852 | run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \ |
| 13853 | "$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] | 13854 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13855 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13856 | -c "received HelloRetryRequest message" \ |
| 13857 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 13858 | |
| 13859 | requires_gnutls_tls1_3 |
| 13860 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13861 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13862 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13863 | requires_config_enabled PSA_WANT_ALG_ECDH |
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 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13866 | run_test "TLS 1.3 m->G HRR both with middlebox compat support" \ |
| 13867 | "$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] | 13868 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13869 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13870 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13871 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13872 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13873 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13874 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13875 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13876 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13877 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13878 | run_test "TLS 1.3 O->m HRR both peers do not support middlebox compatibility" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13879 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13880 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13881 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13882 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13883 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13884 | -C "14 03 03 00 01" |
| 13885 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13886 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13887 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13888 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13889 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13890 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13891 | run_test "TLS 1.3 O->m HRR server with middlebox compat support, not client" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13892 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13893 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13894 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13895 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13896 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13897 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13898 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13899 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13900 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13901 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13902 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13903 | run_test "TLS 1.3 O->m HRR both with middlebox compat support" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13904 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13905 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13906 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13907 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13908 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13909 | -c "14 03 03 00 01" |
| 13910 | |
| 13911 | requires_gnutls_tls1_3 |
| 13912 | requires_gnutls_next_no_ticket |
| 13913 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13914 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13915 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13916 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13917 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13918 | run_test "TLS 1.3 G->m HRR both peers do not support middlebox compatibility" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13919 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13920 | "$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] | 13921 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13922 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13923 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13924 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 13925 | |
| 13926 | requires_gnutls_tls1_3 |
| 13927 | requires_gnutls_next_no_ticket |
| 13928 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13929 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13930 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13931 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13932 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13933 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13934 | run_test "TLS 1.3 G->m HRR server with middlebox compat support, not client" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13935 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13936 | "$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] | 13937 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13938 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13939 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13940 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 13941 | -c "discarding change cipher spec in TLS1.3" |
| 13942 | |
| 13943 | requires_gnutls_tls1_3 |
| 13944 | requires_gnutls_next_no_ticket |
| 13945 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13946 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13947 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13948 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13949 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13950 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13951 | run_test "TLS 1.3 G->m HRR both with middlebox compat support" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13952 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13953 | "$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] | 13954 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13955 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13956 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13957 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 13958 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13959 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13960 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13961 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13962 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13963 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13964 | run_test "TLS 1.3: Check signature algorithm order, m->O" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13965 | "$O_NEXT_SRV_NO_CERT -cert $DATA_FILES_PATH/server2-sha256.crt -key $DATA_FILES_PATH/server2.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13966 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 13967 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13968 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 13969 | 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] | 13970 | 0 \ |
| 13971 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13972 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13973 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13974 | |
| 13975 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13976 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13977 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13978 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13979 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13980 | run_test "TLS 1.3: Check signature algorithm order, m->G" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13981 | "$G_NEXT_SRV_NO_CERT --x509certfile $DATA_FILES_PATH/server2-sha256.crt --x509keyfile $DATA_FILES_PATH/server2.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13982 | -d 4 |
| 13983 | --priority=NORMAL:-VERS-ALL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13984 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 13985 | 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] | 13986 | 0 \ |
| 13987 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13988 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13989 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13990 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13991 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13992 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13993 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13994 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13995 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13996 | run_test "TLS 1.3: Check signature algorithm order, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13997 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13998 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 13999 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14000 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14001 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 14002 | 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] | 14003 | 0 \ |
| 14004 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14005 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 14006 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14007 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 14008 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14009 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14010 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14011 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14012 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14013 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14014 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14015 | run_test "TLS 1.3: Check signature algorithm order, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14016 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14017 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14018 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14019 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14020 | "$O_NEXT_CLI_NO_CERT -msg -CAfile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14021 | -cert $DATA_FILES_PATH/server2-sha256.crt -key $DATA_FILES_PATH/server2.key \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14022 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 14023 | 0 \ |
| 14024 | -c "TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14025 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14026 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 14027 | |
| 14028 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14029 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14030 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14031 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14032 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14033 | run_test "TLS 1.3: Check signature algorithm order, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14034 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14035 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14036 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14037 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14038 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14039 | --x509certfile $DATA_FILES_PATH/server2-sha256.crt --x509keyfile $DATA_FILES_PATH/server2.key \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14040 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" \ |
| 14041 | 0 \ |
| 14042 | -c "Negotiated version: 3.4" \ |
| 14043 | -c "HTTP/1.0 200 [Oo][Kk]" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14044 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14045 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 14046 | |
| 14047 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14048 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14049 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14050 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14051 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14052 | 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] | 14053 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14054 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14055 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14056 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14057 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14058 | --x509certfile $DATA_FILES_PATH/server2-sha256.crt --x509keyfile $DATA_FILES_PATH/server2.key \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14059 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512" \ |
| 14060 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 14061 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14062 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14063 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14064 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14065 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14066 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14067 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14068 | run_test "TLS 1.3: Check server no suitable signature algorithm, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14069 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14070 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14071 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14072 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14073 | "$O_NEXT_CLI_NO_CERT -msg -CAfile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14074 | -cert $DATA_FILES_PATH/server2-sha256.crt -key $DATA_FILES_PATH/server2.key \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14075 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \ |
| 14076 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 14077 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14078 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14079 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14080 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14081 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14082 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14083 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14084 | 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] | 14085 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14086 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14087 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14088 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14089 | "$P_CLI allow_sha1=0 debug_level=4 crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 14090 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14091 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 14092 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14093 | |
| 14094 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14095 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14096 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14097 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14098 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14099 | run_test "TLS 1.3: Check server no suitable certificate, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14100 | "$P_SRV debug_level=4 |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14101 | crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14102 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14103 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14104 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \ |
| 14105 | 1 \ |
| 14106 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14107 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14108 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14109 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14110 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14111 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14112 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14113 | run_test "TLS 1.3: Check server no suitable certificate, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14114 | "$P_SRV debug_level=4 |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14115 | crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14116 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14117 | "$O_NEXT_CLI_NO_CERT -msg -CAfile $DATA_FILES_PATH/test-ca_cat12.crt \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14118 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \ |
| 14119 | 1 \ |
| 14120 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14121 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14122 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14123 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14124 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14125 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14126 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14127 | run_test "TLS 1.3: Check server no suitable certificate, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14128 | "$P_SRV debug_level=4 |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14129 | crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14130 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 14131 | "$P_CLI allow_sha1=0 debug_level=4 \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 14132 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14133 | 1 \ |
| 14134 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14135 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14136 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14137 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14138 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14139 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14140 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14141 | run_test "TLS 1.3: Check client no signature algorithm, m->O" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14142 | "$O_NEXT_SRV_NO_CERT -cert $DATA_FILES_PATH/server2-sha256.crt -key $DATA_FILES_PATH/server2.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14143 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 14144 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp521r1_sha512" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14145 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 14146 | 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] | 14147 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14148 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14149 | |
| 14150 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14151 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14152 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14153 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14154 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14155 | run_test "TLS 1.3: Check client no signature algorithm, m->G" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14156 | "$G_NEXT_SRV_NO_CERT --x509certfile $DATA_FILES_PATH/server2-sha256.crt --x509keyfile $DATA_FILES_PATH/server2.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14157 | -d 4 |
| 14158 | --priority=NORMAL:-VERS-ALL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14159 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 14160 | 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] | 14161 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14162 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14163 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14164 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14165 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14166 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14167 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14168 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14169 | run_test "TLS 1.3: Check client no signature algorithm, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14170 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14171 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14172 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14173 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp521r1_sha512" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14174 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 14175 | 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] | 14176 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14177 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14178 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14179 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 14180 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 14181 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14182 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 14183 | run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->O" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14184 | "$O_NEXT_SRV_NO_CERT -cert $DATA_FILES_PATH/server2-sha256.crt -key $DATA_FILES_PATH/server2.key |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 14185 | -msg -tls1_2 |
| 14186 | -Verify 10 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14187 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 14188 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 14189 | min_version=tls12 max_version=tls13 " \ |
| 14190 | 0 \ |
| 14191 | -c "Protocol is TLSv1.2" \ |
| 14192 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14193 | |
| 14194 | |
| 14195 | requires_gnutls_tls1_3 |
| 14196 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 14197 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14198 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 14199 | run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->G" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14200 | "$G_NEXT_SRV_NO_CERT --x509certfile $DATA_FILES_PATH/server2-sha256.crt --x509keyfile $DATA_FILES_PATH/server2.key |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 14201 | -d 4 |
| 14202 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14203 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 14204 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 14205 | min_version=tls12 max_version=tls13 " \ |
| 14206 | 0 \ |
| 14207 | -c "Protocol is TLSv1.2" \ |
| 14208 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14209 | |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14210 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14211 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14212 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14213 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14214 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14215 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14216 | requires_config_enabled PSA_WANT_DH_RFC7919_3072 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14217 | requires_gnutls_tls1_3 |
| 14218 | requires_gnutls_next_no_ticket |
| 14219 | requires_gnutls_next_disable_tls13_compat |
| 14220 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe3072,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14221 | "$P_SRV crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe3072 tls13_kex_modes=ephemeral cookies=0 tickets=0" \ |
| 14222 | "$G_NEXT_CLI_NO_CERT --debug=4 --single-key-share --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE3072:+VERS-TLS1.3:%NO_TICKETS" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14223 | 0 \ |
| 14224 | -s "Protocol is TLSv1.3" \ |
| 14225 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14226 | -s "received signature algorithm: 0x804" \ |
| 14227 | -s "got named group: ffdhe3072(0101)" \ |
| 14228 | -s "Certificate verification was skipped" \ |
| 14229 | -C "received HelloRetryRequest message" |
| 14230 | |
| 14231 | |
| 14232 | requires_gnutls_tls1_3 |
| 14233 | requires_gnutls_next_no_ticket |
| 14234 | requires_gnutls_next_disable_tls13_compat |
| 14235 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14236 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14237 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14238 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14239 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14240 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14241 | requires_config_enabled PSA_WANT_DH_RFC7919_3072 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14242 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe3072,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14243 | "$G_NEXT_SRV_NO_CERT --http --disable-client-cert --debug=4 --x509certfile $DATA_FILES_PATH/server2-sha256.crt --x509keyfile $DATA_FILES_PATH/server2.key --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE3072:+VERS-TLS1.3:%NO_TICKETS" \ |
| 14244 | "$P_CLI ca_file=$DATA_FILES_PATH/test-ca_cat12.crt debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe3072" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14245 | 0 \ |
| 14246 | -c "HTTP/1.0 200 OK" \ |
| 14247 | -c "Protocol is TLSv1.3" \ |
| 14248 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14249 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14250 | -c "NamedGroup: ffdhe3072 ( 101 )" \ |
| 14251 | -c "Verifying peer X.509 certificate... ok" \ |
| 14252 | -C "received HelloRetryRequest message" |
| 14253 | |
| 14254 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14255 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14256 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14257 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14258 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14259 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14260 | requires_config_enabled PSA_WANT_DH_RFC7919_4096 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14261 | requires_gnutls_tls1_3 |
| 14262 | requires_gnutls_next_no_ticket |
| 14263 | requires_gnutls_next_disable_tls13_compat |
| 14264 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe4096,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14265 | "$P_SRV crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe4096 tls13_kex_modes=ephemeral cookies=0 tickets=0" \ |
| 14266 | "$G_NEXT_CLI_NO_CERT --debug=4 --single-key-share --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE4096:+VERS-TLS1.3:%NO_TICKETS" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14267 | 0 \ |
| 14268 | -s "Protocol is TLSv1.3" \ |
| 14269 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14270 | -s "received signature algorithm: 0x804" \ |
| 14271 | -s "got named group: ffdhe4096(0102)" \ |
| 14272 | -s "Certificate verification was skipped" \ |
| 14273 | -C "received HelloRetryRequest message" |
| 14274 | |
| 14275 | |
| 14276 | requires_gnutls_tls1_3 |
| 14277 | requires_gnutls_next_no_ticket |
| 14278 | requires_gnutls_next_disable_tls13_compat |
| 14279 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14280 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14281 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14282 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14283 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14284 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14285 | requires_config_enabled PSA_WANT_DH_RFC7919_4096 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14286 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe4096,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14287 | "$G_NEXT_SRV_NO_CERT --http --disable-client-cert --debug=4 --x509certfile $DATA_FILES_PATH/server2-sha256.crt --x509keyfile $DATA_FILES_PATH/server2.key --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE4096:+VERS-TLS1.3:%NO_TICKETS" \ |
| 14288 | "$P_CLI ca_file=$DATA_FILES_PATH/test-ca_cat12.crt debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe4096" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14289 | 0 \ |
| 14290 | -c "HTTP/1.0 200 OK" \ |
| 14291 | -c "Protocol is TLSv1.3" \ |
| 14292 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14293 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14294 | -c "NamedGroup: ffdhe4096 ( 102 )" \ |
| 14295 | -c "Verifying peer X.509 certificate... ok" \ |
| 14296 | -C "received HelloRetryRequest message" |
| 14297 | |
| 14298 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14299 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14300 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14301 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14302 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14303 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14304 | requires_config_enabled PSA_WANT_DH_RFC7919_6144 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14305 | requires_gnutls_tls1_3 |
| 14306 | requires_gnutls_next_no_ticket |
| 14307 | requires_gnutls_next_disable_tls13_compat |
| 14308 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe6144,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14309 | "$P_SRV crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe6144 tls13_kex_modes=ephemeral cookies=0 tickets=0" \ |
| 14310 | "$G_NEXT_CLI_NO_CERT --debug=4 --single-key-share --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE6144:+VERS-TLS1.3:%NO_TICKETS" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14311 | 0 \ |
| 14312 | -s "Protocol is TLSv1.3" \ |
| 14313 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14314 | -s "received signature algorithm: 0x804" \ |
| 14315 | -s "got named group: ffdhe6144(0103)" \ |
| 14316 | -s "Certificate verification was skipped" \ |
| 14317 | -C "received HelloRetryRequest message" |
| 14318 | |
| 14319 | requires_gnutls_tls1_3 |
| 14320 | requires_gnutls_next_no_ticket |
| 14321 | requires_gnutls_next_disable_tls13_compat |
| 14322 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14323 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14324 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14325 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14326 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14327 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14328 | requires_config_enabled PSA_WANT_DH_RFC7919_6144 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14329 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe6144,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14330 | "$G_NEXT_SRV_NO_CERT --http --disable-client-cert --debug=4 --x509certfile $DATA_FILES_PATH/server2-sha256.crt --x509keyfile $DATA_FILES_PATH/server2.key --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE6144:+VERS-TLS1.3:%NO_TICKETS" \ |
| 14331 | "$P_CLI ca_file=$DATA_FILES_PATH/test-ca_cat12.crt debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe6144" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14332 | 0 \ |
| 14333 | -c "HTTP/1.0 200 OK" \ |
| 14334 | -c "Protocol is TLSv1.3" \ |
| 14335 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14336 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14337 | -c "NamedGroup: ffdhe6144 ( 103 )" \ |
| 14338 | -c "Verifying peer X.509 certificate... ok" \ |
| 14339 | -C "received HelloRetryRequest message" |
| 14340 | |
| 14341 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14342 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14343 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14344 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14345 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14346 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14347 | requires_config_enabled PSA_WANT_DH_RFC7919_8192 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14348 | requires_gnutls_tls1_3 |
| 14349 | requires_gnutls_next_no_ticket |
| 14350 | requires_gnutls_next_disable_tls13_compat |
| 14351 | client_needs_more_time 4 |
| 14352 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe8192,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14353 | "$P_SRV crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe8192 tls13_kex_modes=ephemeral cookies=0 tickets=0" \ |
| 14354 | "$G_NEXT_CLI_NO_CERT --debug=4 --single-key-share --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE8192:+VERS-TLS1.3:%NO_TICKETS" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14355 | 0 \ |
| 14356 | -s "Protocol is TLSv1.3" \ |
| 14357 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14358 | -s "received signature algorithm: 0x804" \ |
| 14359 | -s "got named group: ffdhe8192(0104)" \ |
| 14360 | -s "Certificate verification was skipped" \ |
| 14361 | -C "received HelloRetryRequest message" |
| 14362 | |
| 14363 | requires_gnutls_tls1_3 |
| 14364 | requires_gnutls_next_no_ticket |
| 14365 | requires_gnutls_next_disable_tls13_compat |
| 14366 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14367 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14368 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14369 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14370 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14371 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14372 | requires_config_enabled PSA_WANT_DH_RFC7919_8192 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14373 | client_needs_more_time 4 |
| 14374 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe8192,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14375 | "$G_NEXT_SRV_NO_CERT --http --disable-client-cert --debug=4 --x509certfile $DATA_FILES_PATH/server2-sha256.crt --x509keyfile $DATA_FILES_PATH/server2.key --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE8192:+VERS-TLS1.3:%NO_TICKETS" \ |
| 14376 | "$P_CLI ca_file=$DATA_FILES_PATH/test-ca_cat12.crt debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe8192" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14377 | 0 \ |
| 14378 | -c "HTTP/1.0 200 OK" \ |
| 14379 | -c "Protocol is TLSv1.3" \ |
| 14380 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14381 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14382 | -c "NamedGroup: ffdhe8192 ( 104 )" \ |
| 14383 | -c "Verifying peer X.509 certificate... ok" \ |
| 14384 | -C "received HelloRetryRequest message" |
| 14385 | |
Ronald Cron | 8a74f07 | 2023-06-14 17:59:29 +0200 | [diff] [blame] | 14386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 14387 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14388 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14389 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 14390 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14391 | 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] | 14392 | "$P_SRV nbio=2 psk=73776f726466697368 psk_identity=0a0b0c tls13_kex_modes=psk groups=none" \ |
| 14393 | "$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] | 14394 | 0 \ |
| 14395 | -C "received HelloRetryRequest message" \ |
| 14396 | -c "Selected key exchange mode: psk$" \ |
| 14397 | -c "HTTP/1.0 200 OK" |
| 14398 | |
Waleed Elmelegy | 790f3b1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14399 | # Legacy_compression_methods testing |
| 14400 | |
| 14401 | requires_gnutls |
Waleed Elmelegy | 38c8757 | 2024-07-15 17:25:04 +0000 | [diff] [blame] | 14402 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Waleed Elmelegy | 790f3b1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14403 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Waleed Elmelegy | 38c8757 | 2024-07-15 17:25:04 +0000 | [diff] [blame] | 14404 | run_test "TLS 1.2 ClientHello indicating support for deflate compression method" \ |
| 14405 | "$P_SRV debug_level=3" \ |
| 14406 | "$G_CLI --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+COMP-DEFLATE localhost" \ |
| 14407 | 0 \ |
| 14408 | -c "Handshake was completed" \ |
| 14409 | -s "dumping .client hello, compression. (2 bytes)" |
Waleed Elmelegy | 790f3b1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14410 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14411 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 14412 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14413 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 14414 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 14415 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 14416 | requires_max_content_len 16384 |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 14417 | run_tests_memory_after_handshake |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14418 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14419 | if [ "$LIST_TESTS" -eq 0 ]; then |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 14420 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14421 | # Final report |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 14422 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14423 | echo "------------------------------------------------------------------------" |
| 14424 | |
| 14425 | if [ $FAILS = 0 ]; then |
| 14426 | printf "PASSED" |
| 14427 | else |
| 14428 | printf "FAILED" |
| 14429 | fi |
| 14430 | PASSES=$(( $TESTS - $FAILS )) |
| 14431 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
| 14432 | |
Gilles Peskine | c75048c | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 14433 | if [ $((TESTS - SKIPS)) -lt $MIN_TESTS ]; then |
| 14434 | cat <<EOF |
| 14435 | Error: Expected to run at least $MIN_TESTS, but only ran $((TESTS - SKIPS)). |
| 14436 | Maybe a bad filter ('$FILTER') or a bad configuration? |
| 14437 | EOF |
| 14438 | if [ $FAILS -eq 0 ]; then |
| 14439 | FAILS=1 |
| 14440 | fi |
| 14441 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 14442 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 14443 | |
Tom Cosgrove | fc0e79e | 2023-01-13 12:13:41 +0000 | [diff] [blame] | 14444 | if [ $FAILS -gt 255 ]; then |
| 14445 | # Clamp at 255 as caller gets exit code & 0xFF |
| 14446 | # (so 256 would be 0, or success, etc) |
| 14447 | FAILS=255 |
| 14448 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 14449 | exit $FAILS |