Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # |
Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 5 | # Copyright The Mbed TLS Contributors |
Dave Rodgman | 16799db | 2023-11-02 19:47:20 +0000 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
Bence Szépkúti | c7da1fe | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 7 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 8 | # Purpose |
| 9 | # |
| 10 | # Executes tests to prove various TLS/SSL options and extensions. |
| 11 | # |
| 12 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 13 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 14 | # (session resumption from cache or ticket, renego, etc). |
| 15 | # |
| 16 | # The tests assume a build with default options, with exceptions expressed |
| 17 | # with a dependency. The tests focus on functionality and do not consider |
| 18 | # performance. |
| 19 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 20 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 21 | set -u |
| 22 | |
Jaeden Amero | 6e70eb2 | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 23 | # Limit the size of each log to 10 GiB, in case of failures with this script |
| 24 | # where it may output seemingly unlimited length error logs. |
| 25 | ulimit -f 20971520 |
| 26 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 27 | ORIGINAL_PWD=$PWD |
| 28 | if ! cd "$(dirname "$0")"; then |
| 29 | exit 125 |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 30 | fi |
| 31 | |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 32 | DATA_FILES_PATH=../framework/data_files |
| 33 | |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 34 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 35 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 36 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 37 | : ${P_PXY:=../programs/test/udp_proxy} |
Jerry Yu | d04fd35 | 2021-12-06 16:52:57 +0800 | [diff] [blame] | 38 | : ${P_QUERY:=../programs/test/query_compile_time_config} |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 39 | : ${OPENSSL:=openssl} |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 40 | : ${GNUTLS_CLI:=gnutls-cli} |
| 41 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 42 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 43 | |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 44 | # The OPENSSL variable used to be OPENSSL_CMD for historical reasons. |
| 45 | # To help the migration, error out if the old variable is set, |
| 46 | # but only if it has a different value than the new one. |
| 47 | if [ "${OPENSSL_CMD+set}" = set ]; then |
| 48 | # the variable is set, we can now check its value |
| 49 | if [ "$OPENSSL_CMD" != "$OPENSSL" ]; then |
| 50 | echo "Please use OPENSSL instead of OPENSSL_CMD." >&2 |
| 51 | exit 125 |
| 52 | fi |
| 53 | fi |
| 54 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 55 | guess_config_name() { |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 56 | if git diff --quiet ../include/mbedtls/mbedtls_config.h 2>/dev/null; then |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 57 | echo "default" |
| 58 | else |
| 59 | echo "unknown" |
| 60 | fi |
| 61 | } |
| 62 | : ${MBEDTLS_TEST_OUTCOME_FILE=} |
| 63 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} |
| 64 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 65 | : ${EARLY_DATA_INPUT:="$DATA_FILES_PATH/tls13_early_data.txt"} |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 66 | |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 67 | O_SRV="$OPENSSL s_server -www -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 68 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL s_client" |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 69 | G_SRV="$GNUTLS_SERV --x509certfile $DATA_FILES_PATH/server5.crt --x509keyfile $DATA_FILES_PATH/server5.key" |
| 70 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt" |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 71 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 72 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 73 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 74 | |
Gilles Peskine | dd782f4 | 2024-04-29 17:46:24 +0200 | [diff] [blame] | 75 | # If $OPENSSL is at least 1.1.1, use it as OPENSSL_NEXT as well. |
| 76 | if [ -z "${OPENSSL_NEXT:-}" ]; then |
| 77 | case $($OPENSSL version) in |
| 78 | OpenSSL\ 1.1.[1-9]*) OPENSSL_NEXT=$OPENSSL;; |
| 79 | OpenSSL\ [3-9]*) OPENSSL_NEXT=$OPENSSL;; |
| 80 | esac |
| 81 | fi |
| 82 | |
| 83 | # If $GNUTLS_CLI is at least 3.7, use it as GNUTLS_NEXT_CLI as well. |
| 84 | if [ -z "${GNUTLS_NEXT_CLI:-}" ]; then |
| 85 | case $($GNUTLS_CLI --version) in |
| 86 | gnutls-cli\ 3.[1-9][0-9]*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 87 | gnutls-cli\ 3.[7-9].*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 88 | gnutls-cli\ [4-9]*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 89 | esac |
| 90 | fi |
| 91 | |
| 92 | # If $GNUTLS_SERV is at least 3.7, use it as GNUTLS_NEXT_SERV as well. |
| 93 | if [ -z "${GNUTLS_NEXT_SERV:-}" ]; then |
| 94 | case $($GNUTLS_SERV --version) in |
| 95 | gnutls-cli\ 3.[1-9][0-9]*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 96 | gnutls-cli\ 3.[7-9].*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 97 | gnutls-cli\ [4-9]*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 98 | esac |
| 99 | fi |
| 100 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 101 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 102 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" |
| 103 | O_NEXT_SRV_EARLY_DATA="$OPENSSL_NEXT s_server -early_data -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 104 | O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www " |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 105 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client -CAfile $DATA_FILES_PATH/test-ca_cat12.crt" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 106 | O_NEXT_CLI_NO_CERT="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 107 | else |
| 108 | O_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 109 | O_NEXT_SRV_NO_CERT=false |
Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 110 | O_NEXT_SRV_EARLY_DATA=false |
XiaokangQian | b1847a2 | 2022-06-08 07:49:31 +0000 | [diff] [blame] | 111 | O_NEXT_CLI_NO_CERT=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 112 | O_NEXT_CLI=false |
| 113 | fi |
| 114 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 115 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 116 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile $DATA_FILES_PATH/server5.crt --x509keyfile $DATA_FILES_PATH/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 117 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 118 | else |
| 119 | G_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 120 | G_NEXT_SRV_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 121 | fi |
| 122 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 123 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 124 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 125 | G_NEXT_CLI_NO_CERT="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 126 | else |
| 127 | G_NEXT_CLI=false |
XiaokangQian | fb1a3fe | 2022-06-09 06:37:33 +0000 | [diff] [blame] | 128 | G_NEXT_CLI_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 129 | fi |
| 130 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 131 | TESTS=0 |
| 132 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 133 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 134 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 135 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 136 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 137 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 138 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 139 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 140 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 141 | SHOW_TEST_NUMBER=0 |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 142 | LIST_TESTS=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 143 | RUN_TEST_NUMBER='' |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 144 | RUN_TEST_SUITE='' |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 145 | |
Gilles Peskine | 39c5207 | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 146 | MIN_TESTS=1 |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 147 | PRESERVE_LOGS=0 |
| 148 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 149 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 150 | # port which is this plus 10000. Each port number may be independently |
| 151 | # overridden by a command line option. |
| 152 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 153 | PXY_PORT=$((SRV_PORT + 10000)) |
| 154 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 155 | print_usage() { |
| 156 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 157 | printf " -h|--help\tPrint this help.\n" |
| 158 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 159 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 160 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 161 | printf " -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 162 | printf " -s|--show-numbers\tShow test numbers in front of test names\n" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 163 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Tomás González | 12787c9 | 2023-09-04 10:26:00 +0100 | [diff] [blame] | 164 | printf " --list-test-cases\tList all potential test cases (No Execution)\n" |
Gilles Peskine | 39c5207 | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 165 | printf " --min \tMinimum number of non-skipped tests (default 1)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 166 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 167 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 168 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 169 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 170 | printf " --seed \tInteger seed value to use for this test run\n" |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 171 | printf " --test-suite\tOnly matching test suites are executed\n" |
| 172 | printf " \t(comma-separated, e.g. 'ssl-opt,tls13-compat')\n\n" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 173 | } |
| 174 | |
| 175 | get_options() { |
| 176 | while [ $# -gt 0 ]; do |
| 177 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 178 | -f|--filter) |
| 179 | shift; FILTER=$1 |
| 180 | ;; |
| 181 | -e|--exclude) |
| 182 | shift; EXCLUDE=$1 |
| 183 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 184 | -m|--memcheck) |
| 185 | MEMCHECK=1 |
| 186 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 187 | -n|--number) |
| 188 | shift; RUN_TEST_NUMBER=$1 |
| 189 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 190 | -s|--show-numbers) |
| 191 | SHOW_TEST_NUMBER=1 |
| 192 | ;; |
Tomás González | 4a86da2 | 2023-09-01 17:41:16 +0100 | [diff] [blame] | 193 | -l|--list-test-cases) |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 194 | LIST_TESTS=1 |
| 195 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 196 | -p|--preserve-logs) |
| 197 | PRESERVE_LOGS=1 |
| 198 | ;; |
Gilles Peskine | 39c5207 | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 199 | --min) |
| 200 | shift; MIN_TESTS=$1 |
| 201 | ;; |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 202 | --outcome-file) |
| 203 | shift; MBEDTLS_TEST_OUTCOME_FILE=$1 |
| 204 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 205 | --port) |
| 206 | shift; SRV_PORT=$1 |
| 207 | ;; |
| 208 | --proxy-port) |
| 209 | shift; PXY_PORT=$1 |
| 210 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 211 | --seed) |
| 212 | shift; SEED="$1" |
| 213 | ;; |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 214 | --test-suite) |
| 215 | shift; RUN_TEST_SUITE="$1" |
| 216 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 217 | -h|--help) |
| 218 | print_usage |
| 219 | exit 0 |
| 220 | ;; |
| 221 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 222 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 223 | print_usage |
| 224 | exit 1 |
| 225 | ;; |
| 226 | esac |
| 227 | shift |
| 228 | done |
| 229 | } |
| 230 | |
Tomás González | 0e8a08a | 2023-08-23 15:29:57 +0100 | [diff] [blame] | 231 | get_options "$@" |
| 232 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 233 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 234 | # testing. Skip non-boolean options (with something other than spaces |
| 235 | # and a comment after "#define SYMBOL"). The variable contains a |
| 236 | # space-separated list of symbols. |
Tomás González | f162b4f | 2023-08-23 15:31:12 +0100 | [diff] [blame] | 237 | if [ "$LIST_TESTS" -eq 0 ];then |
| 238 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
| 239 | else |
Tomás González | be2c66e | 2023-09-01 10:34:49 +0100 | [diff] [blame] | 240 | P_QUERY=":" |
Tomás González | f162b4f | 2023-08-23 15:31:12 +0100 | [diff] [blame] | 241 | CONFIGS_ENABLED="" |
| 242 | fi |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 243 | # Skip next test; use this macro to skip tests which are legitimate |
| 244 | # in theory and expected to be re-introduced at some point, but |
| 245 | # aren't expected to succeed at the moment due to problems outside |
| 246 | # our control (such as bugs in other TLS implementations). |
| 247 | skip_next_test() { |
| 248 | SKIP_NEXT="YES" |
| 249 | } |
| 250 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 251 | # Check if the required configuration ($1) is enabled |
| 252 | is_config_enabled() |
| 253 | { |
| 254 | case $CONFIGS_ENABLED in |
| 255 | *" $1"[\ =]*) return 0;; |
| 256 | *) return 1;; |
| 257 | esac |
| 258 | } |
| 259 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 260 | # skip next test if the flag is not enabled in mbedtls_config.h |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 261 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 262 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 263 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 264 | *) SKIP_NEXT="YES";; |
| 265 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 266 | } |
| 267 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 268 | # skip next test if the flag is enabled in mbedtls_config.h |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 269 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 270 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 271 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 272 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 273 | } |
| 274 | |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 275 | requires_all_configs_enabled() { |
Gilles Peskine | 9404169 | 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 | 9404169 | 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 | 9404169 | 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 | 9404169 | 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 | 9d3b207 | 2024-09-06 15:38:47 +0200 | [diff] [blame] | 328 | requires_certificate_authentication () { |
Gilles Peskine | e3eab32 | 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 | e3eab32 | 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 | ae3dc17 | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 487 | case " $CMD_LINE " in |
| 488 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
Gilles Peskine | 6e85e35 | 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 | ae3dc17 | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 491 | requires_certificate_authentication;; |
| 492 | esac |
| 493 | |
Gilles Peskine | 7985d45 | 2024-09-04 16:06:10 +0200 | [diff] [blame] | 494 | case " $CMD_LINE " in |
Gilles Peskine | ae710c8 | 2024-09-04 16:07:56 +0200 | [diff] [blame] | 495 | *"programs/ssl/dtls_client "*|\ |
Gilles Peskine | 7985d45 | 2024-09-04 16:06:10 +0200 | [diff] [blame] | 496 | *"programs/ssl/ssl_client1 "*) |
| 497 | requires_config_enabled MBEDTLS_CTR_DRBG_C |
| 498 | requires_config_enabled MBEDTLS_ENTROPY_C |
| 499 | requires_config_enabled MBEDTLS_PEM_PARSE_C |
| 500 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 501 | requires_certificate_authentication |
| 502 | ;; |
Gilles Peskine | 3abca95 | 2024-09-04 16:31:06 +0200 | [diff] [blame^] | 503 | *"programs/ssl/ssl_pthread_server "*|\ |
Gilles Peskine | a21e893 | 2024-09-04 16:30:32 +0200 | [diff] [blame] | 504 | *"programs/ssl/ssl_server "*) |
| 505 | requires_config_enabled MBEDTLS_CTR_DRBG_C |
| 506 | requires_config_enabled MBEDTLS_ENTROPY_C |
| 507 | requires_config_enabled MBEDTLS_PEM_PARSE_C |
| 508 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 509 | requires_certificate_authentication |
| 510 | ;; |
Gilles Peskine | 7985d45 | 2024-09-04 16:06:10 +0200 | [diff] [blame] | 511 | esac |
| 512 | |
Gilles Peskine | 3abca95 | 2024-09-04 16:31:06 +0200 | [diff] [blame^] | 513 | case " $CMD_LINE " in |
| 514 | *"programs/ssl/ssl_pthread_server "*) |
| 515 | requires_config_enabled MBEDTLS_THREADING_PTHREAD;; |
| 516 | esac |
| 517 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 518 | case "$CMD_LINE" in |
Gilles Peskine | 4f09864 | 2024-09-06 15:35:58 +0200 | [diff] [blame] | 519 | *[-_\ =]psk*|*[-_\ =]PSK*) :;; # No certificate requirement with PSK |
Gilles Peskine | e855317 | 2024-04-26 21:28:49 +0200 | [diff] [blame] | 520 | */server5*|\ |
| 521 | */server7*|\ |
| 522 | */dir-maxpath*) |
Gilles Peskine | ae3dc17 | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 523 | requires_certificate_authentication |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 524 | if [ "$TLS_VERSION" = "TLS13" ]; then |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 525 | # In case of TLS13 the support for ECDSA is enough |
| 526 | requires_pk_alg "ECDSA" |
| 527 | else |
| 528 | # For TLS12 requirements are different between server and client |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 529 | if [ "$ROLE" = "server" ]; then |
Valerio Setti | 194e2bd | 2023-03-02 17:18:10 +0100 | [diff] [blame] | 530 | # If the server uses "server5*" certificates, then an ECDSA based |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 531 | # key exchange is required. However gnutls also does not |
| 532 | # support ECDH, so this limit the choice to ECDHE-ECDSA |
| 533 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 534 | requires_any_configs_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
| 535 | else |
| 536 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT |
| 537 | fi |
| 538 | elif [ "$ROLE" = "client" ]; then |
| 539 | # On the client side it is enough to have any certificate |
| 540 | # based authentication together with support for ECDSA. |
| 541 | # Of course the GnuTLS limitation mentioned above applies |
| 542 | # also here. |
| 543 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 544 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH |
| 545 | else |
| 546 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 547 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 548 | requires_pk_alg "ECDSA" |
| 549 | fi |
| 550 | fi |
| 551 | ;; |
| 552 | esac |
| 553 | |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 554 | case "$CMD_LINE" in |
Gilles Peskine | 4f09864 | 2024-09-06 15:35:58 +0200 | [diff] [blame] | 555 | *[-_\ =]psk*|*[-_\ =]PSK*) :;; # No certificate requirement with PSK |
Gilles Peskine | d00b93b | 2024-04-29 16:03:02 +0200 | [diff] [blame] | 556 | */server1*|\ |
Gilles Peskine | e855317 | 2024-04-26 21:28:49 +0200 | [diff] [blame] | 557 | */server2*|\ |
| 558 | */server7*) |
Gilles Peskine | ae3dc17 | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 559 | requires_certificate_authentication |
Gilles Peskine | d00b93b | 2024-04-29 16:03:02 +0200 | [diff] [blame] | 560 | # Certificates with an RSA key. The algorithm requirement is |
| 561 | # some subset of {PKCS#1v1.5 encryption, PKCS#1v1.5 signature, |
| 562 | # PSS signature}. We can't easily tell which subset works, and |
| 563 | # we aren't currently running ssl-opt.sh in configurations |
| 564 | # where partial RSA support is a problem, so generically, we |
| 565 | # just require RSA and it works out for our tests so far. |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 566 | requires_config_enabled "MBEDTLS_RSA_C" |
| 567 | esac |
| 568 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 569 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 570 | } |
| 571 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 572 | adapt_cmd_for_psk () { |
| 573 | case "$2" in |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 574 | *openssl*s_server*) s='-psk 73776f726466697368 -nocert';; |
| 575 | *openssl*) s='-psk 73776f726466697368';; |
Gilles Peskine | 6f9952a | 2024-09-06 15:27:57 +0200 | [diff] [blame] | 576 | *gnutls-cli*) s='--pskusername=Client_identity --pskkey=73776f726466697368';; |
| 577 | *gnutls-serv*) s='--pskpasswd=../framework/data_files/simplepass.psk';; |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 578 | *) s='psk=73776f726466697368';; |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 579 | esac |
| 580 | eval $1='"$2 $s"' |
| 581 | unset s |
| 582 | } |
| 583 | |
| 584 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 585 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 586 | # |
| 587 | # If not running in a PSK-only build, do nothing. |
| 588 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 589 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 590 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 591 | # a pre-shared key, do nothing. |
| 592 | # |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 593 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 594 | # |
| 595 | # Inputs: |
| 596 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 597 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 598 | # * "$@": options passed to run_test. |
| 599 | # |
| 600 | # Outputs: |
| 601 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 602 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 603 | maybe_adapt_for_psk() { |
| 604 | if [ "$PSK_ONLY" != "YES" ]; then |
| 605 | return |
| 606 | fi |
| 607 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 608 | return |
| 609 | fi |
| 610 | case "$CLI_CMD $SRV_CMD" in |
| 611 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 612 | return;; |
| 613 | *force_ciphersuite*) |
| 614 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 615 | # PSK cipher suite could be substituted, but we're not ready for |
| 616 | # that yet. |
| 617 | SKIP_NEXT="YES" |
| 618 | return;; |
| 619 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 620 | # The test case involves certificates. PSK won't do. |
| 621 | SKIP_NEXT="YES" |
| 622 | return;; |
| 623 | esac |
| 624 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 625 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 626 | } |
| 627 | |
Gilles Peskine | db26406 | 2024-09-06 19:08:41 +0200 | [diff] [blame] | 628 | # PSK_PRESENT="YES" if at least one protocol versions supports at least |
| 629 | # one PSK key exchange mode. |
Gilles Peskine | 24b4303 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 630 | PSK_PRESENT="NO" |
Gilles Peskine | db26406 | 2024-09-06 19:08:41 +0200 | [diff] [blame] | 631 | # PSK_ONLY="YES" if all the available key exchange modes are PSK-based |
| 632 | # (pure-PSK or PSK-ephemeral, possibly both). |
Gilles Peskine | 24b4303 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 633 | PSK_ONLY="" |
| 634 | for c in $CONFIGS_ENABLED; do |
| 635 | case $c in |
| 636 | MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | 2dd4395 | 2024-09-09 11:24:17 +0200 | [diff] [blame] | 637 | MBEDTLS_KEY_EXCHANGE_*_PSK_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | 24b4303 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 638 | MBEDTLS_KEY_EXCHANGE_*_ENABLED) PSK_ONLY="NO";; |
| 639 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | db26406 | 2024-09-06 19:08:41 +0200 | [diff] [blame] | 640 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_*_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | 24b4303 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 641 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_*_ENABLED) PSK_ONLY="NO";; |
| 642 | esac |
| 643 | done |
Gilles Peskine | 7f453bf | 2024-09-09 10:57:01 +0200 | [diff] [blame] | 644 | # At this stage, $PSK_ONLY is empty if we haven't detected a non-PSK |
| 645 | # key exchange, i.e. if we're in a PSK-only build or a build with no |
| 646 | # key exchanges at all. We avoid triggering PSK-only adaptation code in |
Gilles Peskine | 6e85e35 | 2024-09-10 12:06:33 +0200 | [diff] [blame] | 647 | # the edge case of no key exchanges. |
Gilles Peskine | 24b4303 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 648 | : ${PSK_ONLY:=$PSK_PRESENT} |
| 649 | unset c |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 650 | |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 651 | HAS_ALG_MD5="NO" |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 652 | HAS_ALG_SHA_1="NO" |
| 653 | HAS_ALG_SHA_224="NO" |
| 654 | HAS_ALG_SHA_256="NO" |
| 655 | HAS_ALG_SHA_384="NO" |
| 656 | HAS_ALG_SHA_512="NO" |
| 657 | |
| 658 | check_for_hash_alg() |
| 659 | { |
| 660 | CURR_ALG="INVALID"; |
| 661 | USE_PSA="NO" |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 662 | if is_config_enabled "MBEDTLS_USE_PSA_CRYPTO"; then |
| 663 | USE_PSA="YES"; |
| 664 | fi |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 665 | if [ $USE_PSA = "YES" ]; then |
| 666 | CURR_ALG=PSA_WANT_ALG_${1} |
| 667 | else |
| 668 | CURR_ALG=MBEDTLS_${1}_C |
| 669 | # Remove the second underscore to match MBEDTLS_* naming convention |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 670 | # MD5 is an exception to this convention |
| 671 | if [ "${1}" != "MD5" ]; then |
| 672 | CURR_ALG=$(echo "$CURR_ALG" | sed 's/_//2') |
| 673 | fi |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 674 | fi |
| 675 | |
| 676 | case $CONFIGS_ENABLED in |
| 677 | *" $CURR_ALG"[\ =]*) |
| 678 | return 0 |
| 679 | ;; |
| 680 | *) :;; |
| 681 | esac |
| 682 | return 1 |
| 683 | } |
| 684 | |
| 685 | populate_enabled_hash_algs() |
| 686 | { |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 687 | 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] | 688 | if check_for_hash_alg "$hash_alg"; then |
| 689 | hash_alg_variable=HAS_ALG_${hash_alg} |
| 690 | eval ${hash_alg_variable}=YES |
| 691 | fi |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 692 | done |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 693 | } |
| 694 | |
| 695 | # skip next test if the given hash alg is not supported |
| 696 | requires_hash_alg() { |
| 697 | HASH_DEFINE="Invalid" |
| 698 | HAS_HASH_ALG="NO" |
| 699 | case $1 in |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 700 | MD5):;; |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 701 | SHA_1):;; |
| 702 | SHA_224):;; |
| 703 | SHA_256):;; |
| 704 | SHA_384):;; |
| 705 | SHA_512):;; |
| 706 | *) |
| 707 | echo "Unsupported hash alg - $1" |
| 708 | exit 1 |
| 709 | ;; |
| 710 | esac |
| 711 | |
| 712 | HASH_DEFINE=HAS_ALG_${1} |
| 713 | eval "HAS_HASH_ALG=\${${HASH_DEFINE}}" |
| 714 | if [ "$HAS_HASH_ALG" = "NO" ] |
| 715 | then |
| 716 | SKIP_NEXT="YES" |
| 717 | fi |
| 718 | } |
| 719 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 720 | # Skip next test if the given pk alg is not enabled |
| 721 | requires_pk_alg() { |
| 722 | case $1 in |
| 723 | ECDSA) |
| 724 | if is_config_enabled MBEDTLS_USE_PSA_CRYPTO; then |
| 725 | requires_config_enabled PSA_WANT_ALG_ECDSA |
| 726 | else |
| 727 | requires_config_enabled MBEDTLS_ECDSA_C |
| 728 | fi |
| 729 | ;; |
| 730 | *) |
| 731 | echo "Unknown/unimplemented case $1 in requires_pk_alg" |
| 732 | exit 1 |
| 733 | ;; |
| 734 | esac |
| 735 | } |
| 736 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 737 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 738 | requires_openssl_with_fallback_scsv() { |
| 739 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 740 | 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] | 741 | then |
| 742 | OPENSSL_HAS_FBSCSV="YES" |
| 743 | else |
| 744 | OPENSSL_HAS_FBSCSV="NO" |
| 745 | fi |
| 746 | fi |
| 747 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 748 | SKIP_NEXT="YES" |
| 749 | fi |
| 750 | } |
| 751 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 752 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 753 | requires_max_content_len() { |
| 754 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 755 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 756 | } |
| 757 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 758 | # skip next test if GnuTLS isn't available |
| 759 | requires_gnutls() { |
| 760 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 761 | 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] | 762 | GNUTLS_AVAILABLE="YES" |
| 763 | else |
| 764 | GNUTLS_AVAILABLE="NO" |
| 765 | fi |
| 766 | fi |
| 767 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 768 | SKIP_NEXT="YES" |
| 769 | fi |
| 770 | } |
| 771 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 772 | # skip next test if GnuTLS-next isn't available |
| 773 | requires_gnutls_next() { |
| 774 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 775 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 776 | GNUTLS_NEXT_AVAILABLE="YES" |
| 777 | else |
| 778 | GNUTLS_NEXT_AVAILABLE="NO" |
| 779 | fi |
| 780 | fi |
| 781 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 782 | SKIP_NEXT="YES" |
| 783 | fi |
| 784 | } |
| 785 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 786 | requires_openssl_next() { |
| 787 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 788 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 789 | OPENSSL_NEXT_AVAILABLE="YES" |
| 790 | else |
| 791 | OPENSSL_NEXT_AVAILABLE="NO" |
| 792 | fi |
| 793 | fi |
| 794 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 795 | SKIP_NEXT="YES" |
| 796 | fi |
| 797 | } |
| 798 | |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 799 | # skip next test if openssl version is lower than 3.0 |
| 800 | requires_openssl_3_x() { |
| 801 | requires_openssl_next |
| 802 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 803 | OPENSSL_3_X_AVAILABLE="NO" |
| 804 | fi |
| 805 | if [ -z "${OPENSSL_3_X_AVAILABLE:-}" ]; then |
Przemek Stekiel | a53dca1 | 2023-06-14 20:53:09 +0200 | [diff] [blame] | 806 | if $OPENSSL_NEXT version 2>&1 | grep "OpenSSL 3." >/dev/null |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 807 | then |
| 808 | OPENSSL_3_X_AVAILABLE="YES" |
| 809 | else |
| 810 | OPENSSL_3_X_AVAILABLE="NO" |
| 811 | fi |
| 812 | fi |
| 813 | if [ "$OPENSSL_3_X_AVAILABLE" = "NO" ]; then |
| 814 | SKIP_NEXT="YES" |
| 815 | fi |
| 816 | } |
| 817 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 818 | # skip next test if openssl does not support ffdh keys |
| 819 | requires_openssl_tls1_3_with_ffdh() { |
| 820 | requires_openssl_3_x |
| 821 | } |
| 822 | |
Przemek Stekiel | 7dda271 | 2023-06-27 14:43:33 +0200 | [diff] [blame] | 823 | # skip next test if openssl cannot handle ephemeral key exchange |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 824 | requires_openssl_tls1_3_with_compatible_ephemeral() { |
| 825 | requires_openssl_next |
| 826 | |
| 827 | if !(is_config_enabled "PSA_WANT_ALG_ECDH"); then |
| 828 | requires_openssl_tls1_3_with_ffdh |
| 829 | fi |
| 830 | } |
| 831 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 832 | # skip next test if tls1_3 is not available |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 833 | requires_openssl_tls1_3() { |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 834 | requires_openssl_next |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 835 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 836 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 837 | fi |
| 838 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 839 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 840 | then |
| 841 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 842 | else |
| 843 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 844 | fi |
| 845 | fi |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 846 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 847 | SKIP_NEXT="YES" |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 848 | fi |
| 849 | } |
| 850 | |
Gilles Peskine | 7f453bf | 2024-09-09 10:57:01 +0200 | [diff] [blame] | 851 | # OpenSSL servers forbid client renegotiation by default since OpenSSL 3.0. |
| 852 | # Older versions always allow it and have no command-line option. |
Gilles Peskine | 56ee69d | 2024-09-06 13:52:14 +0200 | [diff] [blame] | 853 | OPENSSL_S_SERVER_CLIENT_RENEGOTIATION= |
| 854 | case $($OPENSSL s_server -help 2>&1) in |
| 855 | *-client_renegotiation*) |
| 856 | OPENSSL_S_SERVER_CLIENT_RENEGOTIATION=-client_renegotiation;; |
| 857 | esac |
| 858 | |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 859 | # skip next test if tls1_3 is not available |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 860 | requires_gnutls_tls1_3() { |
| 861 | requires_gnutls_next |
| 862 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 863 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 864 | fi |
| 865 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 866 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 867 | then |
| 868 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 869 | else |
| 870 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 871 | fi |
| 872 | fi |
| 873 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 874 | SKIP_NEXT="YES" |
| 875 | fi |
| 876 | } |
| 877 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 878 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 879 | requires_gnutls_next_no_ticket() { |
| 880 | requires_gnutls_next |
| 881 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 882 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 883 | fi |
| 884 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 885 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 886 | then |
| 887 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 888 | else |
| 889 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 890 | fi |
| 891 | fi |
| 892 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 893 | SKIP_NEXT="YES" |
| 894 | fi |
| 895 | } |
| 896 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 897 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 898 | requires_gnutls_next_disable_tls13_compat() { |
| 899 | requires_gnutls_next |
| 900 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 901 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 902 | fi |
| 903 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 904 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 905 | then |
| 906 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 907 | else |
| 908 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 909 | fi |
| 910 | fi |
| 911 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 912 | SKIP_NEXT="YES" |
| 913 | fi |
| 914 | } |
| 915 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 916 | # skip next test if GnuTLS does not support the record size limit extension |
| 917 | requires_gnutls_record_size_limit() { |
| 918 | requires_gnutls_next |
| 919 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 920 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="NO" |
| 921 | else |
| 922 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="YES" |
| 923 | fi |
| 924 | if [ "$GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE" = "NO" ]; then |
| 925 | SKIP_NEXT="YES" |
| 926 | fi |
| 927 | } |
| 928 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 929 | # skip next test if IPv6 isn't available on this host |
| 930 | requires_ipv6() { |
| 931 | if [ -z "${HAS_IPV6:-}" ]; then |
| 932 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 933 | SRV_PID=$! |
| 934 | sleep 1 |
| 935 | kill $SRV_PID >/dev/null 2>&1 |
| 936 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 937 | HAS_IPV6="NO" |
| 938 | else |
| 939 | HAS_IPV6="YES" |
| 940 | fi |
| 941 | rm -r $SRV_OUT |
| 942 | fi |
| 943 | |
| 944 | if [ "$HAS_IPV6" = "NO" ]; then |
| 945 | SKIP_NEXT="YES" |
| 946 | fi |
| 947 | } |
| 948 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 949 | # skip next test if it's i686 or uname is not available |
| 950 | requires_not_i686() { |
| 951 | if [ -z "${IS_I686:-}" ]; then |
| 952 | IS_I686="YES" |
| 953 | if which "uname" >/dev/null 2>&1; then |
| 954 | if [ -z "$(uname -a | grep i686)" ]; then |
| 955 | IS_I686="NO" |
| 956 | fi |
| 957 | fi |
| 958 | fi |
| 959 | if [ "$IS_I686" = "YES" ]; then |
| 960 | SKIP_NEXT="YES" |
| 961 | fi |
| 962 | } |
| 963 | |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 964 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 965 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 966 | 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] | 967 | if [ "$LIST_TESTS" -eq 0 ];then |
| 968 | # Calculate the input & output maximum content lengths set in the config |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 969 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 970 | # Calculate the maximum content length that fits both |
| 971 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 972 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 973 | fi |
| 974 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 975 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 976 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 977 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 978 | # skip the next test if the SSL output buffer is less than 16KB |
| 979 | requires_full_size_output_buffer() { |
| 980 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 981 | SKIP_NEXT="YES" |
| 982 | fi |
| 983 | } |
| 984 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 985 | # skip the next test if valgrind is in use |
| 986 | not_with_valgrind() { |
| 987 | if [ "$MEMCHECK" -gt 0 ]; then |
| 988 | SKIP_NEXT="YES" |
| 989 | fi |
| 990 | } |
| 991 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 992 | # skip the next test if valgrind is NOT in use |
| 993 | only_with_valgrind() { |
| 994 | if [ "$MEMCHECK" -eq 0 ]; then |
| 995 | SKIP_NEXT="YES" |
| 996 | fi |
| 997 | } |
| 998 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 999 | # 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] | 1000 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1001 | CLI_DELAY_FACTOR=$1 |
| 1002 | } |
| 1003 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1004 | # wait for the given seconds after the client finished in the next test |
| 1005 | server_needs_more_time() { |
| 1006 | SRV_DELAY_SECONDS=$1 |
| 1007 | } |
| 1008 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1009 | # print_name <name> |
| 1010 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 1011 | TESTS=$(( $TESTS + 1 )) |
| 1012 | LINE="" |
| 1013 | |
| 1014 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 1015 | LINE="$TESTS " |
| 1016 | fi |
| 1017 | |
| 1018 | LINE="$LINE$1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1019 | |
Tomás González | 378e364 | 2023-09-04 10:41:37 +0100 | [diff] [blame] | 1020 | printf "%s " "$LINE" |
| 1021 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
| 1022 | for i in `seq 1 $LEN`; do printf '.'; done |
| 1023 | printf ' ' |
| 1024 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1025 | } |
| 1026 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1027 | # record_outcome <outcome> [<failure-reason>] |
| 1028 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 1029 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1030 | record_outcome() { |
| 1031 | echo "$1" |
| 1032 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 1033 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 1034 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Jerry Yu | 9e47b26 | 2023-11-06 10:52:01 +0800 | [diff] [blame] | 1035 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1036 | "$1" "${2-}" \ |
| 1037 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 1038 | fi |
| 1039 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 1040 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1041 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 1042 | # True if the presence of the given pattern in a log definitely indicates |
| 1043 | # that the test has failed. False if the presence is inconclusive. |
| 1044 | # |
| 1045 | # Inputs: |
| 1046 | # * $1: pattern found in the logs |
| 1047 | # * $TIMES_LEFT: >0 if retrying is an option |
| 1048 | # |
| 1049 | # Outputs: |
| 1050 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 1051 | # unchanged otherwise. |
| 1052 | # * Return value: 1 if the pattern is inconclusive, |
| 1053 | # 0 if the failure is definitive. |
| 1054 | log_pattern_presence_is_conclusive() { |
| 1055 | # If we've run out of attempts, then don't retry no matter what. |
| 1056 | if [ $TIMES_LEFT -eq 0 ]; then |
| 1057 | return 0 |
| 1058 | fi |
| 1059 | case $1 in |
| 1060 | "resend") |
| 1061 | # An undesired resend may have been caused by the OS dropping or |
| 1062 | # delaying a packet at an inopportune time. |
| 1063 | outcome="RETRY(resend)" |
| 1064 | return 1;; |
| 1065 | esac |
| 1066 | } |
| 1067 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1068 | # fail <message> |
| 1069 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1070 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 1071 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1072 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 1073 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1074 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1075 | if [ -n "$PXY_CMD" ]; then |
| 1076 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1077 | fi |
| 1078 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1079 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 1080 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1081 | echo " ! server output:" |
| 1082 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1083 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1084 | echo " ! client output:" |
| 1085 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1086 | if [ -n "$PXY_CMD" ]; then |
| 1087 | echo " ! ========================================================" |
| 1088 | echo " ! proxy output:" |
| 1089 | cat o-pxy-${TESTS}.log |
| 1090 | fi |
| 1091 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1092 | fi |
| 1093 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 1094 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1095 | } |
| 1096 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1097 | # is_polar <cmd_line> |
| 1098 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1099 | case "$1" in |
| 1100 | *ssl_client2*) true;; |
| 1101 | *ssl_server2*) true;; |
| 1102 | *) false;; |
| 1103 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1104 | } |
| 1105 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 1106 | # openssl s_server doesn't have -www with DTLS |
| 1107 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1108 | case "$SRV_CMD" in |
| 1109 | *s_server*-dtls*) |
| 1110 | NEEDS_INPUT=1 |
| 1111 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 1112 | *) NEEDS_INPUT=0;; |
| 1113 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 1114 | } |
| 1115 | |
| 1116 | # provide input to commands that need it |
| 1117 | provide_input() { |
| 1118 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 1119 | return |
| 1120 | fi |
| 1121 | |
| 1122 | while true; do |
| 1123 | echo "HTTP/1.0 200 OK" |
| 1124 | sleep 1 |
| 1125 | done |
| 1126 | } |
| 1127 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1128 | # has_mem_err <log_file_name> |
| 1129 | has_mem_err() { |
| 1130 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 1131 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 1132 | then |
| 1133 | return 1 # false: does not have errors |
| 1134 | else |
| 1135 | return 0 # true: has errors |
| 1136 | fi |
| 1137 | } |
| 1138 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1139 | # 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] | 1140 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1141 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1142 | newline=' |
| 1143 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1144 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1145 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1146 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1147 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1148 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1149 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1150 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 1151 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1152 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1153 | # When we use a proxy, it will be listening on the same port we |
| 1154 | # 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] | 1155 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1156 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1157 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1158 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1159 | echo "$3 START TIMEOUT" |
| 1160 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1161 | break |
| 1162 | fi |
| 1163 | # Linux and *BSD support decimal arguments to sleep. On other |
| 1164 | # OSes this may be a tight loop. |
| 1165 | sleep 0.1 2>/dev/null || true |
| 1166 | done |
| 1167 | } |
| 1168 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1169 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 1170 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1171 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1172 | } |
| 1173 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1174 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1175 | # Wait for server process $2 to be listening on port $1. |
| 1176 | wait_server_start() { |
| 1177 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 1178 | } |
| 1179 | |
| 1180 | # Wait for proxy process $2 to be listening on port $1. |
| 1181 | wait_proxy_start() { |
| 1182 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 1183 | } |
| 1184 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1185 | # 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] | 1186 | # 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] | 1187 | # acceptable bounds |
| 1188 | check_server_hello_time() { |
| 1189 | # 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] | 1190 | 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] | 1191 | # Get the Unix timestamp for now |
| 1192 | CUR_TIME=$(date +'%s') |
| 1193 | THRESHOLD_IN_SECS=300 |
| 1194 | |
| 1195 | # Check if the ServerHello time was printed |
| 1196 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 1197 | return 1 |
| 1198 | fi |
| 1199 | |
| 1200 | # Check the time in ServerHello is within acceptable bounds |
| 1201 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 1202 | # The time in ServerHello is at least 5 minutes before now |
| 1203 | return 1 |
| 1204 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 1205 | # 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] | 1206 | return 1 |
| 1207 | else |
| 1208 | return 0 |
| 1209 | fi |
| 1210 | } |
| 1211 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1212 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 1213 | handshake_memory_get() { |
| 1214 | OUTPUT_VARIABLE="$1" |
| 1215 | OUTPUT_FILE="$2" |
| 1216 | |
| 1217 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 1218 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 1219 | |
| 1220 | # Check if memory usage was read |
| 1221 | if [ -z "$MEM_USAGE" ]; then |
| 1222 | echo "Error: Can not read the value of handshake memory usage" |
| 1223 | return 1 |
| 1224 | else |
| 1225 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 1226 | return 0 |
| 1227 | fi |
| 1228 | } |
| 1229 | |
| 1230 | # Get handshake memory usage from server or client output and check if this value |
| 1231 | # is not higher than the maximum given by the first argument |
| 1232 | handshake_memory_check() { |
| 1233 | MAX_MEMORY="$1" |
| 1234 | OUTPUT_FILE="$2" |
| 1235 | |
| 1236 | # Get memory usage |
| 1237 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 1238 | return 1 |
| 1239 | fi |
| 1240 | |
| 1241 | # Check if memory usage is below max value |
| 1242 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 1243 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 1244 | "but should be below $MAX_MEMORY bytes" |
| 1245 | return 1 |
| 1246 | else |
| 1247 | return 0 |
| 1248 | fi |
| 1249 | } |
| 1250 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1251 | # wait for client to terminate and set CLI_EXIT |
| 1252 | # must be called right after starting the client |
| 1253 | wait_client_done() { |
| 1254 | CLI_PID=$! |
| 1255 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1256 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 1257 | CLI_DELAY_FACTOR=1 |
| 1258 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1259 | ( 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] | 1260 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1261 | |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1262 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
| 1263 | # To remove it from stdout, redirect stdout/stderr to CLI_OUT |
| 1264 | wait $CLI_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1265 | CLI_EXIT=$? |
| 1266 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1267 | kill $DOG_PID >/dev/null 2>&1 |
Jerry Yu | fe52e55 | 2022-07-09 04:23:43 +0000 | [diff] [blame] | 1268 | wait $DOG_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1269 | |
| 1270 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1271 | |
| 1272 | sleep $SRV_DELAY_SECONDS |
| 1273 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1274 | } |
| 1275 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1276 | # check if the given command uses dtls and sets global variable DTLS |
| 1277 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1278 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 1279 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1280 | *) DTLS=0;; |
| 1281 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1282 | } |
| 1283 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1284 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 1285 | is_gnutls() { |
| 1286 | case "$1" in |
| 1287 | *gnutls-cli*) |
| 1288 | CMD_IS_GNUTLS=1 |
| 1289 | ;; |
| 1290 | *gnutls-serv*) |
| 1291 | CMD_IS_GNUTLS=1 |
| 1292 | ;; |
| 1293 | *) |
| 1294 | CMD_IS_GNUTLS=0 |
| 1295 | ;; |
| 1296 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1297 | } |
| 1298 | |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 1299 | # Some external tools (gnutls or openssl) might not have support for static ECDH |
| 1300 | # 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] | 1301 | # and client command lines, given as input, to verify if the current test |
| 1302 | # is using one of these tools. |
| 1303 | use_ext_tool_without_ecdh_support() { |
| 1304 | case "$1" in |
| 1305 | *$GNUTLS_SERV*|\ |
| 1306 | *${GNUTLS_NEXT_SERV:-"gnutls-serv-dummy"}*|\ |
| 1307 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1308 | echo "yes" |
| 1309 | return;; |
| 1310 | esac |
| 1311 | case "$2" in |
| 1312 | *$GNUTLS_CLI*|\ |
| 1313 | *${GNUTLS_NEXT_CLI:-"gnutls-cli-dummy"}*|\ |
| 1314 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1315 | echo "yes" |
| 1316 | return;; |
| 1317 | esac |
| 1318 | echo "no" |
| 1319 | } |
| 1320 | |
Jerry Yu | f467d46 | 2022-11-07 13:12:44 +0800 | [diff] [blame] | 1321 | # Generate random psk_list argument for ssl_server2 |
| 1322 | get_srv_psk_list () |
| 1323 | { |
| 1324 | case $(( TESTS % 3 )) in |
| 1325 | 0) echo "psk_list=abc,dead,def,beef,Client_identity,6162636465666768696a6b6c6d6e6f70";; |
| 1326 | 1) echo "psk_list=abc,dead,Client_identity,6162636465666768696a6b6c6d6e6f70,def,beef";; |
| 1327 | 2) echo "psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70,abc,dead,def,beef";; |
| 1328 | esac |
| 1329 | } |
| 1330 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1331 | # Determine what calc_verify trace is to be expected, if any. |
| 1332 | # |
| 1333 | # calc_verify is only called for two things: to calculate the |
| 1334 | # extended master secret, and to process client authentication. |
| 1335 | # |
| 1336 | # Warning: the current implementation assumes that extended_ms is not |
| 1337 | # disabled on the client or on the server. |
| 1338 | # |
| 1339 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1340 | # * $1: the value of the server auth_mode parameter. |
| 1341 | # 'required' if client authentication is expected, |
| 1342 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1343 | # * $CONFIGS_ENABLED |
| 1344 | # |
| 1345 | # Outputs: |
| 1346 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 1347 | set_maybe_calc_verify() { |
| 1348 | maybe_calc_verify= |
| 1349 | case $CONFIGS_ENABLED in |
| 1350 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 1351 | *) |
| 1352 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1353 | ''|none) return;; |
| 1354 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1355 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 1356 | esac |
| 1357 | esac |
| 1358 | case $CONFIGS_ENABLED in |
| 1359 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 1360 | *) maybe_calc_verify="<= calc verify";; |
| 1361 | esac |
| 1362 | } |
| 1363 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1364 | # Compare file content |
| 1365 | # Usage: find_in_both pattern file1 file2 |
| 1366 | # extract from file1 the first line matching the pattern |
| 1367 | # check in file2 that the same line can be found |
| 1368 | find_in_both() { |
| 1369 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 1370 | if [ -z "$srv_pattern" ]; then |
| 1371 | return 1; |
| 1372 | fi |
| 1373 | |
| 1374 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 1375 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1376 | else |
| 1377 | return 1; |
| 1378 | fi |
| 1379 | } |
| 1380 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1381 | SKIP_HANDSHAKE_CHECK="NO" |
| 1382 | skip_handshake_stage_check() { |
| 1383 | SKIP_HANDSHAKE_CHECK="YES" |
| 1384 | } |
| 1385 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1386 | # Analyze the commands that will be used in a test. |
| 1387 | # |
| 1388 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 1389 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 1390 | # |
| 1391 | # Inputs: |
| 1392 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 1393 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 1394 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 1395 | # |
| 1396 | # Outputs: |
| 1397 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1398 | analyze_test_commands() { |
Gilles Peskine | ae710c8 | 2024-09-04 16:07:56 +0200 | [diff] [blame] | 1399 | # If the test uses DTLS, does not force a specific port, and does not |
| 1400 | # specify a custom proxy, add a simple proxy. |
| 1401 | # It provides timing info that's useful to debug failures. |
| 1402 | if [ "$DTLS" -eq 1 ] && |
| 1403 | [ "$THIS_SRV_PORT" = "$SRV_PORT" ] && |
| 1404 | [ -z "$PXY_CMD" ] |
| 1405 | then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1406 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 1407 | case " $SRV_CMD " in |
| 1408 | *' server_addr=::1 '*) |
| 1409 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 1410 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1411 | fi |
| 1412 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1413 | # update CMD_IS_GNUTLS variable |
| 1414 | is_gnutls "$SRV_CMD" |
| 1415 | |
| 1416 | # if the server uses gnutls but doesn't set priority, explicitly |
| 1417 | # set the default priority |
| 1418 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1419 | case "$SRV_CMD" in |
| 1420 | *--priority*) :;; |
| 1421 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 1422 | esac |
| 1423 | fi |
| 1424 | |
| 1425 | # update CMD_IS_GNUTLS variable |
| 1426 | is_gnutls "$CLI_CMD" |
| 1427 | |
| 1428 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1429 | # set the default priority |
| 1430 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1431 | case "$CLI_CMD" in |
| 1432 | *--priority*) :;; |
| 1433 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1434 | esac |
| 1435 | fi |
| 1436 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1437 | # fix client port |
| 1438 | if [ -n "$PXY_CMD" ]; then |
| 1439 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1440 | else |
Gilles Peskine | 2bc5c80 | 2024-09-04 16:05:11 +0200 | [diff] [blame] | 1441 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$THIS_SRV_PORT/g ) |
| 1442 | fi |
| 1443 | |
| 1444 | # If the test forces a specific port and the server is OpenSSL or |
| 1445 | # GnuTLS, override its port specification. |
| 1446 | if [ "$THIS_SRV_PORT" != "$SRV_PORT" ]; then |
| 1447 | case "$SRV_CMD" in |
| 1448 | "$G_SRV"*|"$G_NEXT_SRV"*) SRV_CMD="$SRV_CMD -p $THIS_SRV_PORT";; |
| 1449 | "$O_SRV"*|"$O_NEXT_SRV"*) SRV_CMD="$SRV_CMD -accept $THIS_SRV_PORT";; |
| 1450 | esac |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1451 | fi |
| 1452 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1453 | # prepend valgrind to our commands if active |
| 1454 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1455 | if is_polar "$SRV_CMD"; then |
| 1456 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1457 | fi |
| 1458 | if is_polar "$CLI_CMD"; then |
| 1459 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1460 | fi |
| 1461 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1462 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1463 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1464 | # Check for failure conditions after a test case. |
| 1465 | # |
| 1466 | # Inputs from run_test: |
| 1467 | # * positional parameters: test options (see run_test documentation) |
| 1468 | # * $CLI_EXIT: client return code |
| 1469 | # * $CLI_EXPECT: expected client return code |
| 1470 | # * $SRV_RET: server return code |
| 1471 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1472 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1473 | # |
| 1474 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1475 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1476 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1477 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1478 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1479 | if [ $TIMES_LEFT -gt 0 ] && |
| 1480 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1481 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1482 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1483 | return |
| 1484 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1485 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1486 | # 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] | 1487 | # (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] | 1488 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1489 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1490 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1491 | then |
| 1492 | if is_polar "$SRV_CMD"; then |
| 1493 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1494 | else |
| 1495 | fail "server or client failed to reach handshake stage" |
| 1496 | return |
| 1497 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1498 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1499 | if is_polar "$CLI_CMD"; then |
| 1500 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1501 | else |
| 1502 | fail "server or client failed to reach handshake stage" |
| 1503 | return |
| 1504 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1505 | fi |
| 1506 | fi |
| 1507 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1508 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1509 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1510 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1511 | # care anyway), in case e.g. the server reports a memory leak. |
| 1512 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1513 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1514 | return |
| 1515 | fi |
| 1516 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1517 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1518 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1519 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1520 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1521 | 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] | 1522 | return |
| 1523 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1524 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1525 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1526 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1527 | # 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] | 1528 | while [ $# -gt 0 ] |
| 1529 | do |
| 1530 | case $1 in |
| 1531 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1532 | 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] | 1533 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1534 | return |
| 1535 | fi |
| 1536 | ;; |
| 1537 | |
| 1538 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1539 | 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] | 1540 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1541 | return |
| 1542 | fi |
| 1543 | ;; |
| 1544 | |
| 1545 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1546 | 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] | 1547 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1548 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1549 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1550 | return |
| 1551 | fi |
| 1552 | ;; |
| 1553 | |
| 1554 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1555 | 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] | 1556 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1557 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1558 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1559 | return |
| 1560 | fi |
| 1561 | ;; |
| 1562 | |
| 1563 | # The filtering in the following two options (-u and -U) do the following |
| 1564 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1565 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1566 | # - keep one of each non-unique line |
| 1567 | # - count how many lines remain |
| 1568 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1569 | # if there were no duplicates. |
| 1570 | "-U") |
| 1571 | 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 |
| 1572 | fail "lines following pattern '$2' must be unique in Server output" |
| 1573 | return |
| 1574 | fi |
| 1575 | ;; |
| 1576 | |
| 1577 | "-u") |
| 1578 | 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 |
| 1579 | 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] | 1580 | return |
| 1581 | fi |
| 1582 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1583 | "-F") |
| 1584 | if ! $2 "$SRV_OUT"; then |
| 1585 | fail "function call to '$2' failed on Server output" |
| 1586 | return |
| 1587 | fi |
| 1588 | ;; |
| 1589 | "-f") |
| 1590 | if ! $2 "$CLI_OUT"; then |
| 1591 | fail "function call to '$2' failed on Client output" |
| 1592 | return |
| 1593 | fi |
| 1594 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1595 | "-g") |
| 1596 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1597 | fail "function call to '$2' failed on Server and Client output" |
| 1598 | return |
| 1599 | fi |
| 1600 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1601 | |
| 1602 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1603 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1604 | exit 1 |
| 1605 | esac |
| 1606 | shift 2 |
| 1607 | done |
| 1608 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1609 | # check valgrind's results |
| 1610 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1611 | 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] | 1612 | fail "Server has memory errors" |
| 1613 | return |
| 1614 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1615 | 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] | 1616 | fail "Client has memory errors" |
| 1617 | return |
| 1618 | fi |
| 1619 | fi |
| 1620 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1621 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1622 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1623 | } |
| 1624 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1625 | # Run the current test case: start the server and if applicable the proxy, run |
| 1626 | # the client, wait for all processes to finish or time out. |
| 1627 | # |
| 1628 | # Inputs: |
| 1629 | # * $NAME: test case name |
| 1630 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1631 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1632 | # |
| 1633 | # Outputs: |
| 1634 | # * $CLI_EXIT: client return code |
| 1635 | # * $SRV_RET: server return code |
| 1636 | do_run_test_once() { |
| 1637 | # run the commands |
| 1638 | if [ -n "$PXY_CMD" ]; then |
| 1639 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1640 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1641 | PXY_PID=$! |
| 1642 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1643 | fi |
| 1644 | |
| 1645 | check_osrv_dtls |
| 1646 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1647 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1648 | SRV_PID=$! |
Gilles Peskine | 2bc5c80 | 2024-09-04 16:05:11 +0200 | [diff] [blame] | 1649 | wait_server_start "$THIS_SRV_PORT" "$SRV_PID" |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1650 | |
| 1651 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1652 | # The client must be a subprocess of the script in order for killing it to |
| 1653 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1654 | # not at the end of the line: the latter approach will spawn eval as a |
| 1655 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1656 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1657 | wait_client_done |
| 1658 | |
| 1659 | sleep 0.05 |
| 1660 | |
| 1661 | # terminate the server (and the proxy) |
| 1662 | kill $SRV_PID |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1663 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
Jerry Yu | 27d8092 | 2022-08-02 21:28:55 +0800 | [diff] [blame] | 1664 | # To remove it from stdout, redirect stdout/stderr to SRV_OUT |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1665 | wait $SRV_PID >> $SRV_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1666 | SRV_RET=$? |
| 1667 | |
| 1668 | if [ -n "$PXY_CMD" ]; then |
| 1669 | kill $PXY_PID >/dev/null 2>&1 |
Jerry Yu | 6969eee | 2022-10-10 10:25:26 +0800 | [diff] [blame] | 1670 | wait $PXY_PID >> $PXY_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1671 | fi |
| 1672 | } |
| 1673 | |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1674 | # 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] | 1675 | # $1 and $2 contain the server and client command lines, respectively. |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1676 | # |
| 1677 | # Note: this function only provides some guess about TLS version by simply |
Yanray Wang | 7b320fa | 2023-11-08 10:33:30 +0800 | [diff] [blame] | 1678 | # looking at the server/client command lines. Even though this works |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1679 | # for the sake of tests' filtering (especially in conjunction with the |
| 1680 | # detect_required_features() function), it does NOT guarantee that the |
| 1681 | # result is accurate. It does not check other conditions, such as: |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1682 | # - we can force a ciphersuite which contains "WITH" in its name, meaning |
| 1683 | # that we are going to use TLS 1.2 |
| 1684 | # - etc etc |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1685 | get_tls_version() { |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1686 | # First check if the version is forced on an Mbed TLS peer |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1687 | case $1 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1688 | *tls12*) |
| 1689 | echo "TLS12" |
| 1690 | return;; |
| 1691 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1692 | echo "TLS13" |
| 1693 | return;; |
| 1694 | esac |
| 1695 | case $2 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1696 | *tls12*) |
| 1697 | echo "TLS12" |
| 1698 | return;; |
| 1699 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1700 | echo "TLS13" |
| 1701 | return;; |
| 1702 | esac |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1703 | # Second check if the version is forced on an OpenSSL or GnuTLS peer |
| 1704 | case $1 in |
| 1705 | tls1_2*) |
| 1706 | echo "TLS12" |
| 1707 | return;; |
| 1708 | *tls1_3) |
| 1709 | echo "TLS13" |
| 1710 | return;; |
| 1711 | esac |
| 1712 | case $2 in |
| 1713 | *tls1_2) |
| 1714 | echo "TLS12" |
| 1715 | return;; |
| 1716 | *tls1_3) |
| 1717 | echo "TLS13" |
| 1718 | return;; |
| 1719 | esac |
| 1720 | # Third if the version is not forced, if TLS 1.3 is enabled then the test |
| 1721 | # is aimed to run a TLS 1.3 handshake. |
Gilles Peskine | 9404169 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 1722 | if is_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1723 | then |
| 1724 | echo "TLS13" |
| 1725 | else |
| 1726 | echo "TLS12" |
| 1727 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1728 | } |
| 1729 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1730 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1731 | # Options: -s pattern pattern that must be present in server output |
| 1732 | # -c pattern pattern that must be present in client output |
| 1733 | # -u pattern lines after pattern must be unique in client output |
| 1734 | # -f call shell function on client output |
| 1735 | # -S pattern pattern that must be absent in server output |
| 1736 | # -C pattern pattern that must be absent in client output |
| 1737 | # -U pattern lines after pattern must be unique in server output |
| 1738 | # -F call shell function on server output |
| 1739 | # -g call shell function on server and client output |
| 1740 | run_test() { |
| 1741 | NAME="$1" |
| 1742 | shift 1 |
| 1743 | |
Tomás González | 787428a | 2023-08-23 15:27:19 +0100 | [diff] [blame] | 1744 | if is_excluded "$NAME"; then |
| 1745 | SKIP_NEXT="NO" |
| 1746 | # There was no request to run the test, so don't record its outcome. |
| 1747 | return |
| 1748 | fi |
| 1749 | |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1750 | if [ "$LIST_TESTS" -gt 0 ]; then |
Pengyu Lv | 3c170d3 | 2023-11-29 13:53:34 +0800 | [diff] [blame] | 1751 | printf "%s\n" "${TEST_SUITE_NAME:-ssl-opt};$NAME" |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1752 | return |
| 1753 | fi |
| 1754 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 1755 | # Use ssl-opt as default test suite name. Also see record_outcome function |
| 1756 | if is_excluded_test_suite "${TEST_SUITE_NAME:-ssl-opt}"; then |
| 1757 | # Do not skip next test and skip current test. |
| 1758 | SKIP_NEXT="NO" |
| 1759 | return |
| 1760 | fi |
| 1761 | |
Tomás González | 51cb704 | 2023-09-07 10:21:19 +0100 | [diff] [blame] | 1762 | print_name "$NAME" |
| 1763 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1764 | # Do we only run numbered tests? |
| 1765 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1766 | case ",$RUN_TEST_NUMBER," in |
| 1767 | *",$TESTS,"*) :;; |
| 1768 | *) SKIP_NEXT="YES";; |
| 1769 | esac |
| 1770 | fi |
| 1771 | |
Gilles Peskine | ae710c8 | 2024-09-04 16:07:56 +0200 | [diff] [blame] | 1772 | # Does this test specify a proxy? |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1773 | if [ "X$1" = "X-p" ]; then |
| 1774 | PXY_CMD="$2" |
| 1775 | shift 2 |
| 1776 | else |
| 1777 | PXY_CMD="" |
| 1778 | fi |
| 1779 | |
Gilles Peskine | 2bc5c80 | 2024-09-04 16:05:11 +0200 | [diff] [blame] | 1780 | # Does this test force a specific port? |
| 1781 | if [ "$1" = "-P" ]; then |
| 1782 | THIS_SRV_PORT="$2" |
| 1783 | shift 2 |
| 1784 | else |
| 1785 | THIS_SRV_PORT="$SRV_PORT" |
| 1786 | fi |
| 1787 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1788 | # get commands and client output |
| 1789 | SRV_CMD="$1" |
| 1790 | CLI_CMD="$2" |
| 1791 | CLI_EXPECT="$3" |
| 1792 | shift 3 |
| 1793 | |
| 1794 | # Check if test uses files |
| 1795 | case "$SRV_CMD $CLI_CMD" in |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1796 | *$DATA_FILES_PATH/*) |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1797 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1798 | esac |
| 1799 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1800 | # Check if the test uses DTLS. |
| 1801 | detect_dtls "$SRV_CMD" |
| 1802 | if [ "$DTLS" -eq 1 ]; then |
| 1803 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1804 | fi |
| 1805 | |
Yanray Wang | 7b320fa | 2023-11-08 10:33:30 +0800 | [diff] [blame] | 1806 | # 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] | 1807 | EXT_WO_ECDH=$(use_ext_tool_without_ecdh_support "$SRV_CMD" "$CLI_CMD") |
| 1808 | |
Valerio Setti | 726ffbf | 2023-08-02 20:02:44 +0200 | [diff] [blame] | 1809 | # Guess the TLS version which is going to be used |
| 1810 | if [ "$EXT_WO_ECDH" = "no" ]; then |
| 1811 | TLS_VERSION=$(get_tls_version "$SRV_CMD" "$CLI_CMD") |
| 1812 | else |
| 1813 | TLS_VERSION="TLS12" |
| 1814 | fi |
| 1815 | |
Gilles Peskine | 4f09864 | 2024-09-06 15:35:58 +0200 | [diff] [blame] | 1816 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1817 | maybe_adapt_for_psk "$@" |
| 1818 | |
Valerio Setti | 726ffbf | 2023-08-02 20:02:44 +0200 | [diff] [blame] | 1819 | # 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] | 1820 | # from their command-line arguments, check whether they're enabled. |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1821 | detect_required_features "$SRV_CMD" "server" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
| 1822 | detect_required_features "$CLI_CMD" "client" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1823 | |
| 1824 | # should we skip? |
| 1825 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1826 | SKIP_NEXT="NO" |
| 1827 | record_outcome "SKIP" |
| 1828 | SKIPS=$(( $SKIPS + 1 )) |
| 1829 | return |
| 1830 | fi |
| 1831 | |
| 1832 | analyze_test_commands "$@" |
| 1833 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1834 | # One regular run and two retries |
| 1835 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1836 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1837 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1838 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1839 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1840 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1841 | check_test_failure "$@" |
| 1842 | case $outcome in |
| 1843 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1844 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1845 | FAIL) return;; |
| 1846 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1847 | done |
| 1848 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1849 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1850 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1851 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1852 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1853 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1854 | if [ -n "$PXY_CMD" ]; then |
| 1855 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1856 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1857 | fi |
| 1858 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1859 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1860 | } |
| 1861 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1862 | run_test_psa() { |
| 1863 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1864 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1865 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1866 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1867 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1868 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1869 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1870 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1871 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1872 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1873 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1874 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1875 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1876 | -S "error" \ |
| 1877 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1878 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1879 | } |
| 1880 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1881 | run_test_psa_force_curve() { |
| 1882 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1883 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1884 | run_test "PSA - ECDH with $1" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 1885 | "$P_SRV debug_level=4 force_version=tls12 groups=$1" \ |
| 1886 | "$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] | 1887 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1888 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1889 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1890 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1891 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1892 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1893 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1894 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1895 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1896 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1897 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1898 | } |
| 1899 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1900 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1901 | # a maximum fragment length. |
| 1902 | # first argument ($1) is MFL for SSL client |
| 1903 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1904 | run_test_memory_after_handshake_with_mfl() |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1905 | { |
| 1906 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1907 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1908 | |
| 1909 | # Leave some margin for robustness |
| 1910 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1911 | |
| 1912 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1913 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1914 | "$P_CLI debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1915 | 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] | 1916 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1917 | 0 \ |
| 1918 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1919 | } |
| 1920 | |
| 1921 | |
| 1922 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1923 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1924 | run_tests_memory_after_handshake() |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1925 | { |
| 1926 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1927 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1928 | |
| 1929 | # first test with default MFU is to get reference memory usage |
| 1930 | MEMORY_USAGE_MFL_16K=0 |
| 1931 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1932 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1933 | "$P_CLI debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1934 | 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] | 1935 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1936 | 0 \ |
| 1937 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1938 | |
| 1939 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1940 | run_test_memory_after_handshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1941 | |
| 1942 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1943 | run_test_memory_after_handshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1944 | |
| 1945 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1946 | run_test_memory_after_handshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1947 | |
| 1948 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1949 | run_test_memory_after_handshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1950 | } |
| 1951 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1952 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1953 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1954 | rm -f context_srv.txt |
| 1955 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1956 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1957 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1958 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1959 | 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] | 1960 | exit 1 |
| 1961 | } |
| 1962 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1963 | # |
| 1964 | # MAIN |
| 1965 | # |
| 1966 | |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 1967 | # Make the outcome file path relative to the original directory, not |
| 1968 | # to .../tests |
| 1969 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 1970 | [!/]*) |
| 1971 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 1972 | ;; |
| 1973 | esac |
| 1974 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 1975 | populate_enabled_hash_algs |
| 1976 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1977 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1978 | # patterns rather than regular expressions, use a case statement instead |
| 1979 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1980 | # detects simple cases: plain substring, everything, nothing. |
| 1981 | # |
| 1982 | # As an exception, the character '.' is treated as an ordinary character |
| 1983 | # if it is the only special character in the string. This is because it's |
| 1984 | # rare to need "any one character", but needing a literal '.' is common |
| 1985 | # (e.g. '-f "DTLS 1.2"'). |
| 1986 | need_grep= |
| 1987 | case "$FILTER" in |
| 1988 | '^$') simple_filter=;; |
| 1989 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1990 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1991 | need_grep=1;; |
| 1992 | *) # No regexp or shell-pattern special character |
| 1993 | simple_filter="*$FILTER*";; |
| 1994 | esac |
| 1995 | case "$EXCLUDE" in |
| 1996 | '^$') simple_exclude=;; |
| 1997 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1998 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1999 | need_grep=1;; |
| 2000 | *) # No regexp or shell-pattern special character |
| 2001 | simple_exclude="*$EXCLUDE*";; |
| 2002 | esac |
| 2003 | if [ -n "$need_grep" ]; then |
| 2004 | is_excluded () { |
| 2005 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 2006 | } |
| 2007 | else |
| 2008 | is_excluded () { |
| 2009 | case "$1" in |
| 2010 | $simple_exclude) true;; |
| 2011 | $simple_filter) false;; |
| 2012 | *) true;; |
| 2013 | esac |
| 2014 | } |
| 2015 | fi |
| 2016 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 2017 | # Filter tests according to TEST_SUITE_NAME |
| 2018 | is_excluded_test_suite () { |
| 2019 | if [ -n "$RUN_TEST_SUITE" ] |
| 2020 | then |
| 2021 | case ",$RUN_TEST_SUITE," in |
| 2022 | *",$1,"*) false;; |
| 2023 | *) true;; |
| 2024 | esac |
| 2025 | else |
| 2026 | false |
| 2027 | fi |
| 2028 | |
| 2029 | } |
| 2030 | |
| 2031 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 2032 | if [ "$LIST_TESTS" -eq 0 ];then |
| 2033 | |
| 2034 | # sanity checks, avoid an avalanche of errors |
| 2035 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 2036 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 2037 | P_PXY_BIN="${P_PXY%%[ ]*}" |
| 2038 | if [ ! -x "$P_SRV_BIN" ]; then |
| 2039 | echo "Command '$P_SRV_BIN' is not an executable file" |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 2040 | exit 1 |
| 2041 | fi |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 2042 | if [ ! -x "$P_CLI_BIN" ]; then |
| 2043 | echo "Command '$P_CLI_BIN' is not an executable file" |
| 2044 | exit 1 |
| 2045 | fi |
| 2046 | if [ ! -x "$P_PXY_BIN" ]; then |
| 2047 | echo "Command '$P_PXY_BIN' is not an executable file" |
| 2048 | exit 1 |
| 2049 | fi |
| 2050 | if [ "$MEMCHECK" -gt 0 ]; then |
| 2051 | if which valgrind >/dev/null 2>&1; then :; else |
| 2052 | echo "Memcheck not possible. Valgrind not found" |
| 2053 | exit 1 |
| 2054 | fi |
| 2055 | fi |
| 2056 | if which $OPENSSL >/dev/null 2>&1; then :; else |
| 2057 | echo "Command '$OPENSSL' not found" |
| 2058 | exit 1 |
| 2059 | fi |
| 2060 | |
| 2061 | # used by watchdog |
| 2062 | MAIN_PID="$$" |
| 2063 | |
| 2064 | # We use somewhat arbitrary delays for tests: |
| 2065 | # - how long do we wait for the server to start (when lsof not available)? |
| 2066 | # - how long do we allow for the client to finish? |
| 2067 | # (not to check performance, just to avoid waiting indefinitely) |
| 2068 | # Things are slower with valgrind, so give extra time here. |
| 2069 | # |
| 2070 | # Note: without lsof, there is a trade-off between the running time of this |
| 2071 | # script and the risk of spurious errors because we didn't wait long enough. |
| 2072 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 2073 | # the script, only the case where a client or server gets stuck. |
| 2074 | if [ "$MEMCHECK" -gt 0 ]; then |
| 2075 | START_DELAY=6 |
| 2076 | DOG_DELAY=60 |
| 2077 | else |
| 2078 | START_DELAY=2 |
| 2079 | DOG_DELAY=20 |
| 2080 | fi |
| 2081 | |
| 2082 | # some particular tests need more time: |
| 2083 | # - for the client, we multiply the usual watchdog limit by a factor |
| 2084 | # - for the server, we sleep for a number of seconds after the client exits |
| 2085 | # see client_need_more_time() and server_needs_more_time() |
| 2086 | CLI_DELAY_FACTOR=1 |
| 2087 | SRV_DELAY_SECONDS=0 |
| 2088 | |
| 2089 | # fix commands to use this port, force IPv4 while at it |
| 2090 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
| 2091 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 2092 | # machines that will resolve to ::1, and we don't want ipv6 here. |
| 2093 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 2094 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
| 2095 | 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"}" |
| 2096 | O_SRV="$O_SRV -accept $SRV_PORT" |
| 2097 | O_CLI="$O_CLI -connect 127.0.0.1:+SRV_PORT" |
| 2098 | G_SRV="$G_SRV -p $SRV_PORT" |
| 2099 | G_CLI="$G_CLI -p +SRV_PORT" |
| 2100 | |
| 2101 | # Newer versions of OpenSSL have a syntax to enable all "ciphers", even |
| 2102 | # low-security ones. This covers not just cipher suites but also protocol |
| 2103 | # versions. It is necessary, for example, to use (D)TLS 1.0/1.1 on |
| 2104 | # OpenSSL 1.1.1f from Ubuntu 20.04. The syntax was only introduced in |
| 2105 | # OpenSSL 1.1.0 (21e0c1d23afff48601eb93135defddae51f7e2e3) and I can't find |
| 2106 | # a way to discover it from -help, so check the openssl version. |
| 2107 | case $($OPENSSL version) in |
| 2108 | "OpenSSL 0"*|"OpenSSL 1.0"*) :;; |
| 2109 | *) |
| 2110 | O_CLI="$O_CLI -cipher ALL@SECLEVEL=0" |
| 2111 | O_SRV="$O_SRV -cipher ALL@SECLEVEL=0" |
| 2112 | ;; |
| 2113 | esac |
| 2114 | |
| 2115 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 2116 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
| 2117 | O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT" |
| 2118 | O_NEXT_SRV_EARLY_DATA="$O_NEXT_SRV_EARLY_DATA -accept $SRV_PORT" |
| 2119 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
| 2120 | O_NEXT_CLI_NO_CERT="$O_NEXT_CLI_NO_CERT -connect 127.0.0.1:+SRV_PORT" |
| 2121 | fi |
| 2122 | |
| 2123 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
| 2124 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 2125 | G_NEXT_SRV_NO_CERT="$G_NEXT_SRV_NO_CERT -p $SRV_PORT" |
| 2126 | fi |
| 2127 | |
| 2128 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
| 2129 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
| 2130 | G_NEXT_CLI_NO_CERT="$G_NEXT_CLI_NO_CERT -p +SRV_PORT localhost" |
| 2131 | fi |
| 2132 | |
| 2133 | # Allow SHA-1, because many of our test certificates use it |
| 2134 | P_SRV="$P_SRV allow_sha1=1" |
| 2135 | P_CLI="$P_CLI allow_sha1=1" |
| 2136 | |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 2137 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2138 | # Also pick a unique name for intermediate files |
| 2139 | SRV_OUT="srv_out.$$" |
| 2140 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 2141 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2142 | SESSION="session.$$" |
| 2143 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 2144 | SKIP_NEXT="NO" |
| 2145 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 2146 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 2147 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2148 | # Basic test |
| 2149 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2150 | # Checks that: |
| 2151 | # - 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] | 2152 | # - the expected parameters are selected |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2153 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2154 | requires_hash_alg SHA_512 # "signature_algorithm ext: 6" |
Gilles Peskine | cd4fe70 | 2024-09-07 19:50:17 +0200 | [diff] [blame] | 2155 | requires_any_configs_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED \ |
| 2156 | PSA_WANT_ECC_MONTGOMERY_255 |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2157 | run_test "Default, TLS 1.2" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2158 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2159 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2160 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2161 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 2162 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2163 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 2164 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2165 | -S "error" \ |
| 2166 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2167 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2168 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2169 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2170 | run_test "Default, DTLS" \ |
| 2171 | "$P_SRV dtls=1" \ |
| 2172 | "$P_CLI dtls=1" \ |
| 2173 | 0 \ |
| 2174 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 2175 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2176 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 2177 | run_test "TLS client auth: required" \ |
| 2178 | "$P_SRV auth_mode=required" \ |
| 2179 | "$P_CLI" \ |
| 2180 | 0 \ |
| 2181 | -s "Verifying peer X.509 certificate... ok" |
| 2182 | |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 2183 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2184 | "$P_SRV" \ |
| 2185 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2186 | 0 \ |
| 2187 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2188 | -c "Key size is 256" |
| 2189 | |
| 2190 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2191 | "$P_SRV" \ |
| 2192 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2193 | 0 \ |
| 2194 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2195 | -c "Key size is 128" |
| 2196 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2197 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2198 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2199 | # module does not support PSA dispatching so we need builtin support. |
| 2200 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2201 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2202 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2203 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2204 | run_test "TLS: password protected client key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2205 | "$P_SRV force_version=tls12 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2206 | "$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] | 2207 | 0 |
| 2208 | |
| 2209 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2210 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2211 | # module does not support PSA dispatching so we need builtin support. |
| 2212 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2213 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2214 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2215 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2216 | run_test "TLS: password protected server key" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2217 | "$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] | 2218 | "$P_CLI force_version=tls12" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2219 | 0 |
| 2220 | |
| 2221 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2222 | requires_config_enabled MBEDTLS_RSA_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2223 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2224 | # module does not support PSA dispatching so we need builtin support. |
| 2225 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2226 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2227 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2228 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2229 | run_test "TLS: password protected server key, two certificates" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2230 | "$P_SRV force_version=tls12\ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2231 | key_file=$DATA_FILES_PATH/server5.key.enc key_pwd=PolarSSLTest crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2232 | 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] | 2233 | "$P_CLI" \ |
| 2234 | 0 |
| 2235 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2236 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2237 | run_test "CA callback on client" \ |
| 2238 | "$P_SRV debug_level=3" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 2239 | "$P_CLI ca_callback=1 debug_level=3 " \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2240 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2241 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2242 | -S "error" \ |
| 2243 | -C "error" |
| 2244 | |
| 2245 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2246 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2247 | requires_hash_alg SHA_256 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2248 | run_test "CA callback on server" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 2249 | "$P_SRV auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2250 | "$P_CLI ca_callback=1 debug_level=3 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2251 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2252 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2253 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2254 | -s "Verifying peer X.509 certificate... ok" \ |
| 2255 | -S "error" \ |
| 2256 | -C "error" |
| 2257 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2258 | # Test using an EC opaque private key for client authentication |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2259 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2260 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2261 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2262 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2263 | run_test "Opaque key for client authentication: ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2264 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2265 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 2266 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2267 | 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] | 2268 | 0 \ |
| 2269 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2270 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2271 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2272 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2273 | -S "error" \ |
| 2274 | -C "error" |
| 2275 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2276 | # Test using a RSA opaque private key for client authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2277 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2278 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2279 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2280 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2281 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2282 | run_test "Opaque key for client authentication: ECDHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2283 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2284 | key_file=$DATA_FILES_PATH/server2.key" \ |
| 2285 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2286 | 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] | 2287 | 0 \ |
| 2288 | -c "key type: Opaque" \ |
| 2289 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2290 | -s "Verifying peer X.509 certificate... ok" \ |
| 2291 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2292 | -S "error" \ |
| 2293 | -C "error" |
| 2294 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2295 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2296 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2297 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2298 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2299 | run_test "Opaque key for client authentication: DHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2300 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2301 | key_file=$DATA_FILES_PATH/server2.key" \ |
| 2302 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2303 | 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] | 2304 | key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2305 | 0 \ |
| 2306 | -c "key type: Opaque" \ |
| 2307 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2308 | -s "Verifying peer X.509 certificate... ok" \ |
| 2309 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2310 | -S "error" \ |
| 2311 | -C "error" |
| 2312 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2313 | # Test using an EC opaque private key for server authentication |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2314 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2315 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2316 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2317 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2318 | run_test "Opaque key for server authentication: ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2319 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2320 | 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] | 2321 | "$P_CLI force_version=tls12" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2322 | 0 \ |
| 2323 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2324 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2325 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2326 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2327 | -S "error" \ |
| 2328 | -C "error" |
| 2329 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2330 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2331 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2332 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2333 | run_test "Opaque key for server authentication: ECDH-" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2334 | "$P_SRV auth_mode=required key_opaque=1\ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2335 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt\ |
| 2336 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdh,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2337 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2338 | 0 \ |
| 2339 | -c "Verifying peer X.509 certificate... ok" \ |
| 2340 | -c "Ciphersuite is TLS-ECDH-" \ |
| 2341 | -s "key types: Opaque, none" \ |
| 2342 | -s "Ciphersuite is TLS-ECDH-" \ |
| 2343 | -S "error" \ |
| 2344 | -C "error" |
| 2345 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2346 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2347 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2348 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2349 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2350 | run_test "Opaque key for server authentication: invalid key: decrypt with ECC key, no async" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2351 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2352 | 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] | 2353 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2354 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2355 | 1 \ |
| 2356 | -s "key types: Opaque, none" \ |
| 2357 | -s "error" \ |
| 2358 | -c "error" \ |
| 2359 | -c "Public key type mismatch" |
| 2360 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2361 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2362 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2363 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2364 | requires_config_enabled MBEDTLS_RSA_C |
| 2365 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2366 | requires_hash_alg SHA_256 |
| 2367 | run_test "Opaque key for server authentication: invalid key: ecdh with RSA key, no async" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2368 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2369 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=ecdh,none \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2370 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2371 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2372 | 1 \ |
| 2373 | -s "key types: Opaque, none" \ |
| 2374 | -s "error" \ |
| 2375 | -c "error" \ |
| 2376 | -c "Public key type mismatch" |
| 2377 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2378 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2379 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2380 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2381 | requires_hash_alg SHA_256 |
| 2382 | run_test "Opaque key for server authentication: invalid alg: decrypt with ECC key, async" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2383 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2384 | 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] | 2385 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2386 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2387 | 1 \ |
| 2388 | -s "key types: Opaque, none" \ |
| 2389 | -s "got ciphersuites in common, but none of them usable" \ |
| 2390 | -s "error" \ |
| 2391 | -c "error" |
| 2392 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2393 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2394 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2395 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2396 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2397 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2398 | run_test "Opaque key for server authentication: invalid alg: ecdh with RSA key, async" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2399 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2400 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2401 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2402 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2403 | 1 \ |
| 2404 | -s "key types: Opaque, none" \ |
| 2405 | -s "got ciphersuites in common, but none of them usable" \ |
| 2406 | -s "error" \ |
| 2407 | -c "error" |
| 2408 | |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2409 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2410 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2411 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2412 | run_test "Opaque key for server authentication: invalid alg: ECDHE-ECDSA with ecdh" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2413 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2414 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2415 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2416 | "$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] | 2417 | 1 \ |
| 2418 | -s "key types: Opaque, none" \ |
| 2419 | -s "got ciphersuites in common, but none of them usable" \ |
| 2420 | -s "error" \ |
| 2421 | -c "error" |
| 2422 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2423 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2424 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2425 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2426 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2427 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2428 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2429 | "$P_SRV force_version=tls12 key_opaque=1 crt_file=$DATA_FILES_PATH/server7.crt \ |
| 2430 | key_file=$DATA_FILES_PATH/server7.key key_opaque_algs=ecdh,none \ |
| 2431 | 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] | 2432 | key_opaque_algs2=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2433 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2434 | 0 \ |
| 2435 | -c "Verifying peer X.509 certificate... ok" \ |
| 2436 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2437 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2438 | -s "key types: Opaque, Opaque" \ |
| 2439 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2440 | -S "error" \ |
| 2441 | -C "error" |
| 2442 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2443 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2444 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2445 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2446 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2447 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDH-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2448 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server7.crt \ |
| 2449 | key_file=$DATA_FILES_PATH/server7.key key_opaque_algs=ecdsa-sign,none \ |
| 2450 | 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] | 2451 | key_opaque_algs2=ecdh,none debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2452 | "$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] | 2453 | 0 \ |
| 2454 | -c "Verifying peer X.509 certificate... ok" \ |
| 2455 | -c "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2456 | -c "CN=Polarssl Test EC CA" \ |
| 2457 | -s "key types: Opaque, Opaque" \ |
| 2458 | -s "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2459 | -S "error" \ |
| 2460 | -C "error" |
| 2461 | |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2462 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2463 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2464 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2465 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2466 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2467 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2468 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2469 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2470 | 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] | 2471 | "$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] | 2472 | 0 \ |
| 2473 | -c "Verifying peer X.509 certificate... ok" \ |
| 2474 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2475 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2476 | -s "key types: Opaque, Opaque" \ |
| 2477 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2478 | -S "error" \ |
| 2479 | -C "error" |
| 2480 | |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2481 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2482 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2483 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2484 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2485 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2486 | run_test "TLS 1.3 opaque key: no suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2487 | "$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] | 2488 | "$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] | 2489 | 1 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2490 | -c "key type: Opaque" \ |
| 2491 | -s "key types: Opaque, Opaque" \ |
| 2492 | -c "error" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 2493 | -s "no suitable signature algorithm" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2494 | |
| 2495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2496 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2497 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2498 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2499 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2500 | run_test "TLS 1.3 opaque key: suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2501 | "$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] | 2502 | "$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] | 2503 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2504 | -c "key type: Opaque" \ |
| 2505 | -s "key types: Opaque, Opaque" \ |
| 2506 | -C "error" \ |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2507 | -S "error" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2508 | |
| 2509 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2510 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2511 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2512 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2513 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2514 | 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] | 2515 | "$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] | 2516 | "$P_CLI debug_level=4 sig_algs=rsa_pss_rsae_sha256,rsa_pss_rsae_sha512" \ |
| 2517 | 0 \ |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2518 | -s "key types: Opaque, Opaque" \ |
| 2519 | -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \ |
| 2520 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 2521 | -C "error" \ |
| 2522 | -S "error" \ |
| 2523 | |
| 2524 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2525 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2526 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2527 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2528 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2529 | 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] | 2530 | "$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] | 2531 | "$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] | 2532 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2533 | -c "key type: Opaque" \ |
| 2534 | -s "key types: Opaque, Opaque" \ |
| 2535 | -C "error" \ |
| 2536 | -S "error" \ |
| 2537 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2538 | # Test using a RSA opaque private key for server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2539 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2540 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2541 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2542 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2543 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2544 | run_test "Opaque key for server authentication: ECDHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2545 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2546 | 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] | 2547 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2548 | 0 \ |
| 2549 | -c "Verifying peer X.509 certificate... ok" \ |
| 2550 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2551 | -s "key types: Opaque, none" \ |
| 2552 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2553 | -S "error" \ |
| 2554 | -C "error" |
| 2555 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2556 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2557 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2558 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2559 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2560 | run_test "Opaque key for server authentication: DHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2561 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2562 | 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] | 2563 | "$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] | 2564 | 0 \ |
| 2565 | -c "Verifying peer X.509 certificate... ok" \ |
| 2566 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2567 | -s "key types: Opaque, none" \ |
| 2568 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2569 | -S "error" \ |
| 2570 | -C "error" |
| 2571 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2572 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2573 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2574 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2575 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2576 | run_test "Opaque key for server authentication: RSA-PSK" \ |
| 2577 | "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 2578 | psk=73776f726466697368 psk_identity=foo" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2579 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 2580 | psk=73776f726466697368 psk_identity=foo" \ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2581 | 0 \ |
| 2582 | -c "Verifying peer X.509 certificate... ok" \ |
| 2583 | -c "Ciphersuite is TLS-RSA-PSK-" \ |
| 2584 | -s "key types: Opaque, Opaque" \ |
| 2585 | -s "Ciphersuite is TLS-RSA-PSK-" \ |
| 2586 | -S "error" \ |
| 2587 | -C "error" |
| 2588 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2589 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2590 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2591 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2592 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2593 | run_test "Opaque key for server authentication: RSA-" \ |
| 2594 | "$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] | 2595 | "$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] | 2596 | 0 \ |
| 2597 | -c "Verifying peer X.509 certificate... ok" \ |
| 2598 | -c "Ciphersuite is TLS-RSA-" \ |
| 2599 | -s "key types: Opaque, Opaque" \ |
| 2600 | -s "Ciphersuite is TLS-RSA-" \ |
| 2601 | -S "error" \ |
| 2602 | -C "error" |
| 2603 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2604 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2605 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2606 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2607 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2608 | run_test "Opaque key for server authentication: DHE-RSA, PSS instead of PKCS1" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2609 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2610 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ |
| 2611 | "$P_CLI crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2612 | 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] | 2613 | 1 \ |
| 2614 | -s "key types: Opaque, none" \ |
| 2615 | -s "got ciphersuites in common, but none of them usable" \ |
| 2616 | -s "error" \ |
| 2617 | -c "error" |
| 2618 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2619 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2620 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2621 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2622 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2623 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2624 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2625 | run_test "Opaque keys for server authentication: RSA keys with different algs" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2626 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2627 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pss,none \ |
| 2628 | crt_file2=$DATA_FILES_PATH/server4.crt \ |
| 2629 | 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] | 2630 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2631 | 0 \ |
| 2632 | -c "Verifying peer X.509 certificate... ok" \ |
| 2633 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2634 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2635 | -s "key types: Opaque, Opaque" \ |
| 2636 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2637 | -S "error" \ |
| 2638 | -C "error" |
| 2639 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2640 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2641 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2642 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2643 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2644 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2645 | run_test "Opaque keys for server authentication: EC + RSA, force DHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2646 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2647 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2648 | crt_file2=$DATA_FILES_PATH/server4.crt \ |
| 2649 | 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] | 2650 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2651 | 0 \ |
| 2652 | -c "Verifying peer X.509 certificate... ok" \ |
| 2653 | -c "Ciphersuite is TLS-DHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2654 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2655 | -s "key types: Opaque, Opaque" \ |
| 2656 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2657 | -S "error" \ |
| 2658 | -C "error" |
| 2659 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2660 | # Test using an EC opaque private key for client/server authentication |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2661 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2662 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2663 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2664 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2665 | run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2666 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2667 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none" \ |
| 2668 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2669 | 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] | 2670 | 0 \ |
| 2671 | -c "key type: Opaque" \ |
| 2672 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2673 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2674 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2675 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2676 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2677 | -S "error" \ |
| 2678 | -C "error" |
| 2679 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2680 | # Test using a RSA opaque private key for client/server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2681 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2682 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2683 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2684 | requires_hash_alg SHA_256 |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2685 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2686 | run_test "Opaque key for client/server authentication: ECDHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2687 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2688 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
| 2689 | "$P_CLI force_version=tls12 key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2690 | 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] | 2691 | 0 \ |
| 2692 | -c "key type: Opaque" \ |
| 2693 | -c "Verifying peer X.509 certificate... ok" \ |
| 2694 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2695 | -s "key types: Opaque, none" \ |
| 2696 | -s "Verifying peer X.509 certificate... ok" \ |
| 2697 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2698 | -S "error" \ |
| 2699 | -C "error" |
| 2700 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2701 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2702 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2703 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2704 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2705 | run_test "Opaque key for client/server authentication: DHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2706 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2707 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
| 2708 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2709 | 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] | 2710 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2711 | 0 \ |
| 2712 | -c "key type: Opaque" \ |
| 2713 | -c "Verifying peer X.509 certificate... ok" \ |
| 2714 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2715 | -s "key types: Opaque, none" \ |
| 2716 | -s "Verifying peer X.509 certificate... ok" \ |
| 2717 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2718 | -S "error" \ |
| 2719 | -C "error" |
| 2720 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2721 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2722 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 2723 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 2724 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 2725 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 2726 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 2727 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 2728 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 2729 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 2730 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 2731 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 2732 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 2733 | |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2734 | requires_config_enabled PSA_WANT_ECC_SECP_R1_521 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2735 | run_test_psa_force_curve "secp521r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2736 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_512 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2737 | run_test_psa_force_curve "brainpoolP512r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2738 | requires_config_enabled PSA_WANT_ECC_SECP_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2739 | run_test_psa_force_curve "secp384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2740 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2741 | run_test_psa_force_curve "brainpoolP384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2742 | requires_config_enabled PSA_WANT_ECC_SECP_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2743 | run_test_psa_force_curve "secp256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2744 | requires_config_enabled PSA_WANT_ECC_SECP_K1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2745 | run_test_psa_force_curve "secp256k1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2746 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2747 | run_test_psa_force_curve "brainpoolP256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2748 | requires_config_enabled PSA_WANT_ECC_SECP_R1_224 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2749 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2750 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 2751 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2752 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 2753 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 2754 | ## 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] | 2755 | #requires_config_enabled PSA_WANT_ECC_SECP_K1_224 |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2756 | #run_test_psa_force_curve "secp224k1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2757 | requires_config_enabled PSA_WANT_ECC_SECP_R1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2758 | run_test_psa_force_curve "secp192r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2759 | requires_config_enabled PSA_WANT_ECC_SECP_K1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2760 | run_test_psa_force_curve "secp192k1" |
| 2761 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2762 | # Test current time in ServerHello |
| 2763 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 2764 | run_test "ServerHello contains gmt_unix_time" \ |
| 2765 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2766 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2767 | 0 \ |
| 2768 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2769 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2770 | |
| 2771 | # Test for uniqueness of IVs in AEAD ciphersuites |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2772 | run_test "Unique IV in GCM" \ |
| 2773 | "$P_SRV exchanges=20 debug_level=4" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 2774 | "$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] | 2775 | 0 \ |
| 2776 | -u "IV used" \ |
| 2777 | -U "IV used" |
| 2778 | |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2779 | # Test for correctness of sent single supported algorithm |
Gilles Peskine | cd4fe70 | 2024-09-07 19:50:17 +0200 | [diff] [blame] | 2780 | requires_any_configs_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2781 | PSA_WANT_ECC_SECP_R1_256 |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2782 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2783 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Paul Elliott | 3b4ceda | 2022-11-17 12:47:10 +0000 | [diff] [blame] | 2784 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2785 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 2786 | requires_pk_alg "ECDSA" |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2787 | requires_hash_alg SHA_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2788 | run_test "Single supported algorithm sending: mbedtls client" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2789 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2790 | "$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] | 2791 | 0 \ |
| 2792 | -c "Supported Signature Algorithm found: 04 03" |
| 2793 | |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2795 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | cd4fe70 | 2024-09-07 19:50:17 +0200 | [diff] [blame] | 2796 | requires_any_configs_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2797 | PSA_WANT_ECC_SECP_R1_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2798 | requires_hash_alg SHA_256 |
| 2799 | run_test "Single supported algorithm sending: openssl client" \ |
| 2800 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2801 | "$O_CLI -cert $DATA_FILES_PATH/server6.crt \ |
| 2802 | -key $DATA_FILES_PATH/server6.key" \ |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2803 | 0 |
| 2804 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2805 | # Tests for certificate verification callback |
| 2806 | run_test "Configuration-specific CRT verification callback" \ |
| 2807 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 843a00d | 2024-08-16 09:53:41 +0200 | [diff] [blame] | 2808 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2809 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2810 | -S "error" \ |
| 2811 | -c "Verify requested for " \ |
| 2812 | -c "Use configuration-specific verification callback" \ |
| 2813 | -C "Use context-specific verification callback" \ |
| 2814 | -C "error" |
| 2815 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2816 | run_test "Context-specific CRT verification callback" \ |
| 2817 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 843a00d | 2024-08-16 09:53:41 +0200 | [diff] [blame] | 2818 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2819 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2820 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2821 | -c "Verify requested for " \ |
| 2822 | -c "Use context-specific verification callback" \ |
| 2823 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2824 | -C "error" |
| 2825 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2826 | # Tests for SHA-1 support |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2827 | requires_hash_alg SHA_1 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2828 | run_test "SHA-1 forbidden by default in server certificate" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2829 | "$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] | 2830 | "$P_CLI debug_level=2 force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2831 | 1 \ |
| 2832 | -c "The certificate is signed with an unacceptable hash" |
| 2833 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2834 | requires_hash_alg SHA_1 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2835 | run_test "SHA-1 explicitly allowed in server certificate" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2836 | "$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] | 2837 | "$P_CLI force_version=tls12 allow_sha1=1" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2838 | 0 |
| 2839 | |
| 2840 | run_test "SHA-256 allowed by default in server certificate" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2841 | "$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] | 2842 | "$P_CLI force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2843 | 0 |
| 2844 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2845 | requires_hash_alg SHA_1 |
| 2846 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2847 | run_test "SHA-1 forbidden by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2848 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2849 | "$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] | 2850 | 1 \ |
| 2851 | -s "The certificate is signed with an unacceptable hash" |
| 2852 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2853 | requires_hash_alg SHA_1 |
| 2854 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2855 | run_test "SHA-1 explicitly allowed in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2856 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=1" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2857 | "$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] | 2858 | 0 |
| 2859 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2860 | requires_config_enabled MBEDTLS_RSA_C |
| 2861 | requires_hash_alg SHA_256 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2862 | run_test "SHA-256 allowed by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2863 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2864 | "$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] | 2865 | 0 |
| 2866 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2867 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2868 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2869 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2870 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2871 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2872 | 0 \ |
| 2873 | -c "next record in same datagram" \ |
| 2874 | -s "next record in same datagram" |
| 2875 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2876 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2877 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2878 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2879 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2880 | 0 \ |
| 2881 | -s "next record in same datagram" \ |
| 2882 | -C "next record in same datagram" |
| 2883 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2884 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2885 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2886 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2887 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2888 | 0 \ |
| 2889 | -S "next record in same datagram" \ |
| 2890 | -c "next record in same datagram" |
| 2891 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2892 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2893 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2894 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2895 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2896 | 0 \ |
| 2897 | -S "next record in same datagram" \ |
| 2898 | -C "next record in same datagram" |
| 2899 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2900 | # Tests for Context serialization |
| 2901 | |
| 2902 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2903 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2904 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2905 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2906 | 0 \ |
| 2907 | -c "Deserializing connection..." \ |
| 2908 | -S "Deserializing connection..." |
| 2909 | |
| 2910 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2911 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2912 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2913 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2914 | 0 \ |
| 2915 | -c "Deserializing connection..." \ |
| 2916 | -S "Deserializing connection..." |
| 2917 | |
| 2918 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2919 | run_test "Context serialization, client serializes, GCM" \ |
| 2920 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2921 | "$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] | 2922 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2923 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2924 | -S "Deserializing connection..." |
| 2925 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2926 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2927 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2928 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2929 | run_test "Context serialization, client serializes, with CID" \ |
| 2930 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2931 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2932 | 0 \ |
| 2933 | -c "Deserializing connection..." \ |
| 2934 | -S "Deserializing connection..." |
| 2935 | |
| 2936 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2937 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2938 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2939 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2940 | 0 \ |
| 2941 | -C "Deserializing connection..." \ |
| 2942 | -s "Deserializing connection..." |
| 2943 | |
| 2944 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2945 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2946 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2947 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2948 | 0 \ |
| 2949 | -C "Deserializing connection..." \ |
| 2950 | -s "Deserializing connection..." |
| 2951 | |
| 2952 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2953 | run_test "Context serialization, server serializes, GCM" \ |
| 2954 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2955 | "$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] | 2956 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2957 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2958 | -s "Deserializing connection..." |
| 2959 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2960 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2961 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2962 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2963 | run_test "Context serialization, server serializes, with CID" \ |
| 2964 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2965 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2966 | 0 \ |
| 2967 | -C "Deserializing connection..." \ |
| 2968 | -s "Deserializing connection..." |
| 2969 | |
| 2970 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2971 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2972 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2973 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2974 | 0 \ |
| 2975 | -c "Deserializing connection..." \ |
| 2976 | -s "Deserializing connection..." |
| 2977 | |
| 2978 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2979 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2980 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2981 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2982 | 0 \ |
| 2983 | -c "Deserializing connection..." \ |
| 2984 | -s "Deserializing connection..." |
| 2985 | |
| 2986 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2987 | run_test "Context serialization, both serialize, GCM" \ |
| 2988 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2989 | "$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] | 2990 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2991 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2992 | -s "Deserializing connection..." |
| 2993 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2994 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2995 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2996 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2997 | run_test "Context serialization, both serialize, with CID" \ |
| 2998 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2999 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 3000 | 0 \ |
| 3001 | -c "Deserializing connection..." \ |
| 3002 | -s "Deserializing connection..." |
| 3003 | |
| 3004 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3005 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 3006 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3007 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3008 | 0 \ |
| 3009 | -c "Deserializing connection..." \ |
| 3010 | -S "Deserializing connection..." |
| 3011 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3012 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3013 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3014 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 3015 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 3016 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 3017 | 0 \ |
| 3018 | -c "Deserializing connection..." \ |
| 3019 | -S "Deserializing connection..." |
| 3020 | |
| 3021 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3022 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 3023 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 3024 | "$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] | 3025 | 0 \ |
| 3026 | -c "Deserializing connection..." \ |
| 3027 | -S "Deserializing connection..." |
| 3028 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3029 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 3030 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 3031 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3032 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 3033 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 3034 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 3035 | 0 \ |
| 3036 | -c "Deserializing connection..." \ |
| 3037 | -S "Deserializing connection..." |
| 3038 | |
| 3039 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3040 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 3041 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3042 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3043 | 0 \ |
| 3044 | -C "Deserializing connection..." \ |
| 3045 | -s "Deserializing connection..." |
| 3046 | |
| 3047 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3048 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 3049 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3050 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 3051 | 0 \ |
| 3052 | -C "Deserializing connection..." \ |
| 3053 | -s "Deserializing connection..." |
| 3054 | |
| 3055 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3056 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 3057 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3058 | "$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] | 3059 | 0 \ |
| 3060 | -C "Deserializing connection..." \ |
| 3061 | -s "Deserializing connection..." |
| 3062 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3063 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 3064 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 3065 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3066 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 3067 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 3068 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 3069 | 0 \ |
| 3070 | -C "Deserializing connection..." \ |
| 3071 | -s "Deserializing connection..." |
| 3072 | |
| 3073 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3074 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 3075 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3076 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3077 | 0 \ |
| 3078 | -c "Deserializing connection..." \ |
| 3079 | -s "Deserializing connection..." |
| 3080 | |
| 3081 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3082 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 3083 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3084 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 3085 | 0 \ |
| 3086 | -c "Deserializing connection..." \ |
| 3087 | -s "Deserializing connection..." |
| 3088 | |
| 3089 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3090 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 3091 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3092 | "$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] | 3093 | 0 \ |
| 3094 | -c "Deserializing connection..." \ |
| 3095 | -s "Deserializing connection..." |
| 3096 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3097 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 3098 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3099 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3100 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 3101 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 3102 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 3103 | 0 \ |
| 3104 | -c "Deserializing connection..." \ |
| 3105 | -s "Deserializing connection..." |
| 3106 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3107 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 3108 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3109 | run_test "Saving the serialized context to a file" \ |
| 3110 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 3111 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 3112 | 0 \ |
| 3113 | -s "Save serialized context to a file... ok" \ |
| 3114 | -c "Save serialized context to a file... ok" |
| 3115 | rm -f context_srv.txt |
| 3116 | rm -f context_cli.txt |
| 3117 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3118 | # Tests for DTLS Connection ID extension |
| 3119 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3120 | # So far, the CID API isn't implemented, so we can't |
| 3121 | # grep for output witnessing its use. This needs to be |
| 3122 | # changed once the CID extension is implemented. |
| 3123 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3124 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3125 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3126 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3127 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 3128 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3129 | 0 \ |
| 3130 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3131 | -s "found CID extension" \ |
| 3132 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3133 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3134 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3135 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3136 | -C "found CID extension" \ |
| 3137 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3138 | -C "Copy CIDs into SSL transform" \ |
| 3139 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3140 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3141 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3142 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3143 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3144 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3145 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 3146 | 0 \ |
| 3147 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3148 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3149 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3150 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3151 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3152 | -C "found CID extension" \ |
| 3153 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3154 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 3155 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +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: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3160 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3161 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 3162 | 0 \ |
| 3163 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3164 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3165 | -c "client hello, adding CID extension" \ |
| 3166 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3167 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3168 | -s "server hello, adding CID extension" \ |
| 3169 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3170 | -c "Use of CID extension negotiated" \ |
| 3171 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3172 | -c "Copy CIDs into SSL transform" \ |
| 3173 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3174 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3175 | -s "Use of Connection ID has been negotiated" \ |
| 3176 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3177 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3178 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3179 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3180 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3181 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3182 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 3183 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 3184 | 0 \ |
| 3185 | -c "Enable use of CID extension." \ |
| 3186 | -s "Enable use of CID extension." \ |
| 3187 | -c "client hello, adding CID extension" \ |
| 3188 | -s "found CID extension" \ |
| 3189 | -s "Use of CID extension negotiated" \ |
| 3190 | -s "server hello, adding CID extension" \ |
| 3191 | -c "found CID extension" \ |
| 3192 | -c "Use of CID extension negotiated" \ |
| 3193 | -s "Copy CIDs into SSL transform" \ |
| 3194 | -c "Copy CIDs into SSL transform" \ |
| 3195 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3196 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3197 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3198 | -c "Use of Connection ID has been negotiated" \ |
| 3199 | -c "ignoring unexpected CID" \ |
| 3200 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3201 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3202 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3203 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3204 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 3205 | -p "$P_PXY mtu=800" \ |
| 3206 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3207 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3208 | 0 \ |
| 3209 | -c "Enable use of CID extension." \ |
| 3210 | -s "Enable use of CID extension." \ |
| 3211 | -c "client hello, adding CID extension" \ |
| 3212 | -s "found CID extension" \ |
| 3213 | -s "Use of CID extension negotiated" \ |
| 3214 | -s "server hello, adding CID extension" \ |
| 3215 | -c "found CID extension" \ |
| 3216 | -c "Use of CID extension negotiated" \ |
| 3217 | -s "Copy CIDs into SSL transform" \ |
| 3218 | -c "Copy CIDs into SSL transform" \ |
| 3219 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3220 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3221 | -s "Use of Connection ID has been negotiated" \ |
| 3222 | -c "Use of Connection ID has been negotiated" |
| 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, 3D+MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3227 | -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] | 3228 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3229 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3230 | 0 \ |
| 3231 | -c "Enable use of CID extension." \ |
| 3232 | -s "Enable use of CID extension." \ |
| 3233 | -c "client hello, adding CID extension" \ |
| 3234 | -s "found CID extension" \ |
| 3235 | -s "Use of CID extension negotiated" \ |
| 3236 | -s "server hello, adding CID extension" \ |
| 3237 | -c "found CID extension" \ |
| 3238 | -c "Use of CID extension negotiated" \ |
| 3239 | -s "Copy CIDs into SSL transform" \ |
| 3240 | -c "Copy CIDs into SSL transform" \ |
| 3241 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3242 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3243 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3244 | -c "Use of Connection ID has been negotiated" \ |
| 3245 | -c "ignoring unexpected CID" \ |
| 3246 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3247 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3248 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3249 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3250 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3251 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3252 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3253 | 0 \ |
| 3254 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3255 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3256 | -c "client hello, adding CID extension" \ |
| 3257 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3258 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3259 | -s "server hello, adding CID extension" \ |
| 3260 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3261 | -c "Use of CID extension negotiated" \ |
| 3262 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3263 | -c "Copy CIDs into SSL transform" \ |
| 3264 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3265 | -s "Peer CID (length 0 Bytes):" \ |
| 3266 | -s "Use of Connection ID has been negotiated" \ |
| 3267 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3268 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3269 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3270 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3271 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3272 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3273 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3274 | 0 \ |
| 3275 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3276 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3277 | -c "client hello, adding CID extension" \ |
| 3278 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3279 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3280 | -s "server hello, adding CID extension" \ |
| 3281 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3282 | -c "Use of CID extension negotiated" \ |
| 3283 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3284 | -c "Copy CIDs into SSL transform" \ |
| 3285 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3286 | -c "Peer CID (length 0 Bytes):" \ |
| 3287 | -s "Use of Connection ID has been negotiated" \ |
| 3288 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3289 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3291 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3292 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3293 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3294 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3295 | 0 \ |
| 3296 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3297 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3298 | -c "client hello, adding CID extension" \ |
| 3299 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3300 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3301 | -s "server hello, adding CID extension" \ |
| 3302 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3303 | -c "Use of CID extension negotiated" \ |
| 3304 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3305 | -c "Copy CIDs into SSL transform" \ |
| 3306 | -S "Use of Connection ID has been negotiated" \ |
| 3307 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3308 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3309 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3310 | 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] | 3311 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3312 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3313 | 0 \ |
| 3314 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3315 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3316 | -c "client hello, adding CID extension" \ |
| 3317 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3318 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3319 | -s "server hello, adding CID extension" \ |
| 3320 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3321 | -c "Use of CID extension negotiated" \ |
| 3322 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3323 | -c "Copy CIDs into SSL transform" \ |
| 3324 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3325 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3326 | -s "Use of Connection ID has been negotiated" \ |
| 3327 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3328 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3329 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3330 | 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] | 3331 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3332 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3333 | 0 \ |
| 3334 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3335 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3336 | -c "client hello, adding CID extension" \ |
| 3337 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3338 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3339 | -s "server hello, adding CID extension" \ |
| 3340 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3341 | -c "Use of CID extension negotiated" \ |
| 3342 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3343 | -c "Copy CIDs into SSL transform" \ |
| 3344 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3345 | -s "Peer CID (length 0 Bytes):" \ |
| 3346 | -s "Use of Connection ID has been negotiated" \ |
| 3347 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3348 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3349 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3350 | 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] | 3351 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3352 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3353 | 0 \ |
| 3354 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3355 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3356 | -c "client hello, adding CID extension" \ |
| 3357 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3358 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3359 | -s "server hello, adding CID extension" \ |
| 3360 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3361 | -c "Use of CID extension negotiated" \ |
| 3362 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3363 | -c "Copy CIDs into SSL transform" \ |
| 3364 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3365 | -c "Peer CID (length 0 Bytes):" \ |
| 3366 | -s "Use of Connection ID has been negotiated" \ |
| 3367 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3368 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3369 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3370 | 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] | 3371 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3372 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3373 | 0 \ |
| 3374 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3375 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3376 | -c "client hello, adding CID extension" \ |
| 3377 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3378 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3379 | -s "server hello, adding CID extension" \ |
| 3380 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3381 | -c "Use of CID extension negotiated" \ |
| 3382 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3383 | -c "Copy CIDs into SSL transform" \ |
| 3384 | -S "Use of Connection ID has been negotiated" \ |
| 3385 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3386 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3387 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3388 | 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] | 3389 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3390 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3391 | 0 \ |
| 3392 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3393 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3394 | -c "client hello, adding CID extension" \ |
| 3395 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3396 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3397 | -s "server hello, adding CID extension" \ |
| 3398 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3399 | -c "Use of CID extension negotiated" \ |
| 3400 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3401 | -c "Copy CIDs into SSL transform" \ |
| 3402 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3403 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3404 | -s "Use of Connection ID has been negotiated" \ |
| 3405 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3406 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3407 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3408 | 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] | 3409 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3410 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3411 | 0 \ |
| 3412 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3413 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3414 | -c "client hello, adding CID extension" \ |
| 3415 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3416 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3417 | -s "server hello, adding CID extension" \ |
| 3418 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3419 | -c "Use of CID extension negotiated" \ |
| 3420 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3421 | -c "Copy CIDs into SSL transform" \ |
| 3422 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3423 | -s "Peer CID (length 0 Bytes):" \ |
| 3424 | -s "Use of Connection ID has been negotiated" \ |
| 3425 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3426 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3427 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3428 | 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] | 3429 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3430 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3431 | 0 \ |
| 3432 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3433 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3434 | -c "client hello, adding CID extension" \ |
| 3435 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3436 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3437 | -s "server hello, adding CID extension" \ |
| 3438 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3439 | -c "Use of CID extension negotiated" \ |
| 3440 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3441 | -c "Copy CIDs into SSL transform" \ |
| 3442 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3443 | -c "Peer CID (length 0 Bytes):" \ |
| 3444 | -s "Use of Connection ID has been negotiated" \ |
| 3445 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3446 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3447 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3448 | 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] | 3449 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3450 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3451 | 0 \ |
| 3452 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3453 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3454 | -c "client hello, adding CID extension" \ |
| 3455 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3456 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3457 | -s "server hello, adding CID extension" \ |
| 3458 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3459 | -c "Use of CID extension negotiated" \ |
| 3460 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3461 | -c "Copy CIDs into SSL transform" \ |
| 3462 | -S "Use of Connection ID has been negotiated" \ |
| 3463 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3464 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3465 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3466 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3467 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3468 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3469 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3470 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3471 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3472 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3473 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3474 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3475 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3476 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3477 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3478 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3479 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3480 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3481 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3482 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3483 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3484 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3485 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3486 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3487 | 0 \ |
| 3488 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3489 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3490 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3491 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3492 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3493 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3494 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3495 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3496 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3497 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3498 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3499 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3500 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 3501 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3502 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3503 | 0 \ |
| 3504 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3505 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3506 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3507 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3508 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3509 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3510 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3511 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3512 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3513 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3514 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3515 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3516 | 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] | 3517 | -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] | 3518 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3519 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3520 | 0 \ |
| 3521 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3522 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3523 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3524 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3525 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3526 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3527 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3528 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3529 | -c "ignoring unexpected CID" \ |
| 3530 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3531 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3532 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3533 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3534 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3535 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3536 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3537 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3538 | 0 \ |
| 3539 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3540 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3541 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3542 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3543 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3544 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3545 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3546 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3547 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3548 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3549 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3550 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3551 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 3552 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3553 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3554 | 0 \ |
| 3555 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3556 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3557 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3558 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3559 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3560 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3561 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3562 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3563 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3565 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3566 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3567 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3568 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3569 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3570 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3571 | 0 \ |
| 3572 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3573 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3574 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3575 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3576 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3577 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3578 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
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, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3587 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3588 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3589 | 0 \ |
| 3590 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3591 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3592 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3593 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3594 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3595 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3596 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3597 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3598 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3599 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3600 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 3601 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3602 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3603 | 0 \ |
| 3604 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3605 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3606 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3607 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3608 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3609 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3610 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3611 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3612 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3613 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3614 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3615 | -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] | 3616 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3617 | "$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" \ |
| 3618 | 0 \ |
| 3619 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3620 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3621 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3622 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3623 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3624 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3625 | -c "ignoring unexpected CID" \ |
| 3626 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3627 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3629 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3630 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3631 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3632 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3633 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3634 | 0 \ |
| 3635 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3636 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3637 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3638 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3639 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3640 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3641 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3642 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3643 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 3644 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3645 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3646 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3647 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3648 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3649 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3650 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3651 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3652 | 0 \ |
| 3653 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3654 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3655 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3656 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3657 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3658 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3659 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3660 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3661 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 3662 | -c "ignoring unexpected CID" \ |
| 3663 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3664 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3665 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3666 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3667 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3668 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 3669 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3670 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3671 | 0 \ |
| 3672 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3673 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3674 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3675 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3676 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3677 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3678 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3679 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3680 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 3681 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3682 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3683 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3684 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3685 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3686 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3687 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3688 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3689 | 0 \ |
| 3690 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3691 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3692 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3693 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3694 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3695 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3696 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3697 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3698 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 3699 | -c "ignoring unexpected CID" \ |
| 3700 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3701 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3702 | # 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] | 3703 | # tests check that the buffer contents are reallocated when the message is |
| 3704 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3705 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3706 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3707 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3708 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 3709 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3710 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 3711 | 0 \ |
| 3712 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3713 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3714 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3715 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3716 | -s "Reallocating in_buf" \ |
| 3717 | -s "Reallocating out_buf" |
| 3718 | |
| 3719 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3720 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3721 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3722 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 3723 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3724 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 3725 | 0 \ |
| 3726 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3727 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3728 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3729 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3730 | -s "Reallocating in_buf" \ |
| 3731 | -s "Reallocating out_buf" |
| 3732 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3733 | # Tests for Encrypt-then-MAC extension |
| 3734 | |
| 3735 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3736 | "$P_SRV debug_level=3 \ |
| 3737 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3738 | "$P_CLI debug_level=3" \ |
| 3739 | 0 \ |
| 3740 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3741 | -s "found encrypt then mac extension" \ |
| 3742 | -s "server hello, adding encrypt then mac extension" \ |
| 3743 | -c "found encrypt_then_mac extension" \ |
| 3744 | -c "using encrypt then mac" \ |
| 3745 | -s "using encrypt then mac" |
| 3746 | |
| 3747 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3748 | "$P_SRV debug_level=3 etm=0 \ |
| 3749 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3750 | "$P_CLI debug_level=3 etm=1" \ |
| 3751 | 0 \ |
| 3752 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3753 | -s "found encrypt then mac extension" \ |
| 3754 | -S "server hello, adding encrypt then mac extension" \ |
| 3755 | -C "found encrypt_then_mac extension" \ |
| 3756 | -C "using encrypt then mac" \ |
| 3757 | -S "using encrypt then mac" |
| 3758 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3759 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3760 | "$P_SRV debug_level=3 etm=1 \ |
| 3761 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3762 | "$P_CLI debug_level=3 etm=1" \ |
| 3763 | 0 \ |
| 3764 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3765 | -s "found encrypt then mac extension" \ |
| 3766 | -S "server hello, adding encrypt then mac extension" \ |
| 3767 | -C "found encrypt_then_mac extension" \ |
| 3768 | -C "using encrypt then mac" \ |
| 3769 | -S "using encrypt then mac" |
| 3770 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3771 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3772 | "$P_SRV debug_level=3 etm=1 \ |
| 3773 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3774 | "$P_CLI debug_level=3 etm=0" \ |
| 3775 | 0 \ |
| 3776 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3777 | -S "found encrypt then mac extension" \ |
| 3778 | -S "server hello, adding encrypt then mac extension" \ |
| 3779 | -C "found encrypt_then_mac extension" \ |
| 3780 | -C "using encrypt then mac" \ |
| 3781 | -S "using encrypt then mac" |
| 3782 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3783 | # Tests for Extended Master Secret extension |
| 3784 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3785 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3786 | run_test "Extended Master Secret: default" \ |
| 3787 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3788 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3789 | 0 \ |
| 3790 | -c "client hello, adding extended_master_secret extension" \ |
| 3791 | -s "found extended master secret extension" \ |
| 3792 | -s "server hello, adding extended master secret extension" \ |
| 3793 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3794 | -c "session hash for extended master secret" \ |
| 3795 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3796 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3797 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3798 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3799 | "$P_SRV debug_level=3 extended_ms=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3800 | "$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] | 3801 | 0 \ |
| 3802 | -c "client hello, adding extended_master_secret extension" \ |
| 3803 | -s "found extended master secret extension" \ |
| 3804 | -S "server hello, adding extended master secret extension" \ |
| 3805 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3806 | -C "session hash for extended master secret" \ |
| 3807 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3808 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3809 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3810 | run_test "Extended Master Secret: client disabled, server enabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3811 | "$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] | 3812 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3813 | 0 \ |
| 3814 | -C "client hello, adding extended_master_secret extension" \ |
| 3815 | -S "found extended master secret extension" \ |
| 3816 | -S "server hello, adding extended master secret extension" \ |
| 3817 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3818 | -C "session hash for extended master secret" \ |
| 3819 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3820 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3821 | # Test sending and receiving empty application data records |
| 3822 | |
| 3823 | run_test "Encrypt then MAC: empty application data record" \ |
| 3824 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3825 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3826 | 0 \ |
| 3827 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3828 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3829 | -c "0 bytes written in 1 fragments" |
| 3830 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3831 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3832 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3833 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3834 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3835 | 0 \ |
| 3836 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3837 | -c "0 bytes written in 1 fragments" |
| 3838 | |
| 3839 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3840 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3841 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3842 | 0 \ |
| 3843 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3844 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3845 | -c "0 bytes written in 1 fragments" |
| 3846 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3847 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3848 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3849 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3850 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3851 | 0 \ |
| 3852 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3853 | -c "0 bytes written in 1 fragments" |
| 3854 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3855 | # Tests for CBC 1/n-1 record splitting |
| 3856 | |
| 3857 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3858 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3859 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3860 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3861 | 0 \ |
| 3862 | -s "Read from client: 123 bytes read" \ |
| 3863 | -S "Read from client: 1 bytes read" \ |
| 3864 | -S "122 bytes read" |
| 3865 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3866 | # Tests for Session Tickets |
| 3867 | |
Norbert Fabritius | 4f1c927 | 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: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3870 | "$P_SRV debug_level=3 tickets=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" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3872 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 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" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 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 | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3883 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3884 | run_test "Session resume using tickets: manual rotation" \ |
| 3885 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
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" \ |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [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 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3898 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3899 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3900 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3901 | "$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] | 3902 | 0 \ |
| 3903 | -c "client hello, adding session ticket extension" \ |
| 3904 | -s "found session ticket extension" \ |
| 3905 | -s "server hello, adding session ticket extension" \ |
| 3906 | -c "found session_ticket extension" \ |
| 3907 | -c "parse new session ticket" \ |
| 3908 | -S "session successfully restored from cache" \ |
| 3909 | -s "session successfully restored from ticket" \ |
| 3910 | -s "a session has been resumed" \ |
| 3911 | -c "a session has been resumed" |
| 3912 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3913 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3914 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3915 | "$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] | 3916 | "$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] | 3917 | 0 \ |
| 3918 | -c "client hello, adding session ticket extension" \ |
| 3919 | -s "found session ticket extension" \ |
| 3920 | -s "server hello, adding session ticket extension" \ |
| 3921 | -c "found session_ticket extension" \ |
| 3922 | -c "parse new session ticket" \ |
| 3923 | -S "session successfully restored from cache" \ |
| 3924 | -S "session successfully restored from ticket" \ |
| 3925 | -S "a session has been resumed" \ |
| 3926 | -C "a session has been resumed" |
| 3927 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3928 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3929 | run_test "Session resume using tickets: session copy" \ |
| 3930 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3931 | "$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] | 3932 | 0 \ |
| 3933 | -c "client hello, adding session ticket extension" \ |
| 3934 | -s "found session ticket extension" \ |
| 3935 | -s "server hello, adding session ticket extension" \ |
| 3936 | -c "found session_ticket extension" \ |
| 3937 | -c "parse new session ticket" \ |
| 3938 | -S "session successfully restored from cache" \ |
| 3939 | -s "session successfully restored from ticket" \ |
| 3940 | -s "a session has been resumed" \ |
| 3941 | -c "a session has been resumed" |
| 3942 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3943 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3944 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3945 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3946 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3947 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3948 | 0 \ |
| 3949 | -c "client hello, adding session ticket extension" \ |
| 3950 | -c "found session_ticket extension" \ |
| 3951 | -c "parse new session ticket" \ |
| 3952 | -c "a session has been resumed" |
| 3953 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3954 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3955 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3956 | run_test "Session resume using tickets: openssl client" \ |
Gilles Peskine | 01fde2c | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 3957 | "$P_SRV force_version=tls12 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3958 | "( $O_CLI -sess_out $SESSION; \ |
| 3959 | $O_CLI -sess_in $SESSION; \ |
| 3960 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3961 | 0 \ |
| 3962 | -s "found session ticket extension" \ |
| 3963 | -s "server hello, adding session ticket extension" \ |
| 3964 | -S "session successfully restored from cache" \ |
| 3965 | -s "session successfully restored from ticket" \ |
| 3966 | -s "a session has been resumed" |
| 3967 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3968 | requires_cipher_enabled "AES" "GCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3969 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3970 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3971 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3972 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3973 | 0 \ |
| 3974 | -c "client hello, adding session ticket extension" \ |
| 3975 | -s "found session ticket extension" \ |
| 3976 | -s "server hello, adding session ticket extension" \ |
| 3977 | -c "found session_ticket extension" \ |
| 3978 | -c "parse new session ticket" \ |
| 3979 | -S "session successfully restored from cache" \ |
| 3980 | -s "session successfully restored from ticket" \ |
| 3981 | -s "a session has been resumed" \ |
| 3982 | -c "a session has been resumed" |
| 3983 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3984 | requires_cipher_enabled "AES" "GCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3985 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3986 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3987 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3988 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3989 | 0 \ |
| 3990 | -c "client hello, adding session ticket extension" \ |
| 3991 | -s "found session ticket extension" \ |
| 3992 | -s "server hello, adding session ticket extension" \ |
| 3993 | -c "found session_ticket extension" \ |
| 3994 | -c "parse new session ticket" \ |
| 3995 | -S "session successfully restored from cache" \ |
| 3996 | -s "session successfully restored from ticket" \ |
| 3997 | -s "a session has been resumed" \ |
| 3998 | -c "a session has been resumed" |
| 3999 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4000 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4001 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4002 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 4003 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4004 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4005 | 0 \ |
| 4006 | -c "client hello, adding session ticket extension" \ |
| 4007 | -s "found session ticket extension" \ |
| 4008 | -s "server hello, adding session ticket extension" \ |
| 4009 | -c "found session_ticket extension" \ |
| 4010 | -c "parse new session ticket" \ |
| 4011 | -S "session successfully restored from cache" \ |
| 4012 | -s "session successfully restored from ticket" \ |
| 4013 | -s "a session has been resumed" \ |
| 4014 | -c "a session has been resumed" |
| 4015 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4016 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4017 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4018 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 4019 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4020 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4021 | 0 \ |
| 4022 | -c "client hello, adding session ticket extension" \ |
| 4023 | -s "found session ticket extension" \ |
| 4024 | -s "server hello, adding session ticket extension" \ |
| 4025 | -c "found session_ticket extension" \ |
| 4026 | -c "parse new session ticket" \ |
| 4027 | -S "session successfully restored from cache" \ |
| 4028 | -s "session successfully restored from ticket" \ |
| 4029 | -s "a session has been resumed" \ |
| 4030 | -c "a session has been resumed" |
| 4031 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4032 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4033 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4034 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 4035 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4036 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4037 | 0 \ |
| 4038 | -c "client hello, adding session ticket extension" \ |
| 4039 | -s "found session ticket extension" \ |
| 4040 | -s "server hello, adding session ticket extension" \ |
| 4041 | -c "found session_ticket extension" \ |
| 4042 | -c "parse new session ticket" \ |
| 4043 | -S "session successfully restored from cache" \ |
| 4044 | -s "session successfully restored from ticket" \ |
| 4045 | -s "a session has been resumed" \ |
| 4046 | -c "a session has been resumed" |
| 4047 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4048 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4049 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4050 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 4051 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4052 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4053 | 0 \ |
| 4054 | -c "client hello, adding session ticket extension" \ |
| 4055 | -s "found session ticket extension" \ |
| 4056 | -s "server hello, adding session ticket extension" \ |
| 4057 | -c "found session_ticket extension" \ |
| 4058 | -c "parse new session ticket" \ |
| 4059 | -S "session successfully restored from cache" \ |
| 4060 | -s "session successfully restored from ticket" \ |
| 4061 | -s "a session has been resumed" \ |
| 4062 | -c "a session has been resumed" |
| 4063 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4064 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4065 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4066 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 4067 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4068 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4069 | 0 \ |
| 4070 | -c "client hello, adding session ticket extension" \ |
| 4071 | -s "found session ticket extension" \ |
| 4072 | -s "server hello, adding session ticket extension" \ |
| 4073 | -c "found session_ticket extension" \ |
| 4074 | -c "parse new session ticket" \ |
| 4075 | -S "session successfully restored from cache" \ |
| 4076 | -s "session successfully restored from ticket" \ |
| 4077 | -s "a session has been resumed" \ |
| 4078 | -c "a session has been resumed" |
| 4079 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4080 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4081 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4082 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 4083 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4084 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4085 | 0 \ |
| 4086 | -c "client hello, adding session ticket extension" \ |
| 4087 | -s "found session ticket extension" \ |
| 4088 | -s "server hello, adding session ticket extension" \ |
| 4089 | -c "found session_ticket extension" \ |
| 4090 | -c "parse new session ticket" \ |
| 4091 | -S "session successfully restored from cache" \ |
| 4092 | -s "session successfully restored from ticket" \ |
| 4093 | -s "a session has been resumed" \ |
| 4094 | -c "a session has been resumed" |
| 4095 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4096 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4097 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4098 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 4099 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4100 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4101 | 0 \ |
| 4102 | -c "client hello, adding session ticket extension" \ |
| 4103 | -s "found session ticket extension" \ |
| 4104 | -s "server hello, adding session ticket extension" \ |
| 4105 | -c "found session_ticket extension" \ |
| 4106 | -c "parse new session ticket" \ |
| 4107 | -S "session successfully restored from cache" \ |
| 4108 | -s "session successfully restored from ticket" \ |
| 4109 | -s "a session has been resumed" \ |
| 4110 | -c "a session has been resumed" |
| 4111 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4112 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4113 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4114 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 4115 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4116 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4117 | 0 \ |
| 4118 | -c "client hello, adding session ticket extension" \ |
| 4119 | -s "found session ticket extension" \ |
| 4120 | -s "server hello, adding session ticket extension" \ |
| 4121 | -c "found session_ticket extension" \ |
| 4122 | -c "parse new session ticket" \ |
| 4123 | -S "session successfully restored from cache" \ |
| 4124 | -s "session successfully restored from ticket" \ |
| 4125 | -s "a session has been resumed" \ |
| 4126 | -c "a session has been resumed" |
| 4127 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4128 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4129 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4130 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 4131 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4132 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4133 | 0 \ |
| 4134 | -c "client hello, adding session ticket extension" \ |
| 4135 | -s "found session ticket extension" \ |
| 4136 | -s "server hello, adding session ticket extension" \ |
| 4137 | -c "found session_ticket extension" \ |
| 4138 | -c "parse new session ticket" \ |
| 4139 | -S "session successfully restored from cache" \ |
| 4140 | -s "session successfully restored from ticket" \ |
| 4141 | -s "a session has been resumed" \ |
| 4142 | -c "a session has been resumed" |
| 4143 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4144 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4145 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4146 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 4147 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4148 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4149 | 0 \ |
| 4150 | -c "client hello, adding session ticket extension" \ |
| 4151 | -s "found session ticket extension" \ |
| 4152 | -s "server hello, adding session ticket extension" \ |
| 4153 | -c "found session_ticket extension" \ |
| 4154 | -c "parse new session ticket" \ |
| 4155 | -S "session successfully restored from cache" \ |
| 4156 | -s "session successfully restored from ticket" \ |
| 4157 | -s "a session has been resumed" \ |
| 4158 | -c "a session has been resumed" |
| 4159 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4160 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4161 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4162 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 4163 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4164 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4165 | 0 \ |
| 4166 | -c "client hello, adding session ticket extension" \ |
| 4167 | -s "found session ticket extension" \ |
| 4168 | -s "server hello, adding session ticket extension" \ |
| 4169 | -c "found session_ticket extension" \ |
| 4170 | -c "parse new session ticket" \ |
| 4171 | -S "session successfully restored from cache" \ |
| 4172 | -s "session successfully restored from ticket" \ |
| 4173 | -s "a session has been resumed" \ |
| 4174 | -c "a session has been resumed" |
| 4175 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4176 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4177 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4178 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 4179 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4180 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4181 | 0 \ |
| 4182 | -c "client hello, adding session ticket extension" \ |
| 4183 | -s "found session ticket extension" \ |
| 4184 | -s "server hello, adding session ticket extension" \ |
| 4185 | -c "found session_ticket extension" \ |
| 4186 | -c "parse new session ticket" \ |
| 4187 | -S "session successfully restored from cache" \ |
| 4188 | -s "session successfully restored from ticket" \ |
| 4189 | -s "a session has been resumed" \ |
| 4190 | -c "a session has been resumed" |
| 4191 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4192 | requires_cipher_enabled "CHACHA20" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4193 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4194 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 4195 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4196 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4197 | 0 \ |
| 4198 | -c "client hello, adding session ticket extension" \ |
| 4199 | -s "found session ticket extension" \ |
| 4200 | -s "server hello, adding session ticket extension" \ |
| 4201 | -c "found session_ticket extension" \ |
| 4202 | -c "parse new session ticket" \ |
| 4203 | -S "session successfully restored from cache" \ |
| 4204 | -s "session successfully restored from ticket" \ |
| 4205 | -s "a session has been resumed" \ |
| 4206 | -c "a session has been resumed" |
| 4207 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4208 | # Tests for Session Tickets with DTLS |
| 4209 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4210 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4211 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4212 | run_test "Session resume using tickets, DTLS: basic" \ |
| 4213 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4214 | "$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] | 4215 | 0 \ |
| 4216 | -c "client hello, adding session ticket extension" \ |
| 4217 | -s "found session ticket extension" \ |
| 4218 | -s "server hello, adding session ticket extension" \ |
| 4219 | -c "found session_ticket extension" \ |
| 4220 | -c "parse new session ticket" \ |
| 4221 | -S "session successfully restored from cache" \ |
| 4222 | -s "session successfully restored from ticket" \ |
| 4223 | -s "a session has been resumed" \ |
| 4224 | -c "a session has been resumed" |
| 4225 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4226 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4227 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4228 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 4229 | "$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] | 4230 | "$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] | 4231 | 0 \ |
| 4232 | -c "client hello, adding session ticket extension" \ |
| 4233 | -s "found session ticket extension" \ |
| 4234 | -s "server hello, adding session ticket extension" \ |
| 4235 | -c "found session_ticket extension" \ |
| 4236 | -c "parse new session ticket" \ |
| 4237 | -S "session successfully restored from cache" \ |
| 4238 | -s "session successfully restored from ticket" \ |
| 4239 | -s "a session has been resumed" \ |
| 4240 | -c "a session has been resumed" |
| 4241 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4242 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4243 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4244 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 4245 | "$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] | 4246 | "$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] | 4247 | 0 \ |
| 4248 | -c "client hello, adding session ticket extension" \ |
| 4249 | -s "found session ticket extension" \ |
| 4250 | -s "server hello, adding session ticket extension" \ |
| 4251 | -c "found session_ticket extension" \ |
| 4252 | -c "parse new session ticket" \ |
| 4253 | -S "session successfully restored from cache" \ |
| 4254 | -S "session successfully restored from ticket" \ |
| 4255 | -S "a session has been resumed" \ |
| 4256 | -C "a session has been resumed" |
| 4257 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4258 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4259 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4260 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 4261 | "$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] | 4262 | "$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] | 4263 | 0 \ |
| 4264 | -c "client hello, adding session ticket extension" \ |
| 4265 | -s "found session ticket extension" \ |
| 4266 | -s "server hello, adding session ticket extension" \ |
| 4267 | -c "found session_ticket extension" \ |
| 4268 | -c "parse new session ticket" \ |
| 4269 | -S "session successfully restored from cache" \ |
| 4270 | -s "session successfully restored from ticket" \ |
| 4271 | -s "a session has been resumed" \ |
| 4272 | -c "a session has been resumed" |
| 4273 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4274 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4275 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4276 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 4277 | "$O_SRV -dtls" \ |
| 4278 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 4279 | 0 \ |
| 4280 | -c "client hello, adding session ticket extension" \ |
| 4281 | -c "found session_ticket extension" \ |
| 4282 | -c "parse new session ticket" \ |
| 4283 | -c "a session has been resumed" |
| 4284 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4285 | # 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] | 4286 | # 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] | 4287 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4288 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4289 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4290 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 4291 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4292 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4293 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4294 | rm -f $SESSION )" \ |
| 4295 | 0 \ |
| 4296 | -s "found session ticket extension" \ |
| 4297 | -s "server hello, adding session ticket extension" \ |
| 4298 | -S "session successfully restored from cache" \ |
| 4299 | -s "session successfully restored from ticket" \ |
| 4300 | -s "a session has been resumed" |
| 4301 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4302 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4303 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4304 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4305 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4306 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4307 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4308 | "$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] | 4309 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4310 | -c "client hello, adding session ticket extension" \ |
| 4311 | -s "found session ticket extension" \ |
| 4312 | -S "server hello, adding session ticket extension" \ |
| 4313 | -C "found session_ticket extension" \ |
| 4314 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4315 | -s "session successfully restored from cache" \ |
| 4316 | -S "session successfully restored from ticket" \ |
| 4317 | -s "a session has been resumed" \ |
| 4318 | -c "a session has been resumed" |
| 4319 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4320 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4321 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4322 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4323 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4324 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4325 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4326 | -C "client hello, adding session ticket extension" \ |
| 4327 | -S "found session ticket extension" \ |
| 4328 | -S "server hello, adding session ticket extension" \ |
| 4329 | -C "found session_ticket extension" \ |
| 4330 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4331 | -s "session successfully restored from cache" \ |
| 4332 | -S "session successfully restored from ticket" \ |
| 4333 | -s "a session has been resumed" \ |
| 4334 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4335 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4336 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4337 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4338 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4339 | "$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] | 4340 | 0 \ |
| 4341 | -S "session successfully restored from cache" \ |
| 4342 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4343 | -S "a session has been resumed" \ |
| 4344 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4345 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4346 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4347 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4348 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4349 | "$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] | 4350 | 0 \ |
| 4351 | -s "session successfully restored from cache" \ |
| 4352 | -S "session successfully restored from ticket" \ |
| 4353 | -s "a session has been resumed" \ |
| 4354 | -c "a session has been resumed" |
| 4355 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4356 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4357 | run_test "Session resume using cache: cache removed" \ |
| 4358 | "$P_SRV debug_level=3 tickets=0 cache_remove=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4359 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4360 | 0 \ |
| 4361 | -C "client hello, adding session ticket extension" \ |
| 4362 | -S "found session ticket extension" \ |
| 4363 | -S "server hello, adding session ticket extension" \ |
| 4364 | -C "found session_ticket extension" \ |
| 4365 | -C "parse new session ticket" \ |
| 4366 | -S "session successfully restored from cache" \ |
| 4367 | -S "session successfully restored from ticket" \ |
| 4368 | -S "a session has been resumed" \ |
| 4369 | -C "a session has been resumed" |
| 4370 | |
| 4371 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4372 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 4373 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4374 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4375 | "$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] | 4376 | 0 \ |
| 4377 | -s "session successfully restored from cache" \ |
| 4378 | -S "session successfully restored from ticket" \ |
| 4379 | -s "a session has been resumed" \ |
| 4380 | -c "a session has been resumed" |
| 4381 | |
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: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4384 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4385 | "$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] | 4386 | 0 \ |
| 4387 | -S "session successfully restored from cache" \ |
| 4388 | -S "session successfully restored from ticket" \ |
| 4389 | -S "a session has been resumed" \ |
| 4390 | -C "a session has been resumed" |
| 4391 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4392 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4393 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4394 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4395 | "$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] | 4396 | 0 \ |
| 4397 | -s "session successfully restored from cache" \ |
| 4398 | -S "session successfully restored from ticket" \ |
| 4399 | -s "a session has been resumed" \ |
| 4400 | -c "a session has been resumed" |
| 4401 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4402 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4403 | run_test "Session resume using cache: session copy" \ |
| 4404 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4405 | "$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] | 4406 | 0 \ |
| 4407 | -s "session successfully restored from cache" \ |
| 4408 | -S "session successfully restored from ticket" \ |
| 4409 | -s "a session has been resumed" \ |
| 4410 | -c "a session has been resumed" |
| 4411 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4412 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4413 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4414 | run_test "Session resume using cache: openssl client" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4415 | "$P_SRV force_version=tls12 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 4416 | "( $O_CLI -sess_out $SESSION; \ |
| 4417 | $O_CLI -sess_in $SESSION; \ |
| 4418 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4419 | 0 \ |
| 4420 | -s "found session ticket extension" \ |
| 4421 | -S "server hello, adding session ticket extension" \ |
| 4422 | -s "session successfully restored from cache" \ |
| 4423 | -S "session successfully restored from ticket" \ |
| 4424 | -s "a session has been resumed" |
| 4425 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4426 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4427 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4428 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4429 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4430 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4431 | 0 \ |
| 4432 | -C "found session_ticket extension" \ |
| 4433 | -C "parse new session ticket" \ |
| 4434 | -c "a session has been resumed" |
| 4435 | |
Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 4436 | # Tests for Session resume and extensions |
| 4437 | |
| 4438 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4439 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 4440 | run_test "Session resume and connection ID" \ |
| 4441 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 4442 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 4443 | 0 \ |
| 4444 | -c "Enable use of CID extension." \ |
| 4445 | -s "Enable use of CID extension." \ |
| 4446 | -c "client hello, adding CID extension" \ |
| 4447 | -s "found CID extension" \ |
| 4448 | -s "Use of CID extension negotiated" \ |
| 4449 | -s "server hello, adding CID extension" \ |
| 4450 | -c "found CID extension" \ |
| 4451 | -c "Use of CID extension negotiated" \ |
| 4452 | -s "Copy CIDs into SSL transform" \ |
| 4453 | -c "Copy CIDs into SSL transform" \ |
| 4454 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 4455 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 4456 | -s "Use of Connection ID has been negotiated" \ |
| 4457 | -c "Use of Connection ID has been negotiated" |
| 4458 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4459 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 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 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4463 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4464 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 4465 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4466 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4467 | 0 \ |
| 4468 | -c "client hello, adding session ticket extension" \ |
| 4469 | -s "found session ticket extension" \ |
| 4470 | -S "server hello, adding session ticket extension" \ |
| 4471 | -C "found session_ticket extension" \ |
| 4472 | -C "parse new session ticket" \ |
| 4473 | -s "session successfully restored from cache" \ |
| 4474 | -S "session successfully restored from ticket" \ |
| 4475 | -s "a session has been resumed" \ |
| 4476 | -c "a session has been resumed" |
| 4477 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4478 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4479 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4480 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4481 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 4482 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4483 | "$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] | 4484 | 0 \ |
| 4485 | -C "client hello, adding session ticket extension" \ |
| 4486 | -S "found session ticket extension" \ |
| 4487 | -S "server hello, adding session ticket extension" \ |
| 4488 | -C "found session_ticket extension" \ |
| 4489 | -C "parse new session ticket" \ |
| 4490 | -s "session successfully restored from cache" \ |
| 4491 | -S "session successfully restored from ticket" \ |
| 4492 | -s "a session has been resumed" \ |
| 4493 | -c "a session has been resumed" |
| 4494 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4496 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4497 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 4498 | "$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] | 4499 | "$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] | 4500 | 0 \ |
| 4501 | -S "session successfully restored from cache" \ |
| 4502 | -S "session successfully restored from ticket" \ |
| 4503 | -S "a session has been resumed" \ |
| 4504 | -C "a session has been resumed" |
| 4505 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4506 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4507 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4508 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 4509 | "$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] | 4510 | "$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] | 4511 | 0 \ |
| 4512 | -s "session successfully restored from cache" \ |
| 4513 | -S "session successfully restored from ticket" \ |
| 4514 | -s "a session has been resumed" \ |
| 4515 | -c "a session has been resumed" |
| 4516 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4517 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4518 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4519 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 4520 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4521 | "$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] | 4522 | 0 \ |
| 4523 | -s "session successfully restored from cache" \ |
| 4524 | -S "session successfully restored from ticket" \ |
| 4525 | -s "a session has been resumed" \ |
| 4526 | -c "a session has been resumed" |
| 4527 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4528 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4529 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4530 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 4531 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4532 | "$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] | 4533 | 0 \ |
| 4534 | -S "session successfully restored from cache" \ |
| 4535 | -S "session successfully restored from ticket" \ |
| 4536 | -S "a session has been resumed" \ |
| 4537 | -C "a session has been resumed" |
| 4538 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4539 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4540 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4541 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 4542 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4543 | "$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] | 4544 | 0 \ |
| 4545 | -s "session successfully restored from cache" \ |
| 4546 | -S "session successfully restored from ticket" \ |
| 4547 | -s "a session has been resumed" \ |
| 4548 | -c "a session has been resumed" |
| 4549 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4550 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4551 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4552 | run_test "Session resume using cache, DTLS: session copy" \ |
| 4553 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4554 | "$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] | 4555 | 0 \ |
| 4556 | -s "session successfully restored from cache" \ |
| 4557 | -S "session successfully restored from ticket" \ |
| 4558 | -s "a session has been resumed" \ |
| 4559 | -c "a session has been resumed" |
| 4560 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4561 | # 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] | 4562 | # 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] | 4563 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4565 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4566 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4567 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 4568 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4569 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4570 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4571 | rm -f $SESSION )" \ |
| 4572 | 0 \ |
| 4573 | -s "found session ticket extension" \ |
| 4574 | -S "server hello, adding session ticket extension" \ |
| 4575 | -s "session successfully restored from cache" \ |
| 4576 | -S "session successfully restored from ticket" \ |
| 4577 | -s "a session has been resumed" |
| 4578 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4579 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4580 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4581 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 4582 | "$O_SRV -dtls" \ |
| 4583 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 4584 | 0 \ |
| 4585 | -C "found session_ticket extension" \ |
| 4586 | -C "parse new session ticket" \ |
| 4587 | -c "a session has been resumed" |
| 4588 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4589 | # Tests for Max Fragment Length extension |
| 4590 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4591 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4592 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4593 | run_test "Max fragment length: enabled, default" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4594 | "$P_SRV debug_level=3 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4595 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4596 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4597 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4598 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4599 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4600 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4601 | -C "client hello, adding max_fragment_length extension" \ |
| 4602 | -S "found max fragment length extension" \ |
| 4603 | -S "server hello, max_fragment_length extension" \ |
| 4604 | -C "found max_fragment_length extension" |
| 4605 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4606 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4607 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4608 | run_test "Max fragment length: enabled, default, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4609 | "$P_SRV debug_level=3 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4610 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4611 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4612 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4613 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4614 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4615 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4616 | -C "client hello, adding max_fragment_length extension" \ |
| 4617 | -S "found max fragment length extension" \ |
| 4618 | -S "server hello, max_fragment_length extension" \ |
| 4619 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4620 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4621 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4622 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4623 | |
| 4624 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4625 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4626 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 4627 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4628 | "$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] | 4629 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4630 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4631 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4632 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4633 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4634 | -C "client hello, adding max_fragment_length extension" \ |
| 4635 | -S "found max fragment length extension" \ |
| 4636 | -S "server hello, max_fragment_length extension" \ |
| 4637 | -C "found max_fragment_length extension" \ |
| 4638 | -c "fragment larger than.*maximum " |
| 4639 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4640 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 4641 | # (session fragment length will be 16384 regardless of mbedtls |
| 4642 | # content length configuration.) |
| 4643 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4644 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4645 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4646 | run_test "Max fragment length: disabled, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4647 | "$P_SRV debug_level=3 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4648 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4649 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4650 | -C "Maximum incoming record payload length is 16384" \ |
| 4651 | -C "Maximum outgoing record payload length is 16384" \ |
| 4652 | -S "Maximum incoming record payload length is 16384" \ |
| 4653 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4654 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4655 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4656 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4657 | |
| 4658 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4659 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4660 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4661 | "$P_SRV debug_level=3 dtls=1 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4662 | "$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] | 4663 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4664 | -C "Maximum incoming record payload length is 16384" \ |
| 4665 | -C "Maximum outgoing record payload length is 16384" \ |
| 4666 | -S "Maximum incoming record payload length is 16384" \ |
| 4667 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4668 | -c "fragment larger than.*maximum " |
| 4669 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4670 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4671 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4672 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4673 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4674 | "$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] | 4675 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4676 | -c "Maximum incoming record payload length is 4096" \ |
| 4677 | -c "Maximum outgoing record payload length is 4096" \ |
| 4678 | -s "Maximum incoming record payload length is 4096" \ |
| 4679 | -s "Maximum outgoing record payload length is 4096" \ |
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 512, server 1024" \ |
| 4688 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4689 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4690 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4691 | -c "Maximum incoming record payload length is 512" \ |
| 4692 | -c "Maximum outgoing record payload length is 512" \ |
| 4693 | -s "Maximum incoming record payload length is 512" \ |
| 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 512, 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=512" \ |
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 512" \ |
| 4707 | -c "Maximum outgoing record payload length is 512" \ |
| 4708 | -s "Maximum incoming record payload length is 512" \ |
| 4709 | -s "Maximum outgoing record payload length is 512" \ |
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 512, 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=512" \ |
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 512" \ |
| 4722 | -c "Maximum outgoing record payload length is 512" \ |
| 4723 | -s "Maximum incoming record payload length is 512" \ |
| 4724 | -s "Maximum outgoing record payload length is 512" \ |
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 1024 |
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 1024, 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=1024" \ |
| 4735 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4736 | -c "Maximum incoming record payload length is 1024" \ |
| 4737 | -c "Maximum outgoing record payload length is 1024" \ |
| 4738 | -s "Maximum incoming record payload length is 1024" \ |
| 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 1024, server 2048" \ |
| 4748 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4749 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4750 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4751 | -c "Maximum incoming record payload length is 1024" \ |
| 4752 | -c "Maximum outgoing record payload length is 1024" \ |
| 4753 | -s "Maximum incoming record payload length is 1024" \ |
| 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 1024, 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=1024" \ |
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 1024" \ |
| 4767 | -c "Maximum outgoing record payload length is 1024" \ |
| 4768 | -s "Maximum incoming record payload length is 1024" \ |
| 4769 | -s "Maximum outgoing record payload length is 1024" \ |
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 2048 |
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 2048, 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=2048" \ |
| 4780 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4781 | -c "Maximum incoming record payload length is 2048" \ |
| 4782 | -c "Maximum outgoing record payload length is 2048" \ |
| 4783 | -s "Maximum incoming record payload length is 2048" \ |
| 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 2048 |
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 2048, 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=2048" \ |
| 4795 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4796 | -c "Maximum incoming record payload length is 2048" \ |
| 4797 | -c "Maximum outgoing record payload length is 2048" \ |
| 4798 | -s "Maximum incoming record payload length is 2048" \ |
| 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 2048, server 4096" \ |
| 4808 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4809 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4810 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4811 | -c "Maximum incoming record payload length is 2048" \ |
| 4812 | -c "Maximum outgoing record payload length is 2048" \ |
| 4813 | -s "Maximum incoming record payload length is 2048" \ |
| 4814 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [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 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4821 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4822 | run_test "Max fragment length: client 4096, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4823 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4824 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4825 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4826 | -c "Maximum incoming record payload length is 4096" \ |
| 4827 | -c "Maximum outgoing record payload length is 4096" \ |
| 4828 | -s "Maximum incoming record payload length is 4096" \ |
| 4829 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [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" |
| 4834 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4835 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4836 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4837 | run_test "Max fragment length: client 4096, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4838 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4839 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4840 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4841 | -c "Maximum incoming record payload length is 4096" \ |
| 4842 | -c "Maximum outgoing record payload length is 4096" \ |
| 4843 | -s "Maximum incoming record payload length is 4096" \ |
| 4844 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4845 | -c "client hello, adding max_fragment_length extension" \ |
| 4846 | -s "found max fragment length extension" \ |
| 4847 | -s "server hello, max_fragment_length extension" \ |
| 4848 | -c "found max_fragment_length extension" |
| 4849 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4850 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4851 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4852 | run_test "Max fragment length: client 4096, server 2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4853 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4854 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4855 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4856 | -c "Maximum incoming record payload length is 4096" \ |
| 4857 | -c "Maximum outgoing record payload length is 4096" \ |
| 4858 | -s "Maximum incoming record payload length is 4096" \ |
| 4859 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4860 | -c "client hello, adding max_fragment_length extension" \ |
| 4861 | -s "found max fragment length extension" \ |
| 4862 | -s "server hello, max_fragment_length extension" \ |
| 4863 | -c "found max_fragment_length extension" |
| 4864 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4865 | requires_max_content_len 4096 |
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 | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4867 | run_test "Max fragment length: used by server" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4868 | "$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] | 4869 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4870 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4871 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4872 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4873 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4874 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [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" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4879 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4880 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4881 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4882 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4883 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4884 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4885 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4886 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4887 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4888 | -c "Maximum incoming record payload length is 4096" \ |
| 4889 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4890 | -c "client hello, adding max_fragment_length extension" \ |
| 4891 | -c "found max_fragment_length extension" |
| 4892 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4893 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4894 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4895 | run_test "Max fragment length: client, message just fits" \ |
| 4896 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4897 | "$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] | 4898 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4899 | -c "Maximum incoming record payload length is 2048" \ |
| 4900 | -c "Maximum outgoing record payload length is 2048" \ |
| 4901 | -s "Maximum incoming record payload length is 2048" \ |
| 4902 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4903 | -c "client hello, adding max_fragment_length extension" \ |
| 4904 | -s "found max fragment length extension" \ |
| 4905 | -s "server hello, max_fragment_length extension" \ |
| 4906 | -c "found max_fragment_length extension" \ |
| 4907 | -c "2048 bytes written in 1 fragments" \ |
| 4908 | -s "2048 bytes read" |
| 4909 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4910 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4911 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4912 | run_test "Max fragment length: client, larger message" \ |
| 4913 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4914 | "$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] | 4915 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4916 | -c "Maximum incoming record payload length is 2048" \ |
| 4917 | -c "Maximum outgoing record payload length is 2048" \ |
| 4918 | -s "Maximum incoming record payload length is 2048" \ |
| 4919 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4920 | -c "client hello, adding max_fragment_length extension" \ |
| 4921 | -s "found max fragment length extension" \ |
| 4922 | -s "server hello, max_fragment_length extension" \ |
| 4923 | -c "found max_fragment_length extension" \ |
| 4924 | -c "2345 bytes written in 2 fragments" \ |
| 4925 | -s "2048 bytes read" \ |
| 4926 | -s "297 bytes read" |
| 4927 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4928 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4929 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4930 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4931 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4932 | "$P_SRV debug_level=3 dtls=1" \ |
| 4933 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4934 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4935 | -c "Maximum incoming record payload length is 2048" \ |
| 4936 | -c "Maximum outgoing record payload length is 2048" \ |
| 4937 | -s "Maximum incoming record payload length is 2048" \ |
| 4938 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4939 | -c "client hello, adding max_fragment_length extension" \ |
| 4940 | -s "found max fragment length extension" \ |
| 4941 | -s "server hello, max_fragment_length extension" \ |
| 4942 | -c "found max_fragment_length extension" \ |
| 4943 | -c "fragment larger than.*maximum" |
| 4944 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4945 | # Tests for Record Size Limit extension |
| 4946 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4947 | requires_gnutls_tls1_3 |
| 4948 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4949 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 4950 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4951 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4952 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4953 | 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] | 4954 | "$P_SRV debug_level=3 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4955 | "$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] | 4956 | 0 \ |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4957 | -s "RecordSizeLimit: 16385 Bytes" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4958 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4959 | -s "Maximum outgoing record payload length is 16383" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4960 | -s "bytes written in 1 fragments" |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4961 | |
| 4962 | requires_gnutls_tls1_3 |
| 4963 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4964 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 4965 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4966 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4967 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4968 | 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] | 4969 | "$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] | 4970 | "$P_CLI debug_level=4 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4971 | 0 \ |
Yanray Wang | 42017cd | 2023-11-08 11:15:23 +0800 | [diff] [blame] | 4972 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 4973 | -c "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 4974 | -c "EncryptedExtensions: record_size_limit(28) extension received." \ |
Yanray Wang | 42017cd | 2023-11-08 11:15:23 +0800 | [diff] [blame] | 4975 | -c "RecordSizeLimit: 16385 Bytes" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4976 | |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 4977 | # In the following tests, --recordsize is the value used by the G_NEXT_CLI (3.7.2) to configure the |
| 4978 | # maximum record size using gnutls_record_set_max_size() |
| 4979 | # (https://gnutls.org/reference/gnutls-gnutls.html#gnutls-record-set-max-size). |
| 4980 | # There is currently a lower limit of 512, caused by gnutls_record_set_max_size() |
| 4981 | # not respecting the "%ALLOW_SMALL_RECORDS" priority string and not using the |
| 4982 | # more recent function gnutls_record_set_max_recv_size() |
| 4983 | # (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] | 4984 | # There is currently an upper limit of 4096, caused by the cli arg parser: |
| 4985 | # 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] | 4986 | # Thus, these tests are currently limited to the value range 512-4096. |
| 4987 | # Also, the value sent in the extension will be one larger than the value |
| 4988 | # set at the command line: |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4989 | # 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] | 4990 | |
| 4991 | # 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] | 4992 | # so for 513 record size limit tests we use preshared key to avoid sending |
| 4993 | # the certificate. |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4994 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4995 | requires_gnutls_tls1_3 |
| 4996 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4997 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 4998 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4999 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5000 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 5001 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 1 fragment" \ |
| 5002 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 5003 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 5004 | response_size=256" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 5005 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 5006 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5007 | 0 \ |
| 5008 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 5009 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 5010 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5011 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5012 | -s "Maximum outgoing record payload length is 511" \ |
| 5013 | -s "256 bytes written in 1 fragments" |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 5014 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5015 | requires_gnutls_tls1_3 |
| 5016 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5017 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5018 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5019 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5020 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 5021 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 2 fragments" \ |
| 5022 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 5023 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 5024 | response_size=768" \ |
| 5025 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 5026 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
| 5027 | 0 \ |
| 5028 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 5029 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 5030 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5031 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5032 | -s "Maximum outgoing record payload length is 511" \ |
| 5033 | -s "768 bytes written in 2 fragments" |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 5034 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5035 | requires_gnutls_tls1_3 |
| 5036 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5037 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5038 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5039 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5040 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 5041 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 3 fragments" \ |
| 5042 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 5043 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 5044 | response_size=1280" \ |
| 5045 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 5046 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
| 5047 | 0 \ |
| 5048 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 5049 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 5050 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5051 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5052 | -s "Maximum outgoing record payload length is 511" \ |
| 5053 | -s "1280 bytes written in 3 fragments" |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5054 | |
| 5055 | requires_gnutls_tls1_3 |
| 5056 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5057 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5058 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5059 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5060 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5061 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 1 fragment" \ |
| 5062 | "$P_SRV debug_level=3 force_version=tls13 response_size=512" \ |
| 5063 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 5064 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5065 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 5066 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5067 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5068 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5069 | -s "Maximum outgoing record payload length is 1023" \ |
| 5070 | -s "512 bytes written in 1 fragments" |
| 5071 | |
| 5072 | requires_gnutls_tls1_3 |
| 5073 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5074 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5075 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5076 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5077 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5078 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 2 fragments" \ |
| 5079 | "$P_SRV debug_level=3 force_version=tls13 response_size=1536" \ |
| 5080 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 5081 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5082 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 5083 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5084 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5085 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5086 | -s "Maximum outgoing record payload length is 1023" \ |
| 5087 | -s "1536 bytes written in 2 fragments" |
| 5088 | |
| 5089 | requires_gnutls_tls1_3 |
| 5090 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5091 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5092 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5093 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5094 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5095 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 3 fragments" \ |
| 5096 | "$P_SRV debug_level=3 force_version=tls13 response_size=2560" \ |
| 5097 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 5098 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5099 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 5100 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5101 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5102 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5103 | -s "Maximum outgoing record payload length is 1023" \ |
| 5104 | -s "2560 bytes written in 3 fragments" |
| 5105 | |
| 5106 | requires_gnutls_tls1_3 |
| 5107 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5108 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5109 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5110 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5111 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5112 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 1 fragment" \ |
| 5113 | "$P_SRV debug_level=3 force_version=tls13 response_size=2048" \ |
| 5114 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5115 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5116 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5117 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5118 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5119 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5120 | -s "Maximum outgoing record payload length is 4095" \ |
| 5121 | -s "2048 bytes written in 1 fragments" |
| 5122 | |
| 5123 | requires_gnutls_tls1_3 |
| 5124 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5125 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5126 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5127 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5128 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5129 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 2 fragments" \ |
| 5130 | "$P_SRV debug_level=3 force_version=tls13 response_size=6144" \ |
| 5131 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5132 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5133 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5134 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5135 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5136 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5137 | -s "Maximum outgoing record payload length is 4095" \ |
| 5138 | -s "6144 bytes written in 2 fragments" |
| 5139 | |
| 5140 | requires_gnutls_tls1_3 |
| 5141 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5142 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5143 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5144 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5145 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5146 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 3 fragments" \ |
| 5147 | "$P_SRV debug_level=3 force_version=tls13 response_size=10240" \ |
| 5148 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5149 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5150 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5151 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5152 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5153 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5154 | -s "Maximum outgoing record payload length is 4095" \ |
| 5155 | -s "10240 bytes written in 3 fragments" |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 5156 | |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5157 | requires_gnutls_tls1_3 |
| 5158 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5159 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5160 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5161 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5162 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5163 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 1 fragment" \ |
| 5164 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5165 | "$P_CLI debug_level=4 force_version=tls13 request_size=256" \ |
| 5166 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5167 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5168 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5169 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5170 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5171 | -c "Maximum outgoing record payload length is 511" \ |
| 5172 | -c "256 bytes written in 1 fragments" |
| 5173 | |
| 5174 | requires_gnutls_tls1_3 |
| 5175 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5176 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5177 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5178 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5179 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5180 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 2 fragments" \ |
| 5181 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5182 | "$P_CLI debug_level=4 force_version=tls13 request_size=768" \ |
| 5183 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5184 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5185 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5186 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5187 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5188 | -c "Maximum outgoing record payload length is 511" \ |
| 5189 | -c "768 bytes written in 2 fragments" |
| 5190 | |
| 5191 | requires_gnutls_tls1_3 |
| 5192 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5193 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5194 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5195 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5196 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5197 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 3 fragments" \ |
| 5198 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5199 | "$P_CLI debug_level=4 force_version=tls13 request_size=1280" \ |
| 5200 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5201 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5202 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5203 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5204 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5205 | -c "Maximum outgoing record payload length is 511" \ |
| 5206 | -c "1280 bytes written in 3 fragments" |
| 5207 | |
| 5208 | requires_gnutls_tls1_3 |
| 5209 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5210 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5211 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5212 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5213 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5214 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 1 fragment" \ |
| 5215 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5216 | "$P_CLI debug_level=4 force_version=tls13 request_size=512" \ |
| 5217 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5218 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5219 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5220 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5221 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5222 | -c "Maximum outgoing record payload length is 1023" \ |
| 5223 | -c "512 bytes written in 1 fragments" |
| 5224 | |
| 5225 | requires_gnutls_tls1_3 |
| 5226 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5227 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5228 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5229 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5230 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5231 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 2 fragments" \ |
| 5232 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5233 | "$P_CLI debug_level=4 force_version=tls13 request_size=1536" \ |
| 5234 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5235 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5236 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5237 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5238 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5239 | -c "Maximum outgoing record payload length is 1023" \ |
| 5240 | -c "1536 bytes written in 2 fragments" |
| 5241 | |
| 5242 | requires_gnutls_tls1_3 |
| 5243 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5244 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5245 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5246 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5247 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5248 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 3 fragments" \ |
| 5249 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5250 | "$P_CLI debug_level=4 force_version=tls13 request_size=2560" \ |
| 5251 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5252 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5253 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5254 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5255 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5256 | -c "Maximum outgoing record payload length is 1023" \ |
| 5257 | -c "2560 bytes written in 3 fragments" |
| 5258 | |
| 5259 | requires_gnutls_tls1_3 |
| 5260 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5261 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5262 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5263 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5264 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5265 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 1 fragment" \ |
| 5266 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5267 | "$P_CLI debug_level=4 force_version=tls13 request_size=2048" \ |
| 5268 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5269 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5270 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5271 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5272 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5273 | -c "Maximum outgoing record payload length is 4095" \ |
| 5274 | -c "2048 bytes written in 1 fragments" |
| 5275 | |
| 5276 | requires_gnutls_tls1_3 |
| 5277 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5278 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5279 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5280 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5281 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5282 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 2 fragments" \ |
| 5283 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5284 | "$P_CLI debug_level=4 force_version=tls13 request_size=6144" \ |
| 5285 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5286 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5287 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5288 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5289 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5290 | -c "Maximum outgoing record payload length is 4095" \ |
| 5291 | -c "6144 bytes written in 2 fragments" |
| 5292 | |
| 5293 | requires_gnutls_tls1_3 |
| 5294 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5295 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5296 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5297 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5298 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5299 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 3 fragments" \ |
| 5300 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5301 | "$P_CLI debug_level=4 force_version=tls13 request_size=10240" \ |
| 5302 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5303 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5304 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5305 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5306 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5307 | -c "Maximum outgoing record payload length is 4095" \ |
| 5308 | -c "10240 bytes written in 3 fragments" |
| 5309 | |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5310 | # TODO: For time being, we send fixed value of RecordSizeLimit defined by |
| 5311 | # MBEDTLS_SSL_IN_CONTENT_LEN. Once we support variable buffer length of |
| 5312 | # RecordSizeLimit, we need to modify value of RecordSizeLimit in below test. |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5313 | requires_config_value_equals "MBEDTLS_SSL_IN_CONTENT_LEN" 16384 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5314 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5315 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5316 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5317 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5318 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5319 | 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] | 5320 | "$P_SRV debug_level=4 force_version=tls13" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5321 | "$P_CLI debug_level=4" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5322 | 0 \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5323 | -c "Sent RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5324 | -c "RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5325 | -s "RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5326 | -s "Sent RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5327 | -s "Maximum outgoing record payload length is 16383" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5328 | -s "Maximum incoming record payload length is 16384" |
| 5329 | |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 5330 | # End of Record size limit tests |
| 5331 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5332 | # Tests for renegotiation |
| 5333 | |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5334 | # G_NEXT_SRV is used in renegotiation tests becuase of the increased |
| 5335 | # extensions limit since we exceed the limit in G_SRV when we send |
| 5336 | # TLS 1.3 extensions in the initial handshake. |
| 5337 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5338 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5339 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5340 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5341 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5342 | 0 \ |
| 5343 | -C "client hello, adding renegotiation extension" \ |
| 5344 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5345 | -S "found renegotiation extension" \ |
| 5346 | -s "server hello, secure renegotiation extension" \ |
| 5347 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5348 | -C "=> renegotiate" \ |
| 5349 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5350 | -S "write hello request" |
| 5351 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5352 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5353 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5354 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5355 | "$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] | 5356 | 0 \ |
| 5357 | -c "client hello, adding renegotiation extension" \ |
| 5358 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5359 | -s "found renegotiation extension" \ |
| 5360 | -s "server hello, secure renegotiation extension" \ |
| 5361 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5362 | -c "=> renegotiate" \ |
| 5363 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5364 | -S "write hello request" |
| 5365 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5366 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5367 | run_test "Renegotiation: server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5368 | "$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] | 5369 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5370 | 0 \ |
| 5371 | -c "client hello, adding renegotiation extension" \ |
| 5372 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5373 | -s "found renegotiation extension" \ |
| 5374 | -s "server hello, secure renegotiation extension" \ |
| 5375 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5376 | -c "=> renegotiate" \ |
| 5377 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5378 | -s "write hello request" |
| 5379 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5380 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 5381 | # 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] | 5382 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5383 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5384 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 5385 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5386 | "$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] | 5387 | 0 \ |
| 5388 | -c "client hello, adding renegotiation extension" \ |
| 5389 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5390 | -s "found renegotiation extension" \ |
| 5391 | -s "server hello, secure renegotiation extension" \ |
| 5392 | -c "found renegotiation extension" \ |
| 5393 | -c "=> renegotiate" \ |
| 5394 | -s "=> renegotiate" \ |
| 5395 | -S "write hello request" \ |
| 5396 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 5397 | |
| 5398 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 5399 | # 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] | 5400 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5401 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5402 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5403 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5404 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 5405 | 0 \ |
| 5406 | -c "client hello, adding renegotiation extension" \ |
| 5407 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5408 | -s "found renegotiation extension" \ |
| 5409 | -s "server hello, secure renegotiation extension" \ |
| 5410 | -c "found renegotiation extension" \ |
| 5411 | -c "=> renegotiate" \ |
| 5412 | -s "=> renegotiate" \ |
| 5413 | -s "write hello request" \ |
| 5414 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 5415 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5416 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5417 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5418 | "$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] | 5419 | "$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] | 5420 | 0 \ |
| 5421 | -c "client hello, adding renegotiation extension" \ |
| 5422 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5423 | -s "found renegotiation extension" \ |
| 5424 | -s "server hello, secure renegotiation extension" \ |
| 5425 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5426 | -c "=> renegotiate" \ |
| 5427 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5428 | -s "write hello request" |
| 5429 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5430 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5431 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 5432 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5433 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5434 | "$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] | 5435 | "$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" \ |
| 5436 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 5437 | -c "Maximum incoming record payload length is 2048" \ |
| 5438 | -c "Maximum outgoing record payload length is 2048" \ |
| 5439 | -s "Maximum incoming record payload length is 2048" \ |
| 5440 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5441 | -c "client hello, adding max_fragment_length extension" \ |
| 5442 | -s "found max fragment length extension" \ |
| 5443 | -s "server hello, max_fragment_length extension" \ |
| 5444 | -c "found max_fragment_length extension" \ |
| 5445 | -c "client hello, adding renegotiation extension" \ |
| 5446 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5447 | -s "found renegotiation extension" \ |
| 5448 | -s "server hello, secure renegotiation extension" \ |
| 5449 | -c "found renegotiation extension" \ |
| 5450 | -c "=> renegotiate" \ |
| 5451 | -s "=> renegotiate" \ |
| 5452 | -s "write hello request" |
| 5453 | |
| 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: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5456 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5457 | "$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] | 5458 | 1 \ |
| 5459 | -c "client hello, adding renegotiation extension" \ |
| 5460 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5461 | -S "found renegotiation extension" \ |
| 5462 | -s "server hello, secure renegotiation extension" \ |
| 5463 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5464 | -c "=> renegotiate" \ |
| 5465 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5466 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 5467 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5468 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [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-rejected, default" \ |
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 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5473 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5474 | 0 \ |
| 5475 | -C "client hello, adding renegotiation extension" \ |
| 5476 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5477 | -S "found renegotiation extension" \ |
| 5478 | -s "server hello, secure renegotiation extension" \ |
| 5479 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5480 | -C "=> renegotiate" \ |
| 5481 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5482 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 5483 | -S "SSL - An unexpected message was received from our peer" \ |
| 5484 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5485 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5486 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5487 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5488 | "$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] | 5489 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5490 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [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 | -C "=> renegotiate" \ |
| 5498 | -S "=> renegotiate" \ |
| 5499 | -s "write hello request" \ |
| 5500 | -S "SSL - An unexpected message was received from our peer" \ |
| 5501 | -S "failed" |
| 5502 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5503 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5504 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5505 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5506 | "$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] | 5507 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5508 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [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 | -C "=> renegotiate" \ |
| 5516 | -S "=> renegotiate" \ |
| 5517 | -s "write hello request" \ |
| 5518 | -S "SSL - An unexpected message was received from our peer" \ |
| 5519 | -S "failed" |
| 5520 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5521 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5522 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5523 | "$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] | 5524 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5525 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [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 | -C "=> renegotiate" \ |
| 5533 | -S "=> renegotiate" \ |
| 5534 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5535 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5536 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5537 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5538 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5539 | "$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] | 5540 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5541 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5542 | 0 \ |
| 5543 | -c "client hello, adding renegotiation extension" \ |
| 5544 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5545 | -s "found renegotiation extension" \ |
| 5546 | -s "server hello, secure renegotiation extension" \ |
| 5547 | -c "found renegotiation extension" \ |
| 5548 | -c "=> renegotiate" \ |
| 5549 | -s "=> renegotiate" \ |
| 5550 | -s "write hello request" \ |
| 5551 | -S "SSL - An unexpected message was received from our peer" \ |
| 5552 | -S "failed" |
| 5553 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5554 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5555 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5556 | "$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] | 5557 | "$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] | 5558 | 0 \ |
| 5559 | -C "client hello, adding renegotiation extension" \ |
| 5560 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5561 | -S "found renegotiation extension" \ |
| 5562 | -s "server hello, secure renegotiation extension" \ |
| 5563 | -c "found renegotiation extension" \ |
| 5564 | -S "record counter limit reached: renegotiate" \ |
| 5565 | -C "=> renegotiate" \ |
| 5566 | -S "=> renegotiate" \ |
| 5567 | -S "write hello request" \ |
| 5568 | -S "SSL - An unexpected message was received from our peer" \ |
| 5569 | -S "failed" |
| 5570 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 5571 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5572 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5573 | run_test "Renegotiation: periodic, just above period" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5574 | "$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] | 5575 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5576 | 0 \ |
| 5577 | -c "client hello, adding renegotiation extension" \ |
| 5578 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5579 | -s "found renegotiation extension" \ |
| 5580 | -s "server hello, secure renegotiation extension" \ |
| 5581 | -c "found renegotiation extension" \ |
| 5582 | -s "record counter limit reached: renegotiate" \ |
| 5583 | -c "=> renegotiate" \ |
| 5584 | -s "=> renegotiate" \ |
| 5585 | -s "write hello request" \ |
| 5586 | -S "SSL - An unexpected message was received from our peer" \ |
| 5587 | -S "failed" |
| 5588 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5589 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5590 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5591 | "$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] | 5592 | "$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] | 5593 | 0 \ |
| 5594 | -c "client hello, adding renegotiation extension" \ |
| 5595 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5596 | -s "found renegotiation extension" \ |
| 5597 | -s "server hello, secure renegotiation extension" \ |
| 5598 | -c "found renegotiation extension" \ |
| 5599 | -s "record counter limit reached: renegotiate" \ |
| 5600 | -c "=> renegotiate" \ |
| 5601 | -s "=> renegotiate" \ |
| 5602 | -s "write hello request" \ |
| 5603 | -S "SSL - An unexpected message was received from our peer" \ |
| 5604 | -S "failed" |
| 5605 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5606 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5607 | run_test "Renegotiation: periodic, above period, disabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5608 | "$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] | 5609 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 5610 | 0 \ |
| 5611 | -C "client hello, adding renegotiation extension" \ |
| 5612 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5613 | -S "found renegotiation extension" \ |
| 5614 | -s "server hello, secure renegotiation extension" \ |
| 5615 | -c "found renegotiation extension" \ |
| 5616 | -S "record counter limit reached: renegotiate" \ |
| 5617 | -C "=> renegotiate" \ |
| 5618 | -S "=> renegotiate" \ |
| 5619 | -S "write hello request" \ |
| 5620 | -S "SSL - An unexpected message was received from our peer" \ |
| 5621 | -S "failed" |
| 5622 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5623 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5624 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5625 | "$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] | 5626 | "$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] | 5627 | 0 \ |
| 5628 | -c "client hello, adding renegotiation extension" \ |
| 5629 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5630 | -s "found renegotiation extension" \ |
| 5631 | -s "server hello, secure renegotiation extension" \ |
| 5632 | -c "found renegotiation extension" \ |
| 5633 | -c "=> renegotiate" \ |
| 5634 | -s "=> renegotiate" \ |
| 5635 | -S "write hello request" |
| 5636 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5637 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5638 | run_test "Renegotiation: nbio, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5639 | "$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] | 5640 | "$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] | 5641 | 0 \ |
| 5642 | -c "client hello, adding renegotiation extension" \ |
| 5643 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5644 | -s "found renegotiation extension" \ |
| 5645 | -s "server hello, secure renegotiation extension" \ |
| 5646 | -c "found renegotiation extension" \ |
| 5647 | -c "=> renegotiate" \ |
| 5648 | -s "=> renegotiate" \ |
| 5649 | -s "write hello request" |
| 5650 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5651 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5652 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5653 | run_test "Renegotiation: openssl server, client-initiated" \ |
Gilles Peskine | 56ee69d | 2024-09-06 13:52:14 +0200 | [diff] [blame] | 5654 | "$O_SRV -www $OPENSSL_S_SERVER_CLIENT_RENEGOTIATION -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5655 | "$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] | 5656 | 0 \ |
| 5657 | -c "client hello, adding renegotiation extension" \ |
| 5658 | -c "found renegotiation extension" \ |
| 5659 | -c "=> renegotiate" \ |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5660 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5661 | -C "error" \ |
| 5662 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5663 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5664 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5665 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5666 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5667 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5668 | "$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] | 5669 | "$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] | 5670 | 0 \ |
| 5671 | -c "client hello, adding renegotiation extension" \ |
| 5672 | -c "found renegotiation extension" \ |
| 5673 | -c "=> renegotiate" \ |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5674 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5675 | -C "error" \ |
| 5676 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5677 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5678 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5679 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5680 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5681 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5682 | "$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] | 5683 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5684 | 1 \ |
| 5685 | -c "client hello, adding renegotiation extension" \ |
| 5686 | -C "found renegotiation extension" \ |
| 5687 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5688 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5689 | -c "error" \ |
| 5690 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5691 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5692 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5693 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5694 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5695 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5696 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5697 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5698 | allow_legacy=0" \ |
| 5699 | 1 \ |
| 5700 | -c "client hello, adding renegotiation extension" \ |
| 5701 | -C "found renegotiation extension" \ |
| 5702 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5703 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5704 | -c "error" \ |
| 5705 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5706 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5707 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5708 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5710 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5711 | "$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] | 5712 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5713 | allow_legacy=1" \ |
| 5714 | 0 \ |
| 5715 | -c "client hello, adding renegotiation extension" \ |
| 5716 | -C "found renegotiation extension" \ |
| 5717 | -c "=> renegotiate" \ |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5718 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5719 | -C "error" \ |
| 5720 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5721 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5722 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5723 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 5724 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 5725 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 5726 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5727 | 0 \ |
| 5728 | -c "client hello, adding renegotiation extension" \ |
| 5729 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5730 | -s "found renegotiation extension" \ |
| 5731 | -s "server hello, secure renegotiation extension" \ |
| 5732 | -c "found renegotiation extension" \ |
| 5733 | -c "=> renegotiate" \ |
| 5734 | -s "=> renegotiate" \ |
| 5735 | -S "write hello request" |
| 5736 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5737 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5738 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5739 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 5740 | "$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] | 5741 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 5742 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5743 | 0 \ |
| 5744 | -c "client hello, adding renegotiation extension" \ |
| 5745 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5746 | -s "found renegotiation extension" \ |
| 5747 | -s "server hello, secure renegotiation extension" \ |
| 5748 | -c "found renegotiation extension" \ |
| 5749 | -c "=> renegotiate" \ |
| 5750 | -s "=> renegotiate" \ |
| 5751 | -s "write hello request" |
| 5752 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5753 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5754 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5755 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 5756 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 5757 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 5758 | 0 \ |
| 5759 | -c "client hello, adding renegotiation extension" \ |
| 5760 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5761 | -s "found renegotiation extension" \ |
| 5762 | -s "server hello, secure renegotiation extension" \ |
| 5763 | -s "record counter limit reached: renegotiate" \ |
| 5764 | -c "=> renegotiate" \ |
| 5765 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5766 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5767 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5768 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5769 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5770 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5771 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5772 | "$G_NEXT_SRV -u --mtu 4096" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5773 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5774 | 0 \ |
| 5775 | -c "client hello, adding renegotiation extension" \ |
| 5776 | -c "found renegotiation extension" \ |
| 5777 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5778 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5779 | -C "error" \ |
| 5780 | -s "Extra-header:" |
| 5781 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5782 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5783 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5784 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5785 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5786 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5787 | run_test "Renego ext: gnutls server strict, client default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5788 | "$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] | 5789 | "$P_CLI debug_level=3" \ |
| 5790 | 0 \ |
| 5791 | -c "found renegotiation extension" \ |
| 5792 | -C "error" \ |
| 5793 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5794 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5795 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5796 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5797 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5798 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5799 | "$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] | 5800 | "$P_CLI debug_level=3" \ |
| 5801 | 0 \ |
| 5802 | -C "found renegotiation extension" \ |
| 5803 | -C "error" \ |
| 5804 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5805 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5806 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5807 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5808 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5809 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5810 | "$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] | 5811 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 5812 | 1 \ |
| 5813 | -C "found renegotiation extension" \ |
| 5814 | -c "error" \ |
| 5815 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5816 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5817 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5818 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5819 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5820 | run_test "Renego ext: gnutls client strict, server default" \ |
| 5821 | "$P_SRV debug_level=3" \ |
Gilles Peskine | 01fde2c | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5822 | "$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] | 5823 | 0 \ |
| 5824 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5825 | -s "server hello, secure renegotiation extension" |
| 5826 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5827 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5828 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5829 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5830 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 5831 | "$P_SRV debug_level=3" \ |
Gilles Peskine | 01fde2c | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5832 | "$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] | 5833 | 0 \ |
| 5834 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5835 | -S "server hello, secure renegotiation extension" |
| 5836 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5837 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5838 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5839 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5840 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 5841 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Gilles Peskine | 01fde2c | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5842 | "$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] | 5843 | 1 \ |
| 5844 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5845 | -S "server hello, secure renegotiation extension" |
| 5846 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5847 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 5848 | |
| 5849 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5850 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5851 | run_test "DER format: no trailing bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5852 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der0.crt \ |
| 5853 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5854 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5855 | 0 \ |
| 5856 | -c "Handshake was completed" \ |
| 5857 | |
| 5858 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5859 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5860 | run_test "DER format: with a trailing zero byte" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5861 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der1a.crt \ |
| 5862 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5863 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5864 | 0 \ |
| 5865 | -c "Handshake was completed" \ |
| 5866 | |
| 5867 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5868 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5869 | run_test "DER format: with a trailing random byte" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5870 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der1b.crt \ |
| 5871 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5872 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5873 | 0 \ |
| 5874 | -c "Handshake was completed" \ |
| 5875 | |
| 5876 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5877 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5878 | run_test "DER format: with 2 trailing random bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5879 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der2.crt \ |
| 5880 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5881 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5882 | 0 \ |
| 5883 | -c "Handshake was completed" \ |
| 5884 | |
| 5885 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5886 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5887 | run_test "DER format: with 4 trailing random bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5888 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der4.crt \ |
| 5889 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5890 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5891 | 0 \ |
| 5892 | -c "Handshake was completed" \ |
| 5893 | |
| 5894 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5895 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5896 | run_test "DER format: with 8 trailing random bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5897 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der8.crt \ |
| 5898 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5899 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5900 | 0 \ |
| 5901 | -c "Handshake was completed" \ |
| 5902 | |
| 5903 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5905 | run_test "DER format: with 9 trailing random bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5906 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der9.crt \ |
| 5907 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5908 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5909 | 0 \ |
| 5910 | -c "Handshake was completed" \ |
| 5911 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5912 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 5913 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5914 | |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5915 | # 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] | 5916 | run_test "Authentication: server badcert, client required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5917 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5918 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5919 | "$P_CLI debug_level=3 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5920 | 1 \ |
| 5921 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5922 | -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] | 5923 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5924 | -c "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5925 | -c "X509 - Certificate verification failed" |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5926 | # MBEDTLS_X509_BADCERT_NOT_TRUSTED -> MBEDTLS_SSL_ALERT_MSG_UNKNOWN_CA |
| 5927 | # We don't check that the server receives the alert because it might |
| 5928 | # detect that its write end of the connection is closed and abort |
| 5929 | # before reading the alert message. |
| 5930 | |
| 5931 | run_test "Authentication: server badcert, client required (1.2)" \ |
| 5932 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5933 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 5934 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=required" \ |
| 5935 | 1 \ |
| 5936 | -c "x509_verify_cert() returned" \ |
| 5937 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5938 | -c "! mbedtls_ssl_handshake returned" \ |
| 5939 | -c "send alert level=2 message=48" \ |
| 5940 | -c "X509 - Certificate verification failed" |
| 5941 | # 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] | 5942 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5943 | run_test "Authentication: server badcert, client optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5944 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5945 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 58ab9ba | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 5946 | "$P_CLI force_version=tls13 debug_level=3 auth_mode=optional" \ |
| 5947 | 0 \ |
| 5948 | -c "x509_verify_cert() returned" \ |
| 5949 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5950 | -C "! mbedtls_ssl_handshake returned" \ |
| 5951 | -C "send alert level=2 message=48" \ |
| 5952 | -C "X509 - Certificate verification failed" |
| 5953 | |
| 5954 | run_test "Authentication: server badcert, client optional (1.2)" \ |
| 5955 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5956 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5957 | "$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] | 5958 | 0 \ |
| 5959 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5960 | -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] | 5961 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5962 | -C "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5963 | -C "X509 - Certificate verification failed" |
| 5964 | |
Manuel Pégourié-Gonnard | 946d14a | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 5965 | run_test "Authentication: server badcert, client none" \ |
| 5966 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5967 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 6901504 | 2024-08-14 10:44:02 +0200 | [diff] [blame] | 5968 | "$P_CLI debug_level=3 auth_mode=none" \ |
| 5969 | 0 \ |
| 5970 | -C "x509_verify_cert() returned" \ |
| 5971 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5972 | -C "! mbedtls_ssl_handshake returned" \ |
| 5973 | -C "send alert level=2 message=48" \ |
| 5974 | -C "X509 - Certificate verification failed" |
| 5975 | |
| 5976 | run_test "Authentication: server badcert, client none (1.2)" \ |
| 5977 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5978 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5979 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 946d14a | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 5980 | 0 \ |
| 5981 | -C "x509_verify_cert() returned" \ |
| 5982 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5983 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5984 | -C "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 946d14a | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 5985 | -C "X509 - Certificate verification failed" |
| 5986 | |
Manuel Pégourié-Gonnard | 18dd213 | 2024-08-14 10:34:53 +0200 | [diff] [blame] | 5987 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 5988 | "$P_SRV" \ |
| 5989 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5990 | 1 \ |
| 5991 | -c "x509_verify_cert() returned" \ |
| 5992 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5993 | -c "! Certificate verification flags"\ |
| 5994 | -c "! mbedtls_ssl_handshake returned" \ |
| 5995 | -c "SSL - No CA Chain is set, but required to operate" |
| 5996 | |
| 5997 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 5998 | run_test "Authentication: server goodcert, client required, no trusted CA (1.2)" \ |
| 5999 | "$P_SRV force_version=tls12" \ |
| 6000 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 6001 | 1 \ |
| 6002 | -c "x509_verify_cert() returned" \ |
| 6003 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6004 | -c "! Certificate verification flags"\ |
| 6005 | -c "! mbedtls_ssl_handshake returned" \ |
| 6006 | -c "SSL - No CA Chain is set, but required to operate" |
Manuel Pégourié-Gonnard | 58ab9ba | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 6007 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 6008 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 6009 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | 58ab9ba | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 6010 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 6011 | 0 \ |
| 6012 | -c "x509_verify_cert() returned" \ |
| 6013 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6014 | -c "! Certificate verification flags"\ |
| 6015 | -C "! mbedtls_ssl_handshake returned" \ |
| 6016 | -C "X509 - Certificate verification failed" \ |
| 6017 | -C "SSL - No CA Chain is set, but required to operate" |
| 6018 | |
| 6019 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 6020 | run_test "Authentication: server goodcert, client optional, no trusted CA (1.2)" \ |
| 6021 | "$P_SRV" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6022 | "$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] | 6023 | 0 \ |
| 6024 | -c "x509_verify_cert() returned" \ |
| 6025 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6026 | -c "! Certificate verification flags"\ |
| 6027 | -C "! mbedtls_ssl_handshake returned" \ |
| 6028 | -C "X509 - Certificate verification failed" \ |
| 6029 | -C "SSL - No CA Chain is set, but required to operate" |
| 6030 | |
Manuel Pégourié-Gonnard | 6901504 | 2024-08-14 10:44:02 +0200 | [diff] [blame] | 6031 | run_test "Authentication: server goodcert, client none, no trusted CA" \ |
| 6032 | "$P_SRV" \ |
| 6033 | "$P_CLI debug_level=3 auth_mode=none ca_file=none ca_path=none" \ |
| 6034 | 0 \ |
| 6035 | -C "x509_verify_cert() returned" \ |
| 6036 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6037 | -C "! Certificate verification flags"\ |
| 6038 | -C "! mbedtls_ssl_handshake returned" \ |
| 6039 | -C "X509 - Certificate verification failed" \ |
| 6040 | -C "SSL - No CA Chain is set, but required to operate" |
| 6041 | |
| 6042 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 6043 | run_test "Authentication: server goodcert, client none, no trusted CA (1.2)" \ |
| 6044 | "$P_SRV" \ |
| 6045 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=none ca_file=none ca_path=none" \ |
| 6046 | 0 \ |
| 6047 | -C "x509_verify_cert() returned" \ |
| 6048 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6049 | -C "! Certificate verification flags"\ |
| 6050 | -C "! mbedtls_ssl_handshake returned" \ |
| 6051 | -C "X509 - Certificate verification failed" \ |
| 6052 | -C "SSL - No CA Chain is set, but required to operate" |
Manuel Pégourié-Gonnard | a6397f0 | 2024-08-05 11:10:47 +0200 | [diff] [blame] | 6053 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 6054 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 6055 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 6056 | # the client informs the server about the supported curves - it does, though, in the |
| 6057 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 6058 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 6059 | # different means to have the server ignoring the client's supported curve list. |
| 6060 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 6061 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6062 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6063 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6064 | "$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] | 6065 | 1 \ |
| 6066 | -c "bad certificate (EC key curve)"\ |
| 6067 | -c "! Certificate verification flags"\ |
| 6068 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 6069 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 6070 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6071 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6072 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6073 | "$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] | 6074 | 1 \ |
| 6075 | -c "bad certificate (EC key curve)"\ |
| 6076 | -c "! Certificate verification flags"\ |
| 6077 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 6078 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6079 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6080 | run_test "Authentication: client SHA256, server required" \ |
| 6081 | "$P_SRV auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6082 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6083 | key_file=$DATA_FILES_PATH/server6.key \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6084 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 6085 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6086 | -c "Supported Signature Algorithm found: 04 " \ |
| 6087 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6088 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6089 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6090 | run_test "Authentication: client SHA384, server required" \ |
| 6091 | "$P_SRV auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6092 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6093 | key_file=$DATA_FILES_PATH/server6.key \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6094 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 6095 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6096 | -c "Supported Signature Algorithm found: 04 " \ |
| 6097 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6098 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6099 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 6100 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 6101 | "$P_CLI debug_level=3 crt_file=none \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6102 | key_file=$DATA_FILES_PATH/server5.key" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6103 | 1 \ |
| 6104 | -S "skip write certificate request" \ |
| 6105 | -C "skip parse certificate request" \ |
| 6106 | -c "got a certificate request" \ |
| 6107 | -c "= write certificate$" \ |
| 6108 | -C "skip write certificate$" \ |
| 6109 | -S "x509_verify_cert() returned" \ |
Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 6110 | -s "peer has no certificate" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6111 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6112 | -s "No client certification received from the client, but required by the authentication mode" |
| 6113 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6114 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6115 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6116 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6117 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6118 | 1 \ |
| 6119 | -S "skip write certificate request" \ |
| 6120 | -C "skip parse certificate request" \ |
| 6121 | -c "got a certificate request" \ |
| 6122 | -C "skip write certificate" \ |
| 6123 | -C "skip write certificate verify" \ |
| 6124 | -S "skip parse certificate verify" \ |
| 6125 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6126 | -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] | 6127 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 6128 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6129 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 6130 | # We don't check that the client receives the alert because it might |
| 6131 | # detect that its write end of the connection is closed and abort |
| 6132 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6133 | |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 6134 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6135 | "$P_SRV debug_level=3 auth_mode=required ca_file=$DATA_FILES_PATH/server5-selfsigned.crt" \ |
| 6136 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6137 | key_file=$DATA_FILES_PATH/server5.key" \ |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 6138 | 0 \ |
| 6139 | -S "skip write certificate request" \ |
| 6140 | -C "skip parse certificate request" \ |
| 6141 | -c "got a certificate request" \ |
| 6142 | -C "skip write certificate" \ |
| 6143 | -C "skip write certificate verify" \ |
| 6144 | -S "skip parse certificate verify" \ |
| 6145 | -S "x509_verify_cert() returned" \ |
| 6146 | -S "! The certificate is not correctly signed" \ |
| 6147 | -S "X509 - Certificate verification failed" |
| 6148 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6149 | run_test "Authentication: client cert not trusted, server required" \ |
| 6150 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6151 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6152 | key_file=$DATA_FILES_PATH/server5.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6153 | 1 \ |
| 6154 | -S "skip write certificate request" \ |
| 6155 | -C "skip parse certificate request" \ |
| 6156 | -c "got a certificate request" \ |
| 6157 | -C "skip write certificate" \ |
| 6158 | -C "skip write certificate verify" \ |
| 6159 | -S "skip parse certificate verify" \ |
| 6160 | -s "x509_verify_cert() returned" \ |
| 6161 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6162 | -s "! mbedtls_ssl_handshake returned" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6163 | -s "X509 - Certificate verification failed" |
| 6164 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6165 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6166 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6167 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6168 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6169 | 0 \ |
| 6170 | -S "skip write certificate request" \ |
| 6171 | -C "skip parse certificate request" \ |
| 6172 | -c "got a certificate request" \ |
| 6173 | -C "skip write certificate" \ |
| 6174 | -C "skip write certificate verify" \ |
| 6175 | -S "skip parse certificate verify" \ |
| 6176 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6177 | -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] | 6178 | -S "! mbedtls_ssl_handshake returned" \ |
| 6179 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6180 | -S "X509 - Certificate verification failed" |
| 6181 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6182 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6183 | "$P_SRV debug_level=3 auth_mode=none" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6184 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6185 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6186 | 0 \ |
| 6187 | -s "skip write certificate request" \ |
| 6188 | -C "skip parse certificate request" \ |
| 6189 | -c "got no certificate request" \ |
| 6190 | -c "skip write certificate" \ |
| 6191 | -c "skip write certificate verify" \ |
| 6192 | -s "skip parse certificate verify" \ |
| 6193 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6194 | -S "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6195 | -S "! mbedtls_ssl_handshake returned" \ |
| 6196 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6197 | -S "X509 - Certificate verification failed" |
| 6198 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6199 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6200 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 6201 | "$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] | 6202 | 0 \ |
| 6203 | -S "skip write certificate request" \ |
| 6204 | -C "skip parse certificate request" \ |
| 6205 | -c "got a certificate request" \ |
| 6206 | -C "skip write certificate$" \ |
| 6207 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6208 | -c "skip write certificate verify" \ |
| 6209 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6210 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6211 | -S "! mbedtls_ssl_handshake returned" \ |
| 6212 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6213 | -S "X509 - Certificate verification failed" |
| 6214 | |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 6215 | requires_openssl_tls1_3_with_compatible_ephemeral |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6216 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6217 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6218 | "$O_NEXT_CLI_NO_CERT -no_middlebox" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6219 | 0 \ |
| 6220 | -S "skip write certificate request" \ |
| 6221 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6222 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6223 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6224 | -S "X509 - Certificate verification failed" |
| 6225 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6226 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6227 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6228 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6229 | "$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] | 6230 | 0 \ |
| 6231 | -C "skip parse certificate request" \ |
| 6232 | -c "got a certificate request" \ |
| 6233 | -C "skip write certificate$" \ |
| 6234 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6235 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6236 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6237 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6238 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6239 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6240 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 6241 | 1 \ |
| 6242 | -C "skip parse certificate request" \ |
| 6243 | -c "got a certificate request" \ |
| 6244 | -C "skip write certificate$" \ |
| 6245 | -c "skip write certificate verify" \ |
| 6246 | -c "! mbedtls_ssl_handshake returned" |
| 6247 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 6248 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 6249 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 6250 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 6251 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 6252 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 6253 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 6254 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 6255 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 6256 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 6257 | # 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] | 6258 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6259 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6260 | run_test "Authentication: server max_int chain, client default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6261 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6262 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
| 6263 | "$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] | 6264 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6265 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6266 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6267 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6268 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6269 | run_test "Authentication: server max_int+1 chain, client default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6270 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6271 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6272 | "$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] | 6273 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6274 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6275 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6276 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6277 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6278 | run_test "Authentication: server max_int+1 chain, client optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6279 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6280 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 58ab9ba | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 6281 | "$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] | 6282 | auth_mode=optional" \ |
| 6283 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6284 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6285 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6286 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6287 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6288 | run_test "Authentication: server max_int+1 chain, client none" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6289 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6290 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6291 | "$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] | 6292 | auth_mode=none" \ |
| 6293 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6294 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6295 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6296 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6297 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6298 | run_test "Authentication: client max_int+1 chain, server default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6299 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt" \ |
| 6300 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6301 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6302 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6303 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6304 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6305 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6306 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6307 | run_test "Authentication: client max_int+1 chain, server optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6308 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=optional" \ |
| 6309 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6310 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6311 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6312 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6313 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6314 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6315 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6316 | run_test "Authentication: client max_int+1 chain, server required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6317 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
| 6318 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6319 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6320 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6321 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6322 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6323 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6324 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6325 | run_test "Authentication: client max_int chain, server required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6326 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
| 6327 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6328 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6329 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6330 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6331 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6332 | # Tests for CA list in CertificateRequest messages |
| 6333 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6334 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6335 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 6336 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6337 | "$P_CLI force_version=tls12 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6338 | key_file=$DATA_FILES_PATH/server6.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6339 | 0 \ |
| 6340 | -s "requested DN" |
| 6341 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6342 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6343 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 6344 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6345 | "$P_CLI force_version=tls12 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6346 | key_file=$DATA_FILES_PATH/server6.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6347 | 0 \ |
| 6348 | -S "requested DN" |
| 6349 | |
| 6350 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6351 | "$P_SRV force_version=tls12 debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6352 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6353 | key_file=$DATA_FILES_PATH/server5.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6354 | 1 \ |
| 6355 | -S "requested DN" \ |
| 6356 | -s "x509_verify_cert() returned" \ |
| 6357 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6358 | -s "! mbedtls_ssl_handshake returned" \ |
| 6359 | -c "! mbedtls_ssl_handshake returned" \ |
| 6360 | -s "X509 - Certificate verification failed" |
| 6361 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6362 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6363 | run_test "Authentication: send alt conf DN hints in CertificateRequest" \ |
| 6364 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6365 | crt_file2=$DATA_FILES_PATH/server1.crt \ |
| 6366 | key_file2=$DATA_FILES_PATH/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6367 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6368 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6369 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6370 | 0 \ |
| 6371 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 6372 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6373 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6374 | run_test "Authentication: send alt conf DN hints in CertificateRequest (2)" \ |
| 6375 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6376 | crt_file2=$DATA_FILES_PATH/server2.crt \ |
| 6377 | key_file2=$DATA_FILES_PATH/server2.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6378 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6379 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6380 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6381 | 0 \ |
| 6382 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" |
| 6383 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6384 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6385 | run_test "Authentication: send alt hs DN hints in CertificateRequest" \ |
| 6386 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6387 | crt_file2=$DATA_FILES_PATH/server1.crt \ |
| 6388 | key_file2=$DATA_FILES_PATH/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6389 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6390 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6391 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6392 | 0 \ |
| 6393 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 6394 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 6395 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 6396 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6397 | |
| 6398 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6399 | run_test "Authentication, CA callback: server badcert, client required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6400 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6401 | key_file=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6402 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6403 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6404 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6405 | -c "x509_verify_cert() returned" \ |
| 6406 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6407 | -c "! mbedtls_ssl_handshake returned" \ |
| 6408 | -c "X509 - Certificate verification failed" |
| 6409 | |
| 6410 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6411 | run_test "Authentication, CA callback: server badcert, client optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6412 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6413 | key_file=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6414 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6415 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6416 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6417 | -c "x509_verify_cert() returned" \ |
| 6418 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6419 | -C "! mbedtls_ssl_handshake returned" \ |
| 6420 | -C "X509 - Certificate verification failed" |
| 6421 | |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6422 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6423 | run_test "Authentication, CA callback: server badcert, client none" \ |
| 6424 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6425 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 6426 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=none" \ |
| 6427 | 0 \ |
| 6428 | -C "use CA callback for X.509 CRT verification" \ |
| 6429 | -C "x509_verify_cert() returned" \ |
| 6430 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6431 | -C "! mbedtls_ssl_handshake returned" \ |
| 6432 | -C "X509 - Certificate verification failed" |
| 6433 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6434 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 6435 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 6436 | # the client informs the server about the supported curves - it does, though, in the |
| 6437 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 6438 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 6439 | # different means to have the server ignoring the client's supported curve list. |
| 6440 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6441 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6442 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6443 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6444 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6445 | "$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] | 6446 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6447 | -c "use CA callback for X.509 CRT verification" \ |
| 6448 | -c "bad certificate (EC key curve)" \ |
| 6449 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6450 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 6451 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6452 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6453 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6454 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6455 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6456 | "$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] | 6457 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6458 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6459 | -c "bad certificate (EC key curve)"\ |
| 6460 | -c "! Certificate verification flags"\ |
| 6461 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 6462 | |
| 6463 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6464 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 7a442c9 | 2024-04-03 08:57:09 +0200 | [diff] [blame] | 6465 | run_test "Authentication, CA callback: client SHA384, server required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6466 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6467 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6468 | key_file=$DATA_FILES_PATH/server6.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6469 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 6470 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6471 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6472 | -c "Supported Signature Algorithm found: 04 " \ |
| 6473 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6474 | |
| 6475 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6476 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 7a442c9 | 2024-04-03 08:57:09 +0200 | [diff] [blame] | 6477 | run_test "Authentication, CA callback: client SHA256, server required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6478 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6479 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6480 | key_file=$DATA_FILES_PATH/server6.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6481 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 6482 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6483 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6484 | -c "Supported Signature Algorithm found: 04 " \ |
| 6485 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6486 | |
| 6487 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6488 | run_test "Authentication, CA callback: client badcert, server required" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6489 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6490 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6491 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6492 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6493 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6494 | -S "skip write certificate request" \ |
| 6495 | -C "skip parse certificate request" \ |
| 6496 | -c "got a certificate request" \ |
| 6497 | -C "skip write certificate" \ |
| 6498 | -C "skip write certificate verify" \ |
| 6499 | -S "skip parse certificate verify" \ |
| 6500 | -s "x509_verify_cert() returned" \ |
| 6501 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6502 | -s "! mbedtls_ssl_handshake returned" \ |
| 6503 | -s "send alert level=2 message=48" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6504 | -s "X509 - Certificate verification failed" |
| 6505 | # We don't check that the client receives the alert because it might |
| 6506 | # detect that its write end of the connection is closed and abort |
| 6507 | # before reading the alert message. |
| 6508 | |
| 6509 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6510 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6511 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6512 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6513 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6514 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6515 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6516 | -S "skip write certificate request" \ |
| 6517 | -C "skip parse certificate request" \ |
| 6518 | -c "got a certificate request" \ |
| 6519 | -C "skip write certificate" \ |
| 6520 | -C "skip write certificate verify" \ |
| 6521 | -S "skip parse certificate verify" \ |
| 6522 | -s "x509_verify_cert() returned" \ |
| 6523 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6524 | -s "! mbedtls_ssl_handshake returned" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6525 | -s "X509 - Certificate verification failed" |
| 6526 | |
| 6527 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6528 | run_test "Authentication, CA callback: client badcert, server optional" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6529 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6530 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6531 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6532 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6533 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6534 | -S "skip write certificate request" \ |
| 6535 | -C "skip parse certificate request" \ |
| 6536 | -c "got a certificate request" \ |
| 6537 | -C "skip write certificate" \ |
| 6538 | -C "skip write certificate verify" \ |
| 6539 | -S "skip parse certificate verify" \ |
| 6540 | -s "x509_verify_cert() returned" \ |
| 6541 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6542 | -S "! mbedtls_ssl_handshake returned" \ |
| 6543 | -C "! mbedtls_ssl_handshake returned" \ |
| 6544 | -S "X509 - Certificate verification failed" |
| 6545 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6546 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6547 | requires_full_size_output_buffer |
| 6548 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6549 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6550 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6551 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6552 | "$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] | 6553 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6554 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6555 | -C "X509 - A fatal error occurred" |
| 6556 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6557 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6558 | requires_full_size_output_buffer |
| 6559 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6560 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6561 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6562 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6563 | "$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] | 6564 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6565 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6566 | -c "X509 - A fatal error occurred" |
| 6567 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6568 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6569 | requires_full_size_output_buffer |
| 6570 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6571 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6572 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6573 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6574 | "$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] | 6575 | debug_level=3 auth_mode=optional" \ |
| 6576 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6577 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6578 | -c "X509 - A fatal error occurred" |
| 6579 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6580 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6581 | requires_full_size_output_buffer |
| 6582 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6583 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6584 | "$P_SRV ca_callback=1 debug_level=3 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6585 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6586 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6587 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6588 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6589 | -s "X509 - A fatal error occurred" |
| 6590 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6591 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6592 | requires_full_size_output_buffer |
| 6593 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6594 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6595 | "$P_SRV ca_callback=1 debug_level=3 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6596 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6597 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6598 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6599 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6600 | -s "X509 - A fatal error occurred" |
| 6601 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6602 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6603 | requires_full_size_output_buffer |
| 6604 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6605 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6606 | "$P_SRV ca_callback=1 debug_level=3 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6607 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6608 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6609 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6610 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6611 | -S "X509 - A fatal error occurred" |
| 6612 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 6613 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6614 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6615 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6616 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6617 | "$P_SRV force_version=tls12 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 6618 | key_file=$DATA_FILES_PATH/server5.key \ |
| 6619 | crt_file2=$DATA_FILES_PATH/server5-sha1.crt \ |
| 6620 | key_file2=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6621 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6622 | 0 \ |
| 6623 | -c "signed using.*ECDSA with SHA256" \ |
| 6624 | -C "signed using.*ECDSA with SHA1" |
| 6625 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6626 | # tests for SNI |
| 6627 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6628 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6629 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6630 | "$P_SRV debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6631 | 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] | 6632 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6633 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6634 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6635 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6636 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6637 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6638 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6639 | "$P_SRV debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6640 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6641 | 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] | 6642 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6643 | 0 \ |
| 6644 | -s "parse ServerName extension" \ |
| 6645 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6646 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6647 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6648 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6649 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6650 | "$P_SRV debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6651 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6652 | 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] | 6653 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6654 | 0 \ |
| 6655 | -s "parse ServerName extension" \ |
| 6656 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6657 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6658 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6659 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6660 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6661 | "$P_SRV debug_level=3 \ |
David Horstmann | 184c4f0 | 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 | 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] | 6664 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6665 | 1 \ |
| 6666 | -s "parse ServerName extension" \ |
| 6667 | -s "ssl_sni_wrapper() returned" \ |
| 6668 | -s "mbedtls_ssl_handshake returned" \ |
| 6669 | -c "mbedtls_ssl_handshake returned" \ |
| 6670 | -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] | 6671 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6672 | run_test "SNI: client auth no override: optional" \ |
| 6673 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6674 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6675 | 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] | 6676 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6677 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6678 | -S "skip write certificate request" \ |
| 6679 | -C "skip parse certificate request" \ |
| 6680 | -c "got a certificate request" \ |
| 6681 | -C "skip write certificate" \ |
| 6682 | -C "skip write certificate verify" \ |
| 6683 | -S "skip parse certificate verify" |
| 6684 | |
| 6685 | run_test "SNI: client auth override: none -> optional" \ |
| 6686 | "$P_SRV debug_level=3 auth_mode=none \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6687 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6688 | 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] | 6689 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6690 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6691 | -S "skip write certificate request" \ |
| 6692 | -C "skip parse certificate request" \ |
| 6693 | -c "got a certificate request" \ |
| 6694 | -C "skip write certificate" \ |
| 6695 | -C "skip write certificate verify" \ |
| 6696 | -S "skip parse certificate verify" |
| 6697 | |
| 6698 | run_test "SNI: client auth override: optional -> none" \ |
| 6699 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6700 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6701 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,none" \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6702 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6703 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6704 | -s "skip write certificate request" \ |
| 6705 | -C "skip parse certificate request" \ |
| 6706 | -c "got no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 6707 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6708 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6709 | run_test "SNI: CA no override" \ |
| 6710 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6711 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6712 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6713 | 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] | 6714 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6715 | 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] | 6716 | 1 \ |
| 6717 | -S "skip write certificate request" \ |
| 6718 | -C "skip parse certificate request" \ |
| 6719 | -c "got a certificate request" \ |
| 6720 | -C "skip write certificate" \ |
| 6721 | -C "skip write certificate verify" \ |
| 6722 | -S "skip parse certificate verify" \ |
| 6723 | -s "x509_verify_cert() returned" \ |
| 6724 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6725 | -S "The certificate has been revoked (is on a CRL)" |
| 6726 | |
| 6727 | run_test "SNI: CA override" \ |
| 6728 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6729 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6730 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6731 | 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] | 6732 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6733 | 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] | 6734 | 0 \ |
| 6735 | -S "skip write certificate request" \ |
| 6736 | -C "skip parse certificate request" \ |
| 6737 | -c "got a certificate request" \ |
| 6738 | -C "skip write certificate" \ |
| 6739 | -C "skip write certificate verify" \ |
| 6740 | -S "skip parse certificate verify" \ |
| 6741 | -S "x509_verify_cert() returned" \ |
| 6742 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6743 | -S "The certificate has been revoked (is on a CRL)" |
| 6744 | |
| 6745 | run_test "SNI: CA override with CRL" \ |
| 6746 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6747 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6748 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6749 | 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] | 6750 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6751 | 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] | 6752 | 1 \ |
| 6753 | -S "skip write certificate request" \ |
| 6754 | -C "skip parse certificate request" \ |
| 6755 | -c "got a certificate request" \ |
| 6756 | -C "skip write certificate" \ |
| 6757 | -C "skip write certificate verify" \ |
| 6758 | -S "skip parse certificate verify" \ |
| 6759 | -s "x509_verify_cert() returned" \ |
| 6760 | -S "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2ffa53a | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6761 | -s "send alert level=2 message=44" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6762 | -s "The certificate has been revoked (is on a CRL)" |
Manuel Pégourié-Gonnard | 2ffa53a | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6763 | # MBEDTLS_X509_BADCERT_REVOKED -> MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6764 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6765 | # Tests for SNI and DTLS |
| 6766 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6767 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6768 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6769 | run_test "SNI: DTLS, no SNI callback" \ |
| 6770 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6771 | 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] | 6772 | "$P_CLI server_name=localhost dtls=1" \ |
| 6773 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6774 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6775 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6776 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6777 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6778 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6779 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6780 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6781 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6782 | 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] | 6783 | "$P_CLI server_name=localhost dtls=1" \ |
| 6784 | 0 \ |
| 6785 | -s "parse ServerName extension" \ |
| 6786 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6787 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6788 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6789 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6790 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6791 | run_test "SNI: DTLS, matching cert 2" \ |
| 6792 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6793 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6794 | 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] | 6795 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 6796 | 0 \ |
| 6797 | -s "parse ServerName extension" \ |
| 6798 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6799 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6800 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6801 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6802 | run_test "SNI: DTLS, no matching cert" \ |
| 6803 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6804 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6805 | 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] | 6806 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 6807 | 1 \ |
| 6808 | -s "parse ServerName extension" \ |
| 6809 | -s "ssl_sni_wrapper() returned" \ |
| 6810 | -s "mbedtls_ssl_handshake returned" \ |
| 6811 | -c "mbedtls_ssl_handshake returned" \ |
| 6812 | -c "SSL - A fatal alert message was received from our peer" |
| 6813 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6814 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6815 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 6816 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6817 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6818 | 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] | 6819 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6820 | 0 \ |
| 6821 | -S "skip write certificate request" \ |
| 6822 | -C "skip parse certificate request" \ |
| 6823 | -c "got a certificate request" \ |
| 6824 | -C "skip write certificate" \ |
| 6825 | -C "skip write certificate verify" \ |
| 6826 | -S "skip parse certificate verify" |
| 6827 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6828 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6829 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 6830 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6831 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6832 | 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] | 6833 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6834 | 0 \ |
| 6835 | -S "skip write certificate request" \ |
| 6836 | -C "skip parse certificate request" \ |
| 6837 | -c "got a certificate request" \ |
| 6838 | -C "skip write certificate" \ |
| 6839 | -C "skip write certificate verify" \ |
| 6840 | -S "skip parse certificate verify" |
| 6841 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6842 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6843 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 6844 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6845 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6846 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,none" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6847 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6848 | 0 \ |
| 6849 | -s "skip write certificate request" \ |
| 6850 | -C "skip parse certificate request" \ |
| 6851 | -c "got no certificate request" \ |
| 6852 | -c "skip write certificate" \ |
| 6853 | -c "skip write certificate verify" \ |
| 6854 | -s "skip parse certificate verify" |
| 6855 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6856 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6857 | run_test "SNI: DTLS, CA no override" \ |
| 6858 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6859 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6860 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6861 | 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] | 6862 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6863 | 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] | 6864 | 1 \ |
| 6865 | -S "skip write certificate request" \ |
| 6866 | -C "skip parse certificate request" \ |
| 6867 | -c "got a certificate request" \ |
| 6868 | -C "skip write certificate" \ |
| 6869 | -C "skip write certificate verify" \ |
| 6870 | -S "skip parse certificate verify" \ |
| 6871 | -s "x509_verify_cert() returned" \ |
| 6872 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6873 | -S "The certificate has been revoked (is on a CRL)" |
| 6874 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6875 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6876 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6877 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6878 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6879 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6880 | 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] | 6881 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6882 | 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] | 6883 | 0 \ |
| 6884 | -S "skip write certificate request" \ |
| 6885 | -C "skip parse certificate request" \ |
| 6886 | -c "got a certificate request" \ |
| 6887 | -C "skip write certificate" \ |
| 6888 | -C "skip write certificate verify" \ |
| 6889 | -S "skip parse certificate verify" \ |
| 6890 | -S "x509_verify_cert() returned" \ |
| 6891 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6892 | -S "The certificate has been revoked (is on a CRL)" |
| 6893 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6895 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6896 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6897 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key dtls=1 \ |
| 6898 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6899 | 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] | 6900 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6901 | 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] | 6902 | 1 \ |
| 6903 | -S "skip write certificate request" \ |
| 6904 | -C "skip parse certificate request" \ |
| 6905 | -c "got a certificate request" \ |
| 6906 | -C "skip write certificate" \ |
| 6907 | -C "skip write certificate verify" \ |
| 6908 | -S "skip parse certificate verify" \ |
| 6909 | -s "x509_verify_cert() returned" \ |
| 6910 | -S "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2ffa53a | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6911 | -s "send alert level=2 message=44" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6912 | -s "The certificate has been revoked (is on a CRL)" |
Manuel Pégourié-Gonnard | 2ffa53a | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6913 | # MBEDTLS_X509_BADCERT_REVOKED -> MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6914 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6915 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 6916 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6917 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6918 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6919 | "$P_CLI nbio=2 tickets=0" \ |
| 6920 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6921 | -S "mbedtls_ssl_handshake returned" \ |
| 6922 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6923 | -c "Read from server: .* bytes read" |
| 6924 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6925 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6926 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 6927 | "$P_CLI nbio=2 tickets=0" \ |
| 6928 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6929 | -S "mbedtls_ssl_handshake returned" \ |
| 6930 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6931 | -c "Read from server: .* bytes read" |
| 6932 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6933 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6934 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6935 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6936 | "$P_CLI nbio=2 tickets=1" \ |
| 6937 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6938 | -S "mbedtls_ssl_handshake returned" \ |
| 6939 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6940 | -c "Read from server: .* bytes read" |
| 6941 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6942 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6943 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6944 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6945 | "$P_CLI nbio=2 tickets=1" \ |
| 6946 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6947 | -S "mbedtls_ssl_handshake returned" \ |
| 6948 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6949 | -c "Read from server: .* bytes read" |
| 6950 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6951 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6952 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6953 | 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] | 6954 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6955 | "$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] | 6956 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6957 | -S "mbedtls_ssl_handshake returned" \ |
| 6958 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6959 | -c "Read from server: .* bytes read" |
| 6960 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6961 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6962 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6963 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6964 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6965 | run_test "Non-blocking I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 6966 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6967 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [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 | 4f1c927 | 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 "Non-blocking I/O: TLS 1.2 + ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6976 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6977 | "$P_CLI force_version=tls12 nbio=2 tickets=1 reconnect=1" \ |
| 6978 | 0 \ |
| 6979 | -S "mbedtls_ssl_handshake returned" \ |
| 6980 | -C "mbedtls_ssl_handshake returned" \ |
| 6981 | -c "Read from server: .* bytes read" |
| 6982 | |
| 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 | 4f1c927 | 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 "Non-blocking I/O: TLS 1.3 + ticket + resume" \ |
| 6988 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6989 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6990 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6991 | -S "mbedtls_ssl_handshake returned" \ |
| 6992 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 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 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6996 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6997 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6998 | "$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] | 6999 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7000 | -S "mbedtls_ssl_handshake returned" \ |
| 7001 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 7002 | -c "Read from server: .* bytes read" |
| 7003 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7004 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 7005 | |
| 7006 | run_test "Event-driven I/O: basic handshake" \ |
| 7007 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 7008 | "$P_CLI event=1 tickets=0" \ |
| 7009 | 0 \ |
| 7010 | -S "mbedtls_ssl_handshake returned" \ |
| 7011 | -C "mbedtls_ssl_handshake returned" \ |
| 7012 | -c "Read from server: .* bytes read" |
| 7013 | |
| 7014 | run_test "Event-driven I/O: client auth" \ |
| 7015 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 7016 | "$P_CLI event=1 tickets=0" \ |
| 7017 | 0 \ |
| 7018 | -S "mbedtls_ssl_handshake returned" \ |
| 7019 | -C "mbedtls_ssl_handshake returned" \ |
| 7020 | -c "Read from server: .* bytes read" |
| 7021 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7022 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7023 | run_test "Event-driven I/O: ticket" \ |
| 7024 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 7025 | "$P_CLI event=1 tickets=1" \ |
| 7026 | 0 \ |
| 7027 | -S "mbedtls_ssl_handshake returned" \ |
| 7028 | -C "mbedtls_ssl_handshake returned" \ |
| 7029 | -c "Read from server: .* bytes read" |
| 7030 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7031 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7032 | run_test "Event-driven I/O: ticket + client auth" \ |
| 7033 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 7034 | "$P_CLI event=1 tickets=1" \ |
| 7035 | 0 \ |
| 7036 | -S "mbedtls_ssl_handshake returned" \ |
| 7037 | -C "mbedtls_ssl_handshake returned" \ |
| 7038 | -c "Read from server: .* bytes read" |
| 7039 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7040 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7041 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7042 | 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] | 7043 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7044 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7045 | 0 \ |
| 7046 | -S "mbedtls_ssl_handshake returned" \ |
| 7047 | -C "mbedtls_ssl_handshake returned" \ |
| 7048 | -c "Read from server: .* bytes read" |
| 7049 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7050 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7051 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 7052 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7053 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7054 | run_test "Event-driven I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 7055 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 7056 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7057 | 0 \ |
| 7058 | -S "mbedtls_ssl_handshake returned" \ |
| 7059 | -C "mbedtls_ssl_handshake returned" \ |
| 7060 | -c "Read from server: .* bytes read" |
| 7061 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7062 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7063 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7064 | run_test "Event-driven I/O: TLS 1.2 + ticket + resume" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7065 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7066 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
| 7067 | 0 \ |
| 7068 | -S "mbedtls_ssl_handshake returned" \ |
| 7069 | -C "mbedtls_ssl_handshake returned" \ |
| 7070 | -c "Read from server: .* bytes read" |
| 7071 | |
| 7072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7073 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 7074 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7075 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7076 | run_test "Event-driven I/O: TLS 1.3 + ticket + resume" \ |
| 7077 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 7078 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7079 | 0 \ |
| 7080 | -S "mbedtls_ssl_handshake returned" \ |
| 7081 | -C "mbedtls_ssl_handshake returned" \ |
| 7082 | -c "Read from server: .* bytes read" |
| 7083 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7084 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7085 | run_test "Event-driven I/O: session-id resume" \ |
| 7086 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 7087 | "$P_CLI force_version=tls12 event=1 tickets=0 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7088 | 0 \ |
| 7089 | -S "mbedtls_ssl_handshake returned" \ |
| 7090 | -C "mbedtls_ssl_handshake returned" \ |
| 7091 | -c "Read from server: .* bytes read" |
| 7092 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7093 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7094 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 7095 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 7096 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 7097 | 0 \ |
| 7098 | -c "Read from server: .* bytes read" |
| 7099 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7100 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7101 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 7102 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 7103 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 7104 | 0 \ |
| 7105 | -c "Read from server: .* bytes read" |
| 7106 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7107 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7108 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7109 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 7110 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 7111 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 7112 | 0 \ |
| 7113 | -c "Read from server: .* bytes read" |
| 7114 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7115 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7116 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7117 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 7118 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 7119 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 7120 | 0 \ |
| 7121 | -c "Read from server: .* bytes read" |
| 7122 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7123 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7124 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7125 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 7126 | "$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] | 7127 | "$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] | 7128 | 0 \ |
| 7129 | -c "Read from server: .* bytes read" |
| 7130 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7131 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7132 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7133 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 7134 | "$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] | 7135 | "$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] | 7136 | 0 \ |
| 7137 | -c "Read from server: .* bytes read" |
| 7138 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7139 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7140 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 7141 | "$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] | 7142 | "$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] | 7143 | 0 \ |
| 7144 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7145 | |
| 7146 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 7147 | # During session resumption, the client will send its ApplicationData record |
| 7148 | # within the same datagram as the Finished messages. In this situation, the |
| 7149 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 7150 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7151 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7152 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7153 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7154 | "$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] | 7155 | "$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] | 7156 | 0 \ |
| 7157 | -c "Read from server: .* bytes read" |
| 7158 | |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7159 | # Tests for version negotiation. Some information to ease the understanding |
| 7160 | # of the version negotiation test titles below: |
| 7161 | # . 1.2/1.3 means that only TLS 1.2/TLS 1.3 is enabled. |
| 7162 | # . 1.2+1.3 means that both TLS 1.2 and TLS 1.3 are enabled. |
| 7163 | # . 1.2+(1.3)/(1.2)+1.3 means that TLS 1.2/1.3 is enabled and that |
| 7164 | # TLS 1.3/1.2 may be enabled or not. |
| 7165 | # . max=1.2 means that both TLS 1.2 and TLS 1.3 are enabled at build time but |
| 7166 | # TLS 1.3 is disabled at runtime (maximum negotiable version is TLS 1.2). |
| 7167 | # . min=1.3 means that both TLS 1.2 and TLS 1.3 are enabled at build time but |
| 7168 | # TLS 1.2 is disabled at runtime (minimum negotiable version is TLS 1.3). |
| 7169 | |
Ronald Cron | fe18d8d | 2024-03-06 15:19:55 +0100 | [diff] [blame] | 7170 | # Tests for version negotiation, MbedTLS client and server |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7171 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7172 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7173 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7174 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7175 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7176 | 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] | 7177 | "$P_SRV" \ |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7178 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7179 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7180 | -S "mbedtls_ssl_handshake returned" \ |
| 7181 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7182 | -s "Protocol is TLSv1.2" \ |
| 7183 | -c "Protocol is TLSv1.2" |
| 7184 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7185 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7186 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7187 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7188 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7189 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7190 | 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] | 7191 | "$P_SRV max_version=tls12" \ |
| 7192 | "$P_CLI max_version=tls12" \ |
| 7193 | 0 \ |
| 7194 | -S "mbedtls_ssl_handshake returned" \ |
| 7195 | -C "mbedtls_ssl_handshake returned" \ |
| 7196 | -s "Protocol is TLSv1.2" \ |
| 7197 | -c "Protocol is TLSv1.2" |
| 7198 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7199 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7200 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7201 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7202 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7203 | 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] | 7204 | "$P_SRV" \ |
| 7205 | "$P_CLI" \ |
| 7206 | 0 \ |
| 7207 | -S "mbedtls_ssl_handshake returned" \ |
| 7208 | -C "mbedtls_ssl_handshake returned" \ |
| 7209 | -s "Protocol is TLSv1.3" \ |
| 7210 | -c "Protocol is TLSv1.3" |
| 7211 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7212 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7213 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7214 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7215 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7216 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7217 | 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] | 7218 | "$P_SRV min_version=tls13" \ |
| 7219 | "$P_CLI min_version=tls13" \ |
| 7220 | 0 \ |
| 7221 | -S "mbedtls_ssl_handshake returned" \ |
| 7222 | -C "mbedtls_ssl_handshake returned" \ |
| 7223 | -s "Protocol is TLSv1.3" \ |
| 7224 | -c "Protocol is TLSv1.3" |
| 7225 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7226 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7227 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7228 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7229 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7230 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7231 | 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] | 7232 | "$P_SRV" \ |
| 7233 | "$P_CLI" \ |
| 7234 | 0 \ |
| 7235 | -S "mbedtls_ssl_handshake returned" \ |
| 7236 | -C "mbedtls_ssl_handshake returned" \ |
| 7237 | -s "Protocol is TLSv1.3" \ |
| 7238 | -c "Protocol is TLSv1.3" |
| 7239 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7240 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7241 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7242 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7243 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7244 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7245 | 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] | 7246 | "$P_SRV min_version=tls13" \ |
| 7247 | "$P_CLI" \ |
| 7248 | 0 \ |
| 7249 | -S "mbedtls_ssl_handshake returned" \ |
| 7250 | -C "mbedtls_ssl_handshake returned" \ |
| 7251 | -s "Protocol is TLSv1.3" \ |
| 7252 | -c "Protocol is TLSv1.3" |
| 7253 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7254 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7255 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7256 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7257 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7258 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7259 | 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] | 7260 | "$P_SRV max_version=tls12" \ |
| 7261 | "$P_CLI" \ |
| 7262 | 0 \ |
| 7263 | -S "mbedtls_ssl_handshake returned" \ |
| 7264 | -C "mbedtls_ssl_handshake returned" \ |
| 7265 | -s "Protocol is TLSv1.2" \ |
| 7266 | -c "Protocol is TLSv1.2" |
| 7267 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7268 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7269 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7270 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7271 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7272 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7273 | 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] | 7274 | "$P_SRV" \ |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7275 | "$P_CLI max_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7276 | 0 \ |
| 7277 | -S "mbedtls_ssl_handshake returned" \ |
| 7278 | -C "mbedtls_ssl_handshake returned" \ |
| 7279 | -s "Protocol is TLSv1.2" \ |
| 7280 | -c "Protocol is TLSv1.2" |
| 7281 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7282 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7283 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7284 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7285 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7286 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7287 | 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] | 7288 | "$P_SRV" \ |
| 7289 | "$P_CLI min_version=tls13" \ |
| 7290 | 0 \ |
| 7291 | -S "mbedtls_ssl_handshake returned" \ |
| 7292 | -C "mbedtls_ssl_handshake returned" \ |
| 7293 | -s "Protocol is TLSv1.3" \ |
| 7294 | -c "Protocol is TLSv1.3" |
| 7295 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7296 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7297 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7298 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7299 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7300 | 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] | 7301 | "$P_SRV min_version=tls13" \ |
| 7302 | "$P_CLI max_version=tls12" \ |
| 7303 | 1 \ |
| 7304 | -s "Handshake protocol not within min/max boundaries" \ |
| 7305 | -S "Protocol is TLSv1.2" \ |
| 7306 | -C "Protocol is TLSv1.2" \ |
| 7307 | -S "Protocol is TLSv1.3" \ |
| 7308 | -C "Protocol is TLSv1.3" |
Ronald Cron | fe18d8d | 2024-03-06 15:19:55 +0100 | [diff] [blame] | 7309 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7310 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7311 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7312 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7313 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7314 | 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] | 7315 | "$P_SRV max_version=tls12" \ |
| 7316 | "$P_CLI min_version=tls13" \ |
| 7317 | 1 \ |
| 7318 | -s "The handshake negotiation failed" \ |
| 7319 | -S "Protocol is TLSv1.2" \ |
| 7320 | -C "Protocol is TLSv1.2" \ |
| 7321 | -S "Protocol is TLSv1.3" \ |
| 7322 | -C "Protocol is TLSv1.3" |
| 7323 | |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7324 | # Tests of version negotiation on server side against GnuTLS client |
| 7325 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7326 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7327 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7328 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7329 | 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] | 7330 | "$P_SRV" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7331 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7332 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7333 | -S "mbedtls_ssl_handshake returned" \ |
| 7334 | -s "Protocol is TLSv1.2" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7335 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7336 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7337 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7338 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 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, srv 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_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7343 | 0 \ |
| 7344 | -S "mbedtls_ssl_handshake returned" \ |
| 7345 | -s "Protocol is TLSv1.2" |
| 7346 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7347 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7348 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7349 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7350 | 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] | 7351 | "$P_SRV" \ |
| 7352 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7353 | 0 \ |
| 7354 | -S "mbedtls_ssl_handshake returned" \ |
| 7355 | -s "Protocol is TLSv1.3" |
| 7356 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7357 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7358 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7359 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7360 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7361 | 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] | 7362 | "$P_SRV min_version=tls13" \ |
| 7363 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7364 | 0 \ |
| 7365 | -S "mbedtls_ssl_handshake returned" \ |
| 7366 | -s "Protocol is TLSv1.3" |
| 7367 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7368 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7369 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7370 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7371 | 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] | 7372 | "$P_SRV" \ |
| 7373 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7374 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7375 | -S "mbedtls_ssl_handshake returned" \ |
| 7376 | -s "Protocol is TLSv1.3" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7377 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7378 | requires_gnutls_next_disable_tls13_compat |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7379 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7380 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7381 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7382 | 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] | 7383 | "$P_SRV" \ |
| 7384 | "$G_NEXT_CLI localhost --priority=NORMAL:%DISABLE_TLS13_COMPAT_MODE" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7385 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7386 | -S "mbedtls_ssl_handshake returned" \ |
| 7387 | -s "Protocol is TLSv1.3" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7388 | |
| 7389 | # GnuTLS can be setup to send a ClientHello containing a supported versions |
| 7390 | # extension proposing TLS 1.2 (preferred) and then TLS 1.3. In that case, |
| 7391 | # a TLS 1.3 and TLS 1.2 capable server is supposed to negotiate TLS 1.2 and |
| 7392 | # to indicate in the ServerHello that it downgrades from TLS 1.3. The GnuTLS |
| 7393 | # client then detects the downgrade indication and aborts the handshake even |
| 7394 | # if TLS 1.2 was its preferred version. Keeping the test even if the |
| 7395 | # handshake fails eventually as it exercices parts of the Mbed TLS |
| 7396 | # implementation that are otherwise not exercised. |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7397 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7398 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7399 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7400 | 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] | 7401 | "$P_SRV" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7402 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3" \ |
| 7403 | 1 \ |
| 7404 | -c "Detected downgrade to TLS 1.2 from TLS 1.3" |
| 7405 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7406 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7407 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7408 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7409 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7410 | 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] | 7411 | "$P_SRV min_version=tls13" \ |
| 7412 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7413 | 0 \ |
| 7414 | -S "mbedtls_ssl_handshake returned" \ |
| 7415 | -s "Protocol is TLSv1.3" |
| 7416 | |
| 7417 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7418 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7419 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7420 | 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] | 7421 | "$P_SRV" \ |
| 7422 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7423 | 0 \ |
| 7424 | -S "mbedtls_ssl_handshake returned" \ |
| 7425 | -s "Protocol is TLSv1.2" |
| 7426 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7427 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7428 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7429 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7430 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7431 | 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] | 7432 | "$P_SRV max_version=tls12" \ |
| 7433 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7434 | 0 \ |
| 7435 | -S "mbedtls_ssl_handshake returned" \ |
| 7436 | -s "Protocol is TLSv1.2" |
| 7437 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7438 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7439 | 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] | 7440 | "$P_SRV" \ |
| 7441 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 7442 | 1 \ |
| 7443 | -s "Handshake protocol not within min/max boundaries" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7444 | -S "Protocol is TLSv1.0" |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7445 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7446 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7447 | 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] | 7448 | "$P_SRV" \ |
| 7449 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 7450 | 1 \ |
| 7451 | -s "Handshake protocol not within min/max boundaries" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7452 | -S "Protocol is TLSv1.1" |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7453 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7454 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7455 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7456 | 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] | 7457 | "$P_SRV" \ |
| 7458 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7459 | 1 \ |
| 7460 | -s "Handshake protocol not within min/max boundaries" \ |
| 7461 | -S "Protocol is TLSv1.2" |
| 7462 | |
| 7463 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7464 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7465 | 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] | 7466 | "$P_SRV" \ |
| 7467 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7468 | 1 \ |
| 7469 | -S "Handshake protocol not within min/max boundaries" \ |
| 7470 | -s "The handshake negotiation failed" \ |
| 7471 | -S "Protocol is TLSv1.3" |
| 7472 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7473 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7474 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7475 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7476 | 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] | 7477 | "$P_SRV min_version=tls13" \ |
| 7478 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7479 | 1 \ |
| 7480 | -s "Handshake protocol not within min/max boundaries" \ |
| 7481 | -S "Protocol is TLSv1.2" |
| 7482 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7483 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7485 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7486 | 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] | 7487 | "$P_SRV max_version=tls12" \ |
| 7488 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7489 | 1 \ |
| 7490 | -S "Handshake protocol not within min/max boundaries" \ |
| 7491 | -s "The handshake negotiation failed" \ |
| 7492 | -S "Protocol is TLSv1.3" |
| 7493 | |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7494 | # Tests of version negotiation on server side against OpenSSL client |
| 7495 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7496 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7497 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7498 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7499 | 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] | 7500 | "$P_SRV" \ |
| 7501 | "$O_NEXT_CLI -tls1_2" \ |
| 7502 | 0 \ |
| 7503 | -S "mbedtls_ssl_handshake returned" \ |
| 7504 | -s "Protocol is TLSv1.2" |
| 7505 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7506 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7507 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7508 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7509 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7510 | 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] | 7511 | "$P_SRV max_version=tls12" \ |
| 7512 | "$O_NEXT_CLI -tls1_2" \ |
| 7513 | 0 \ |
| 7514 | -S "mbedtls_ssl_handshake returned" \ |
| 7515 | -s "Protocol is TLSv1.2" |
| 7516 | |
| 7517 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7518 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7519 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7520 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7521 | 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] | 7522 | "$P_SRV" \ |
| 7523 | "$O_NEXT_CLI -tls1_3" \ |
| 7524 | 0 \ |
| 7525 | -S "mbedtls_ssl_handshake returned" \ |
| 7526 | -s "Protocol is TLSv1.3" |
| 7527 | |
| 7528 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7529 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7530 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7531 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7532 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7533 | 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] | 7534 | "$P_SRV min_version=tls13" \ |
| 7535 | "$O_NEXT_CLI -tls1_3" \ |
| 7536 | 0 \ |
| 7537 | -S "mbedtls_ssl_handshake returned" \ |
| 7538 | -s "Protocol is TLSv1.3" |
| 7539 | |
| 7540 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7541 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7542 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7543 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7544 | 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] | 7545 | "$P_SRV" \ |
| 7546 | "$O_NEXT_CLI" \ |
| 7547 | 0 \ |
| 7548 | -S "mbedtls_ssl_handshake returned" \ |
| 7549 | -s "Protocol is TLSv1.3" |
| 7550 | |
| 7551 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7552 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7553 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7554 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7555 | 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] | 7556 | "$P_SRV" \ |
| 7557 | "$O_NEXT_CLI -no_middlebox" \ |
| 7558 | 0 \ |
| 7559 | -S "mbedtls_ssl_handshake returned" \ |
| 7560 | -s "Protocol is TLSv1.3" |
| 7561 | |
| 7562 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7563 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7565 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7566 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7567 | 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] | 7568 | "$P_SRV min_version=tls13" \ |
| 7569 | "$O_NEXT_CLI" \ |
| 7570 | 0 \ |
| 7571 | -S "mbedtls_ssl_handshake returned" \ |
| 7572 | -s "Protocol is TLSv1.3" |
| 7573 | |
| 7574 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7575 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7576 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7577 | 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] | 7578 | "$P_SRV" \ |
| 7579 | "$O_NEXT_CLI" \ |
| 7580 | 0 \ |
| 7581 | -S "mbedtls_ssl_handshake returned" \ |
| 7582 | -s "Protocol is TLSv1.2" |
| 7583 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7584 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7585 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7586 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7587 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7588 | 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] | 7589 | "$P_SRV max_version=tls12" \ |
| 7590 | "$O_NEXT_CLI" \ |
| 7591 | 0 \ |
| 7592 | -S "mbedtls_ssl_handshake returned" \ |
| 7593 | -s "Protocol is TLSv1.2" |
| 7594 | |
| 7595 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7596 | 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] | 7597 | "$P_SRV" \ |
| 7598 | "$O_CLI -tls1" \ |
| 7599 | 1 \ |
| 7600 | -s "Handshake protocol not within min/max boundaries" \ |
| 7601 | -S "Protocol is TLSv1.0" |
| 7602 | |
| 7603 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7604 | 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] | 7605 | "$P_SRV" \ |
| 7606 | "$O_CLI -tls1_1" \ |
| 7607 | 1 \ |
| 7608 | -s "Handshake protocol not within min/max boundaries" \ |
| 7609 | -S "Protocol is TLSv1.1" |
| 7610 | |
| 7611 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7612 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7613 | 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] | 7614 | "$P_SRV" \ |
| 7615 | "$O_NEXT_CLI -tls1_2" \ |
| 7616 | 1 \ |
| 7617 | -s "Handshake protocol not within min/max boundaries" \ |
| 7618 | -S "Protocol is TLSv1.2" |
| 7619 | |
| 7620 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7621 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7622 | 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] | 7623 | "$P_SRV" \ |
| 7624 | "$O_NEXT_CLI -tls1_3" \ |
| 7625 | 1 \ |
| 7626 | -S "Handshake protocol not within min/max boundaries" \ |
| 7627 | -s "The handshake negotiation failed" \ |
| 7628 | -S "Protocol is TLSv1.3" |
| 7629 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7630 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7631 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7632 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7633 | 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] | 7634 | "$P_SRV min_version=tls13" \ |
| 7635 | "$O_NEXT_CLI -tls1_2" \ |
| 7636 | 1 \ |
| 7637 | -s "Handshake protocol not within min/max boundaries" \ |
| 7638 | -S "Protocol is TLSv1.2" |
| 7639 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7640 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7641 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7643 | 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] | 7644 | "$P_SRV max_version=tls12" \ |
| 7645 | "$O_NEXT_CLI -tls1_3" \ |
| 7646 | 1 \ |
| 7647 | -S "Handshake protocol not within min/max boundaries" \ |
| 7648 | -s "The handshake negotiation failed" \ |
| 7649 | -S "Protocol is TLSv1.3" |
| 7650 | |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7651 | # Tests of version negotiation on client side against GnuTLS and OpenSSL server |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7652 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7653 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7654 | run_test "Not supported version: srv max TLS 1.0" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7655 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 7656 | "$P_CLI" \ |
| 7657 | 1 \ |
| 7658 | -s "Error in protocol version" \ |
| 7659 | -c "Handshake protocol not within min/max boundaries" \ |
| 7660 | -S "Version: TLS1.0" \ |
| 7661 | -C "Protocol is TLSv1.0" |
| 7662 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7663 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7664 | run_test "Not supported version: srv max TLS 1.1" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7665 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 7666 | "$P_CLI" \ |
| 7667 | 1 \ |
| 7668 | -s "Error in protocol version" \ |
| 7669 | -c "Handshake protocol not within min/max boundaries" \ |
| 7670 | -S "Version: TLS1.1" \ |
| 7671 | -C "Protocol is TLSv1.1" |
| 7672 | |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7673 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7674 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7675 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7676 | skip_handshake_stage_check |
| 7677 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7678 | 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] | 7679 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \ |
| 7680 | "$P_CLI debug_level=4" \ |
| 7681 | 1 \ |
| 7682 | -s "Client's version: 3.3" \ |
| 7683 | -S "Version: TLS1.0" \ |
| 7684 | -C "Protocol is TLSv1.0" |
| 7685 | |
| 7686 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7687 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7688 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7689 | skip_handshake_stage_check |
| 7690 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7691 | 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] | 7692 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \ |
| 7693 | "$P_CLI debug_level=4" \ |
| 7694 | 1 \ |
| 7695 | -s "Client's version: 3.3" \ |
| 7696 | -S "Version: TLS1.1" \ |
| 7697 | -C "Protocol is TLSv1.1" |
| 7698 | |
| 7699 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7700 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7701 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7702 | skip_handshake_stage_check |
| 7703 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7704 | 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] | 7705 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \ |
| 7706 | "$P_CLI force_version=tls13 debug_level=4" \ |
| 7707 | 1 \ |
| 7708 | -s "Client's version: 3.3" \ |
| 7709 | -c "is a fatal alert message (msg 40)" \ |
| 7710 | -S "Version: TLS1.2" \ |
| 7711 | -C "Protocol is TLSv1.2" |
| 7712 | |
| 7713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7714 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7715 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7716 | skip_handshake_stage_check |
| 7717 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7718 | 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] | 7719 | "$O_NEXT_SRV -msg -tls1" \ |
| 7720 | "$P_CLI debug_level=4" \ |
| 7721 | 1 \ |
| 7722 | -s "fatal protocol_version" \ |
| 7723 | -c "is a fatal alert message (msg 70)" \ |
| 7724 | -S "Version: TLS1.0" \ |
| 7725 | -C "Protocol : TLSv1.0" |
| 7726 | |
| 7727 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7728 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7729 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7730 | skip_handshake_stage_check |
| 7731 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7732 | 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] | 7733 | "$O_NEXT_SRV -msg -tls1_1" \ |
| 7734 | "$P_CLI debug_level=4" \ |
| 7735 | 1 \ |
| 7736 | -s "fatal protocol_version" \ |
| 7737 | -c "is a fatal alert message (msg 70)" \ |
| 7738 | -S "Version: TLS1.1" \ |
| 7739 | -C "Protocol : TLSv1.1" |
| 7740 | |
| 7741 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7742 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7743 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7744 | skip_handshake_stage_check |
| 7745 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7746 | 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] | 7747 | "$O_NEXT_SRV -msg -tls1_2" \ |
| 7748 | "$P_CLI force_version=tls13 debug_level=4" \ |
| 7749 | 1 \ |
| 7750 | -s "fatal protocol_version" \ |
| 7751 | -c "is a fatal alert message (msg 70)" \ |
| 7752 | -S "Version: TLS1.2" \ |
| 7753 | -C "Protocol : TLSv1.2" |
| 7754 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7755 | # Tests for ALPN extension |
| 7756 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7757 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7758 | "$P_SRV debug_level=3" \ |
| 7759 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7760 | 0 \ |
| 7761 | -C "client hello, adding alpn extension" \ |
| 7762 | -S "found alpn extension" \ |
| 7763 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7764 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7765 | -C "found alpn extension " \ |
| 7766 | -C "Application Layer Protocol is" \ |
| 7767 | -S "Application Layer Protocol is" |
| 7768 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7769 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7770 | "$P_SRV debug_level=3" \ |
| 7771 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7772 | 0 \ |
| 7773 | -c "client hello, adding alpn extension" \ |
| 7774 | -s "found alpn extension" \ |
| 7775 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7776 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7777 | -C "found alpn extension " \ |
| 7778 | -c "Application Layer Protocol is (none)" \ |
| 7779 | -S "Application Layer Protocol is" |
| 7780 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7781 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7782 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7783 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7784 | 0 \ |
| 7785 | -C "client hello, adding alpn extension" \ |
| 7786 | -S "found alpn extension" \ |
| 7787 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7788 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7789 | -C "found alpn extension " \ |
| 7790 | -C "Application Layer Protocol is" \ |
| 7791 | -s "Application Layer Protocol is (none)" |
| 7792 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7793 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7794 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7795 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7796 | 0 \ |
| 7797 | -c "client hello, adding alpn extension" \ |
| 7798 | -s "found alpn extension" \ |
| 7799 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7800 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7801 | -c "found alpn extension" \ |
| 7802 | -c "Application Layer Protocol is abc" \ |
| 7803 | -s "Application Layer Protocol is abc" |
| 7804 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7805 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7806 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7807 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7808 | 0 \ |
| 7809 | -c "client hello, adding alpn extension" \ |
| 7810 | -s "found alpn extension" \ |
| 7811 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7812 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7813 | -c "found alpn extension" \ |
| 7814 | -c "Application Layer Protocol is abc" \ |
| 7815 | -s "Application Layer Protocol is abc" |
| 7816 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7817 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7818 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7819 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7820 | 0 \ |
| 7821 | -c "client hello, adding alpn extension" \ |
| 7822 | -s "found alpn extension" \ |
| 7823 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7824 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7825 | -c "found alpn extension" \ |
| 7826 | -c "Application Layer Protocol is 1234" \ |
| 7827 | -s "Application Layer Protocol is 1234" |
| 7828 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7829 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7830 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 7831 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7832 | 1 \ |
| 7833 | -c "client hello, adding alpn extension" \ |
| 7834 | -s "found alpn extension" \ |
| 7835 | -c "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7836 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7837 | -C "found alpn extension" \ |
| 7838 | -C "Application Layer Protocol is 1234" \ |
| 7839 | -S "Application Layer Protocol is 1234" |
| 7840 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 7841 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7842 | # Tests for keyUsage in leaf certificates, part 1: |
| 7843 | # server-side certificate/suite selection |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7844 | # |
| 7845 | # This is only about 1.2 (for 1.3, all key exchanges use signatures). |
| 7846 | # In 4.0 this will probably go away as all TLS 1.2 key exchanges will use |
| 7847 | # 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] | 7848 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7849 | run_test "keyUsage srv 1.2: RSA, digitalSignature -> (EC)DHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7850 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7851 | crt_file=$DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7852 | "$P_CLI" \ |
| 7853 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 7854 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7855 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7856 | run_test "keyUsage srv 1.2: RSA, keyEncipherment -> RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7857 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7858 | crt_file=$DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7859 | "$P_CLI" \ |
| 7860 | 0 \ |
| 7861 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 7862 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7863 | run_test "keyUsage srv 1.2: RSA, keyAgreement -> fail" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7864 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7865 | crt_file=$DATA_FILES_PATH/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 7866 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7867 | 1 \ |
| 7868 | -C "Ciphersuite is " |
| 7869 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 7870 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7871 | run_test "keyUsage srv 1.2: ECC, digitalSignature -> ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7872 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7873 | crt_file=$DATA_FILES_PATH/server5.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7874 | "$P_CLI" \ |
| 7875 | 0 \ |
| 7876 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 7877 | |
| 7878 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7879 | run_test "keyUsage srv 1.2: ECC, keyAgreement -> ECDH-" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7880 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7881 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7882 | "$P_CLI" \ |
| 7883 | 0 \ |
| 7884 | -c "Ciphersuite is TLS-ECDH-" |
| 7885 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7886 | run_test "keyUsage srv 1.2: ECC, keyEncipherment -> fail" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7887 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7888 | crt_file=$DATA_FILES_PATH/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 7889 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7890 | 1 \ |
| 7891 | -C "Ciphersuite is " |
| 7892 | |
| 7893 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7894 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7895 | # |
| 7896 | # TLS 1.3 uses only signature, but for 1.2 it depends on the key exchange. |
| 7897 | # In 4.0 this will probably change as all TLS 1.2 key exchanges will use |
| 7898 | # 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] | 7899 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7900 | run_test "keyUsage cli 1.2: DigitalSignature+KeyEncipherment, RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7901 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7902 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7903 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7904 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7905 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7906 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7907 | -C "Processing of the Certificate handshake message failed" \ |
| 7908 | -c "Ciphersuite is TLS-" |
| 7909 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7910 | run_test "keyUsage cli 1.2: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7911 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7912 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7913 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7914 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7915 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7916 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7917 | -C "Processing of the Certificate handshake message failed" \ |
| 7918 | -c "Ciphersuite is TLS-" |
| 7919 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7920 | run_test "keyUsage cli 1.2: KeyEncipherment, RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7921 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7922 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7923 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7924 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7925 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7926 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7927 | -C "Processing of the Certificate handshake message failed" \ |
| 7928 | -c "Ciphersuite is TLS-" |
| 7929 | |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7930 | run_test "keyUsage cli 1.2: KeyEncipherment, DHE-RSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7931 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7932 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7933 | "$P_CLI debug_level=3 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7934 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7935 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7936 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7937 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7938 | -C "Ciphersuite is TLS-" \ |
| 7939 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7940 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7941 | # 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] | 7942 | |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7943 | run_test "keyUsage cli 1.2: KeyEncipherment, DHE-RSA: fail (soft)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7944 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7945 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7946 | "$P_CLI debug_level=3 auth_mode=optional \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7947 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7948 | 0 \ |
| 7949 | -c "bad certificate (usage extensions)" \ |
| 7950 | -C "Processing of the Certificate handshake message failed" \ |
| 7951 | -c "Ciphersuite is TLS-" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7952 | -C "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7953 | -c "! Usage does not match the keyUsage extension" |
| 7954 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7955 | run_test "keyUsage cli 1.2: DigitalSignature, DHE-RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7956 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7957 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7958 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7959 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7960 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7961 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7962 | -C "Processing of the Certificate handshake message failed" \ |
| 7963 | -c "Ciphersuite is TLS-" |
| 7964 | |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7965 | run_test "keyUsage cli 1.2: DigitalSignature, RSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7966 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7967 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7968 | "$P_CLI debug_level=3 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7969 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7970 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7971 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7972 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7973 | -C "Ciphersuite is TLS-" \ |
| 7974 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7975 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7976 | # 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] | 7977 | |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7978 | run_test "keyUsage cli 1.2: DigitalSignature, RSA: fail (soft)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7979 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7980 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7981 | "$P_CLI debug_level=3 auth_mode=optional \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7982 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7983 | 0 \ |
| 7984 | -c "bad certificate (usage extensions)" \ |
| 7985 | -C "Processing of the Certificate handshake message failed" \ |
| 7986 | -c "Ciphersuite is TLS-" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7987 | -C "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7988 | -c "! Usage does not match the keyUsage extension" |
| 7989 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7990 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7991 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7992 | run_test "keyUsage cli 1.3: DigitalSignature, RSA: OK" \ |
| 7993 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7994 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds.crt" \ |
| 7995 | "$P_CLI debug_level=3" \ |
| 7996 | 0 \ |
| 7997 | -C "bad certificate (usage extensions)" \ |
| 7998 | -C "Processing of the Certificate handshake message failed" \ |
| 7999 | -c "Ciphersuite is" |
| 8000 | |
| 8001 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8002 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8003 | run_test "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8004 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 8005 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds_ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8006 | "$P_CLI debug_level=3" \ |
| 8007 | 0 \ |
| 8008 | -C "bad certificate (usage extensions)" \ |
| 8009 | -C "Processing of the Certificate handshake message failed" \ |
| 8010 | -c "Ciphersuite is" |
| 8011 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8012 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8013 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8014 | run_test "keyUsage cli 1.3: KeyEncipherment, RSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8015 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 8016 | -cert $DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8017 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8018 | 1 \ |
| 8019 | -c "bad certificate (usage extensions)" \ |
| 8020 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8021 | -C "Ciphersuite is" \ |
| 8022 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8023 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8024 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8025 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8026 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8027 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8028 | run_test "keyUsage cli 1.3: KeyAgreement, RSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8029 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 8030 | -cert $DATA_FILES_PATH/server2-sha256.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8031 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8032 | 1 \ |
| 8033 | -c "bad certificate (usage extensions)" \ |
| 8034 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8035 | -C "Ciphersuite is" \ |
| 8036 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8037 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8038 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8039 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8040 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8041 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8042 | run_test "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8043 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8044 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8045 | "$P_CLI debug_level=3" \ |
| 8046 | 0 \ |
| 8047 | -C "bad certificate (usage extensions)" \ |
| 8048 | -C "Processing of the Certificate handshake message failed" \ |
| 8049 | -c "Ciphersuite is" |
| 8050 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8051 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8052 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8053 | run_test "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8054 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8055 | -cert $DATA_FILES_PATH/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8056 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8057 | 1 \ |
| 8058 | -c "bad certificate (usage extensions)" \ |
| 8059 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8060 | -C "Ciphersuite is" \ |
| 8061 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8062 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8063 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8064 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8065 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8066 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8067 | run_test "keyUsage cli 1.3: KeyAgreement, ECDSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8068 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8069 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8070 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8071 | 1 \ |
| 8072 | -c "bad certificate (usage extensions)" \ |
| 8073 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8074 | -C "Ciphersuite is" \ |
| 8075 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8076 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8077 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8078 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8079 | # Tests for keyUsage in leaf certificates, part 3: |
| 8080 | # server-side checking of client cert |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8081 | # |
| 8082 | # Here, both 1.2 and 1.3 only use signatures. |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8083 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8084 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8085 | run_test "keyUsage cli-auth 1.2: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8086 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8087 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8088 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8089 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8090 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8091 | -S "bad certificate (usage extensions)" \ |
| 8092 | -S "Processing of the Certificate handshake message failed" |
| 8093 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8094 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8095 | run_test "keyUsage cli-auth 1.2: RSA, DigitalSignature+KeyEncipherment: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8096 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8097 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8098 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
| 8099 | 0 \ |
| 8100 | -s "Verifying peer X.509 certificate... ok" \ |
| 8101 | -S "bad certificate (usage extensions)" \ |
| 8102 | -S "Processing of the Certificate handshake message failed" |
| 8103 | |
| 8104 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8105 | run_test "keyUsage cli-auth 1.2: RSA, KeyEncipherment: fail (soft)" \ |
| 8106 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8107 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8108 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8109 | 0 \ |
| 8110 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8111 | -S "send alert level=2 message=43" \ |
| 8112 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8113 | -S "Processing of the Certificate handshake message failed" |
| 8114 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8115 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8116 | run_test "keyUsage cli-auth 1.2: RSA, KeyEncipherment: fail (hard)" \ |
| 8117 | "$P_SRV debug_level=3 force_version=tls12 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8118 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8119 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8120 | 1 \ |
| 8121 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8122 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8123 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8124 | -s "Processing of the Certificate handshake message failed" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8125 | # 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] | 8126 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8127 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8128 | run_test "keyUsage cli-auth 1.2: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8129 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8130 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8131 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8132 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8133 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8134 | -S "bad certificate (usage extensions)" \ |
| 8135 | -S "Processing of the Certificate handshake message failed" |
| 8136 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8137 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8138 | run_test "keyUsage cli-auth 1.2: ECDSA, KeyAgreement: fail (soft)" \ |
| 8139 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8140 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8141 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8142 | 0 \ |
| 8143 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8144 | -S "send alert level=2 message=43" \ |
| 8145 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8146 | -S "Processing of the Certificate handshake message failed" |
| 8147 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8148 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8149 | run_test "keyUsage cli-auth 1.2: ECDSA, KeyAgreement: fail (hard)" \ |
| 8150 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 8151 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8152 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
| 8153 | 1 \ |
| 8154 | -s "bad certificate (usage extensions)" \ |
| 8155 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8156 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8157 | -s "Processing of the Certificate handshake message failed" |
| 8158 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8159 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8160 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8161 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8162 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8163 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8164 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
| 8165 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8166 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8167 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8168 | -S "bad certificate (usage extensions)" \ |
| 8169 | -S "Processing of the Certificate handshake message failed" |
| 8170 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8171 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8172 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8173 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature+KeyEncipherment: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8174 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8175 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8176 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds_ke.crt" \ |
| 8177 | 0 \ |
| 8178 | -s "Verifying peer X.509 certificate... ok" \ |
| 8179 | -S "bad certificate (usage extensions)" \ |
| 8180 | -S "Processing of the Certificate handshake message failed" |
| 8181 | |
| 8182 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8183 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8184 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ |
| 8185 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
| 8186 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8187 | -cert $DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8188 | 0 \ |
| 8189 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8190 | -S "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8191 | -s "! Usage does not match the keyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8192 | -S "Processing of the Certificate handshake message failed" |
| 8193 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8194 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8195 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8196 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (hard)" \ |
| 8197 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=required" \ |
Manuel Pégourié-Gonnard | aeda1fd | 2024-08-12 09:50:18 +0200 | [diff] [blame] | 8198 | "$P_CLI key_file=$DATA_FILES_PATH/server2.key \ |
| 8199 | crt_file=$DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
| 8200 | 1 \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8201 | -s "bad certificate (usage extensions)" \ |
| 8202 | -s "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8203 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8204 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8205 | -s "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8206 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8207 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8208 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8209 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8210 | run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8211 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8212 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8213 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8214 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8215 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8216 | -S "bad certificate (usage extensions)" \ |
| 8217 | -S "Processing of the Certificate handshake message failed" |
| 8218 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8219 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8220 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8221 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8222 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8223 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8224 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8225 | 0 \ |
| 8226 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8227 | -s "! Usage does not match the keyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8228 | -S "Processing of the Certificate handshake message failed" |
| 8229 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8230 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8231 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8232 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (hard)" \ |
| 8233 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=required" \ |
Manuel Pégourié-Gonnard | aeda1fd | 2024-08-12 09:50:18 +0200 | [diff] [blame] | 8234 | "$P_CLI key_file=$DATA_FILES_PATH/server5.key \ |
| 8235 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
| 8236 | 1 \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8237 | -s "bad certificate (usage extensions)" \ |
| 8238 | -s "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8239 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8240 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8241 | -s "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8242 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 8243 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8244 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 8245 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8246 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8247 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8248 | crt_file=$DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8249 | "$P_CLI" \ |
| 8250 | 0 |
| 8251 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8252 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8253 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8254 | crt_file=$DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8255 | "$P_CLI" \ |
| 8256 | 0 |
| 8257 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8258 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8259 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8260 | crt_file=$DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8261 | "$P_CLI" \ |
| 8262 | 0 |
| 8263 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8264 | run_test "extKeyUsage srv: codeSign -> fail" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8265 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8266 | crt_file=$DATA_FILES_PATH/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 8267 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8268 | 1 |
| 8269 | |
| 8270 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 8271 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8272 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8273 | run_test "extKeyUsage cli 1.2: serverAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8274 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8275 | -cert $DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8276 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8277 | 0 \ |
| 8278 | -C "bad certificate (usage extensions)" \ |
| 8279 | -C "Processing of the Certificate handshake message failed" \ |
| 8280 | -c "Ciphersuite is TLS-" |
| 8281 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8282 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8283 | run_test "extKeyUsage cli 1.2: serverAuth,clientAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8284 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8285 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8286 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8287 | 0 \ |
| 8288 | -C "bad certificate (usage extensions)" \ |
| 8289 | -C "Processing of the Certificate handshake message failed" \ |
| 8290 | -c "Ciphersuite is TLS-" |
| 8291 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8292 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8293 | run_test "extKeyUsage cli 1.2: codeSign,anyEKU -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8294 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8295 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8296 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8297 | 0 \ |
| 8298 | -C "bad certificate (usage extensions)" \ |
| 8299 | -C "Processing of the Certificate handshake message failed" \ |
| 8300 | -c "Ciphersuite is TLS-" |
| 8301 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8302 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | f48bfb0 | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8303 | run_test "extKeyUsage cli 1.2: codeSign -> fail (soft)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8304 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8305 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | f48bfb0 | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8306 | "$P_CLI debug_level=3 auth_mode=optional" \ |
| 8307 | 0 \ |
| 8308 | -c "bad certificate (usage extensions)" \ |
| 8309 | -C "Processing of the Certificate handshake message failed" \ |
| 8310 | -c "Ciphersuite is TLS-" \ |
| 8311 | -C "send alert level=2 message=43" \ |
| 8312 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8313 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8314 | |
| 8315 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8316 | run_test "extKeyUsage cli 1.2: codeSign -> fail (hard)" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 8317 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8318 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8319 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8320 | 1 \ |
| 8321 | -c "bad certificate (usage extensions)" \ |
| 8322 | -c "Processing of the Certificate handshake message failed" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8323 | -C "Ciphersuite is TLS-" \ |
| 8324 | -c "send alert level=2 message=43" \ |
| 8325 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8326 | # 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] | 8327 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8328 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8329 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8330 | run_test "extKeyUsage cli 1.3: serverAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8331 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8332 | -cert $DATA_FILES_PATH/server5.eku-srv.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8333 | "$P_CLI debug_level=1" \ |
| 8334 | 0 \ |
| 8335 | -C "bad certificate (usage extensions)" \ |
| 8336 | -C "Processing of the Certificate handshake message failed" \ |
| 8337 | -c "Ciphersuite is" |
| 8338 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8339 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8340 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8341 | run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8342 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8343 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8344 | "$P_CLI debug_level=1" \ |
| 8345 | 0 \ |
| 8346 | -C "bad certificate (usage extensions)" \ |
| 8347 | -C "Processing of the Certificate handshake message failed" \ |
| 8348 | -c "Ciphersuite is" |
| 8349 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8350 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8351 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8352 | run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8353 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8354 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8355 | "$P_CLI debug_level=1" \ |
| 8356 | 0 \ |
| 8357 | -C "bad certificate (usage extensions)" \ |
| 8358 | -C "Processing of the Certificate handshake message failed" \ |
| 8359 | -c "Ciphersuite is" |
| 8360 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8361 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8362 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8363 | run_test "extKeyUsage cli 1.3: codeSign -> fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8364 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8365 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8366 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8367 | 1 \ |
| 8368 | -c "bad certificate (usage extensions)" \ |
| 8369 | -c "Processing of the Certificate handshake message failed" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8370 | -C "Ciphersuite is" \ |
| 8371 | -c "send alert level=2 message=43" \ |
| 8372 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8373 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8374 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8375 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 8376 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8377 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8378 | run_test "extKeyUsage cli-auth 1.2: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8379 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8380 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8381 | -cert $DATA_FILES_PATH/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8382 | 0 \ |
| 8383 | -S "bad certificate (usage extensions)" \ |
| 8384 | -S "Processing of the Certificate handshake message failed" |
| 8385 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8387 | run_test "extKeyUsage cli-auth 1.2: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8388 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8389 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8390 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8391 | 0 \ |
| 8392 | -S "bad certificate (usage extensions)" \ |
| 8393 | -S "Processing of the Certificate handshake message failed" |
| 8394 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8395 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8396 | run_test "extKeyUsage cli-auth 1.2: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8397 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8398 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8399 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8400 | 0 \ |
| 8401 | -S "bad certificate (usage extensions)" \ |
| 8402 | -S "Processing of the Certificate handshake message failed" |
| 8403 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8404 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8405 | run_test "extKeyUsage cli-auth 1.2: codeSign -> fail (soft)" \ |
| 8406 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8407 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8408 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8409 | 0 \ |
| 8410 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8411 | -S "send alert level=2 message=43" \ |
| 8412 | -s "! Usage does not match the extendedKeyUsage extension" \ |
| 8413 | -S "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8414 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8415 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8416 | run_test "extKeyUsage cli-auth 1.2: codeSign -> fail (hard)" \ |
| 8417 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8418 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8419 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8420 | 1 \ |
| 8421 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8422 | -s "send alert level=2 message=43" \ |
| 8423 | -s "! Usage does not match the extendedKeyUsage extension" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8424 | -s "Processing of the Certificate handshake message failed" |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8425 | # 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] | 8426 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8427 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8428 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8429 | run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8430 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8431 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8432 | -cert $DATA_FILES_PATH/server5.eku-cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8433 | 0 \ |
| 8434 | -S "bad certificate (usage extensions)" \ |
| 8435 | -S "Processing of the Certificate handshake message failed" |
| 8436 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8437 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8438 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8439 | run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8440 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8441 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8442 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8443 | 0 \ |
| 8444 | -S "bad certificate (usage extensions)" \ |
| 8445 | -S "Processing of the Certificate handshake message failed" |
| 8446 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8447 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8448 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8449 | run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8450 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8451 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8452 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8453 | 0 \ |
| 8454 | -S "bad certificate (usage extensions)" \ |
| 8455 | -S "Processing of the Certificate handshake message failed" |
| 8456 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8457 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8458 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8459 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8460 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8461 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8462 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8463 | 0 \ |
| 8464 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8465 | -S "send alert level=2 message=43" \ |
| 8466 | -s "! Usage does not match the extendedKeyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8467 | -S "Processing of the Certificate handshake message failed" |
| 8468 | |
Elena Uziunaite | f48bfb0 | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8469 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8470 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Elena Uziunaite | f48bfb0 | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8471 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (hard)" \ |
| 8472 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=required" \ |
| 8473 | "$P_CLI key_file=$DATA_FILES_PATH/server5.key \ |
| 8474 | crt_file=$DATA_FILES_PATH/server5.eku-cs.crt" \ |
| 8475 | 1 \ |
| 8476 | -s "bad certificate (usage extensions)" \ |
| 8477 | -s "send alert level=2 message=43" \ |
| 8478 | -s "! Usage does not match the extendedKeyUsage extension" \ |
| 8479 | -s "Processing of the Certificate handshake message failed" |
| 8480 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8481 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8482 | # Tests for DHM parameters loading |
| 8483 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8484 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8485 | "$P_SRV" \ |
| 8486 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8487 | debug_level=3" \ |
| 8488 | 0 \ |
| 8489 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 8490 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8491 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8492 | run_test "DHM parameters: other parameters" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8493 | "$P_SRV dhm_file=$DATA_FILES_PATH/dhparams.pem" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8494 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8495 | debug_level=3" \ |
| 8496 | 0 \ |
| 8497 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 8498 | -c "value of 'DHM: G ' (2 bits)" |
| 8499 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8500 | # Tests for DHM client-side size checking |
| 8501 | |
| 8502 | run_test "DHM size: server default, client default, OK" \ |
| 8503 | "$P_SRV" \ |
| 8504 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8505 | debug_level=1" \ |
| 8506 | 0 \ |
| 8507 | -C "DHM prime too short:" |
| 8508 | |
| 8509 | run_test "DHM size: server default, client 2048, OK" \ |
| 8510 | "$P_SRV" \ |
| 8511 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8512 | debug_level=1 dhmlen=2048" \ |
| 8513 | 0 \ |
| 8514 | -C "DHM prime too short:" |
| 8515 | |
| 8516 | run_test "DHM size: server 1024, client default, OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8517 | "$P_SRV dhm_file=$DATA_FILES_PATH/dhparams.pem" \ |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8518 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8519 | debug_level=1" \ |
| 8520 | 0 \ |
| 8521 | -C "DHM prime too short:" |
| 8522 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8523 | run_test "DHM size: server 999, client 999, OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8524 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.999.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8525 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8526 | debug_level=1 dhmlen=999" \ |
| 8527 | 0 \ |
| 8528 | -C "DHM prime too short:" |
| 8529 | |
| 8530 | run_test "DHM size: server 1000, client 1000, OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8531 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8532 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8533 | debug_level=1 dhmlen=1000" \ |
| 8534 | 0 \ |
| 8535 | -C "DHM prime too short:" |
| 8536 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8537 | run_test "DHM size: server 1000, client default, rejected" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8538 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8539 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8540 | debug_level=1" \ |
| 8541 | 1 \ |
| 8542 | -c "DHM prime too short:" |
| 8543 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8544 | run_test "DHM size: server 1000, client 1001, rejected" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8545 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8546 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8547 | debug_level=1 dhmlen=1001" \ |
| 8548 | 1 \ |
| 8549 | -c "DHM prime too short:" |
| 8550 | |
| 8551 | run_test "DHM size: server 999, client 1000, rejected" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8552 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.999.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8553 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8554 | debug_level=1 dhmlen=1000" \ |
| 8555 | 1 \ |
| 8556 | -c "DHM prime too short:" |
| 8557 | |
| 8558 | run_test "DHM size: server 998, client 999, rejected" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8559 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.998.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8560 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8561 | debug_level=1 dhmlen=999" \ |
| 8562 | 1 \ |
| 8563 | -c "DHM prime too short:" |
| 8564 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8565 | run_test "DHM size: server default, client 2049, rejected" \ |
| 8566 | "$P_SRV" \ |
| 8567 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8568 | debug_level=1 dhmlen=2049" \ |
| 8569 | 1 \ |
| 8570 | -c "DHM prime too short:" |
| 8571 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8572 | # Tests for PSK callback |
| 8573 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8574 | run_test "PSK callback: psk, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8575 | "$P_SRV psk=73776f726466697368 psk_identity=foo" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8576 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8577 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8578 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8579 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 8580 | -S "SSL - Unknown identity received" \ |
| 8581 | -S "SSL - Verification of the message MAC failed" |
| 8582 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8583 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8584 | run_test "PSK callback: opaque psk on client, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8585 | "$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] | 8586 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8587 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8588 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8589 | -C "session hash for extended master secret"\ |
| 8590 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8591 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8592 | -S "SSL - Unknown identity received" \ |
| 8593 | -S "SSL - Verification of the message MAC failed" |
| 8594 | |
| 8595 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8596 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8597 | "$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] | 8598 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8599 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8600 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8601 | -C "session hash for extended master secret"\ |
| 8602 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8603 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8604 | -S "SSL - Unknown identity received" \ |
| 8605 | -S "SSL - Verification of the message MAC failed" |
| 8606 | |
| 8607 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8608 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8609 | "$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] | 8610 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8611 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8612 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8613 | -c "session hash for extended master secret"\ |
| 8614 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8615 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8616 | -S "SSL - Unknown identity received" \ |
| 8617 | -S "SSL - Verification of the message MAC failed" |
| 8618 | |
| 8619 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8620 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8621 | "$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] | 8622 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8623 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8624 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8625 | -c "session hash for extended master secret"\ |
| 8626 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8627 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8628 | -S "SSL - Unknown identity received" \ |
| 8629 | -S "SSL - Verification of the message MAC failed" |
| 8630 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8631 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8632 | run_test "PSK callback: opaque rsa-psk on client, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8633 | "$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] | 8634 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8635 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8636 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8637 | -C "session hash for extended master secret"\ |
| 8638 | -S "session hash for extended master secret"\ |
| 8639 | -S "SSL - The handshake negotiation failed" \ |
| 8640 | -S "SSL - Unknown identity received" \ |
| 8641 | -S "SSL - Verification of the message MAC failed" |
| 8642 | |
| 8643 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8644 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8645 | "$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] | 8646 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8647 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8648 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8649 | -C "session hash for extended master secret"\ |
| 8650 | -S "session hash for extended master secret"\ |
| 8651 | -S "SSL - The handshake negotiation failed" \ |
| 8652 | -S "SSL - Unknown identity received" \ |
| 8653 | -S "SSL - Verification of the message MAC failed" |
| 8654 | |
| 8655 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8656 | run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8657 | "$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] | 8658 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8659 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8660 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8661 | -c "session hash for extended master secret"\ |
| 8662 | -s "session hash for extended master secret"\ |
| 8663 | -S "SSL - The handshake negotiation failed" \ |
| 8664 | -S "SSL - Unknown identity received" \ |
| 8665 | -S "SSL - Verification of the message MAC failed" |
| 8666 | |
| 8667 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8668 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8669 | "$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] | 8670 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8671 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8672 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8673 | -c "session hash for extended master secret"\ |
| 8674 | -s "session hash for extended master secret"\ |
| 8675 | -S "SSL - The handshake negotiation failed" \ |
| 8676 | -S "SSL - Unknown identity received" \ |
| 8677 | -S "SSL - Verification of the message MAC failed" |
| 8678 | |
| 8679 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8680 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8681 | "$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] | 8682 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8683 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8684 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8685 | -C "session hash for extended master secret"\ |
| 8686 | -S "session hash for extended master secret"\ |
| 8687 | -S "SSL - The handshake negotiation failed" \ |
| 8688 | -S "SSL - Unknown identity received" \ |
| 8689 | -S "SSL - Verification of the message MAC failed" |
| 8690 | |
| 8691 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8692 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8693 | "$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] | 8694 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8695 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8696 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8697 | -C "session hash for extended master secret"\ |
| 8698 | -S "session hash for extended master secret"\ |
| 8699 | -S "SSL - The handshake negotiation failed" \ |
| 8700 | -S "SSL - Unknown identity received" \ |
| 8701 | -S "SSL - Verification of the message MAC failed" |
| 8702 | |
| 8703 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8704 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8705 | "$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] | 8706 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8707 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8708 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8709 | -c "session hash for extended master secret"\ |
| 8710 | -s "session hash for extended master secret"\ |
| 8711 | -S "SSL - The handshake negotiation failed" \ |
| 8712 | -S "SSL - Unknown identity received" \ |
| 8713 | -S "SSL - Verification of the message MAC failed" |
| 8714 | |
| 8715 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8716 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8717 | "$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] | 8718 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8719 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8720 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8721 | -c "session hash for extended master secret"\ |
| 8722 | -s "session hash for extended master secret"\ |
| 8723 | -S "SSL - The handshake negotiation failed" \ |
| 8724 | -S "SSL - Unknown identity received" \ |
| 8725 | -S "SSL - Verification of the message MAC failed" |
| 8726 | |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8727 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8728 | run_test "PSK callback: opaque dhe-psk on client, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8729 | "$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] | 8730 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA256 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8731 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8732 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8733 | -C "session hash for extended master secret"\ |
| 8734 | -S "session hash for extended master secret"\ |
| 8735 | -S "SSL - The handshake negotiation failed" \ |
| 8736 | -S "SSL - Unknown identity received" \ |
| 8737 | -S "SSL - Verification of the message MAC failed" |
| 8738 | |
| 8739 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8740 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8741 | "$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] | 8742 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8743 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8744 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8745 | -C "session hash for extended master secret"\ |
| 8746 | -S "session hash for extended master secret"\ |
| 8747 | -S "SSL - The handshake negotiation failed" \ |
| 8748 | -S "SSL - Unknown identity received" \ |
| 8749 | -S "SSL - Verification of the message MAC failed" |
| 8750 | |
| 8751 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8752 | run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8753 | "$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] | 8754 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8755 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8756 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8757 | -c "session hash for extended master secret"\ |
| 8758 | -s "session hash for extended master secret"\ |
| 8759 | -S "SSL - The handshake negotiation failed" \ |
| 8760 | -S "SSL - Unknown identity received" \ |
| 8761 | -S "SSL - Verification of the message MAC failed" |
| 8762 | |
| 8763 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8764 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8765 | "$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] | 8766 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8767 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8768 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8769 | -c "session hash for extended master secret"\ |
| 8770 | -s "session hash for extended master secret"\ |
| 8771 | -S "SSL - The handshake negotiation failed" \ |
| 8772 | -S "SSL - Unknown identity received" \ |
| 8773 | -S "SSL - Verification of the message MAC failed" |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8774 | |
| 8775 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8776 | run_test "PSK callback: raw psk on client, static opaque on server, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8777 | "$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] | 8778 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8779 | psk_identity=foo psk=73776f726466697368" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8780 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8781 | -C "session hash for extended master secret"\ |
| 8782 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8783 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8784 | -S "SSL - Unknown identity received" \ |
| 8785 | -S "SSL - Verification of the message MAC failed" |
| 8786 | |
| 8787 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8788 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8789 | "$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] | 8790 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8791 | psk_identity=foo psk=73776f726466697368" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8792 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8793 | -C "session hash for extended master secret"\ |
| 8794 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8795 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8796 | -S "SSL - Unknown identity received" \ |
| 8797 | -S "SSL - Verification of the message MAC failed" |
| 8798 | |
| 8799 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8800 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8801 | "$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] | 8802 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8803 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8804 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8805 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8806 | -c "session hash for extended master secret"\ |
| 8807 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8808 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8809 | -S "SSL - Unknown identity received" \ |
| 8810 | -S "SSL - Verification of the message MAC failed" |
| 8811 | |
| 8812 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8813 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8814 | "$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] | 8815 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8816 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8817 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8818 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8819 | -c "session hash for extended master secret"\ |
| 8820 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8821 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8822 | -S "SSL - Unknown identity received" \ |
| 8823 | -S "SSL - Verification of the message MAC failed" |
| 8824 | |
| 8825 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8826 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8827 | "$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] | 8828 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8829 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8830 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8831 | -C "session hash for extended master secret"\ |
| 8832 | -S "session hash for extended master secret"\ |
| 8833 | -S "SSL - The handshake negotiation failed" \ |
| 8834 | -S "SSL - Unknown identity received" \ |
| 8835 | -S "SSL - Verification of the message MAC failed" |
| 8836 | |
| 8837 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8838 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, SHA-384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8839 | "$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] | 8840 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8841 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8842 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8843 | -C "session hash for extended master secret"\ |
| 8844 | -S "session hash for extended master secret"\ |
| 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 | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8850 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8851 | "$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] | 8852 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8853 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8854 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8855 | 0 \ |
| 8856 | -c "session hash for extended master secret"\ |
| 8857 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8858 | -S "SSL - The handshake negotiation failed" \ |
| 8859 | -S "SSL - Unknown identity received" \ |
| 8860 | -S "SSL - Verification of the message MAC failed" |
| 8861 | |
| 8862 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8863 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8864 | "$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] | 8865 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8866 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8867 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8868 | 0 \ |
| 8869 | -c "session hash for extended master secret"\ |
| 8870 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8871 | -S "SSL - The handshake negotiation failed" \ |
| 8872 | -S "SSL - Unknown identity received" \ |
| 8873 | -S "SSL - Verification of the message MAC failed" |
| 8874 | |
| 8875 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8876 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8877 | "$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] | 8878 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8879 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8880 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8881 | -C "session hash for extended master secret"\ |
| 8882 | -S "session hash for extended master secret"\ |
| 8883 | -S "SSL - The handshake negotiation failed" \ |
| 8884 | -S "SSL - Unknown identity received" \ |
| 8885 | -S "SSL - Verification of the message MAC failed" |
| 8886 | |
| 8887 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8888 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, SHA-384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8889 | "$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] | 8890 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8891 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8892 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8893 | -C "session hash for extended master secret"\ |
| 8894 | -S "session hash for extended master secret"\ |
| 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 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8900 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8901 | "$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] | 8902 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8903 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8904 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8905 | 0 \ |
| 8906 | -c "session hash for extended master secret"\ |
| 8907 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8908 | -S "SSL - The handshake negotiation failed" \ |
| 8909 | -S "SSL - Unknown identity received" \ |
| 8910 | -S "SSL - Verification of the message MAC failed" |
| 8911 | |
| 8912 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8913 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8914 | "$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] | 8915 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8916 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8917 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8918 | 0 \ |
| 8919 | -c "session hash for extended master secret"\ |
| 8920 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8921 | -S "SSL - The handshake negotiation failed" \ |
| 8922 | -S "SSL - Unknown identity received" \ |
| 8923 | -S "SSL - Verification of the message MAC failed" |
| 8924 | |
| 8925 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8926 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8927 | "$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] | 8928 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8929 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8930 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8931 | -C "session hash for extended master secret"\ |
| 8932 | -S "session hash for extended master secret"\ |
| 8933 | -S "SSL - The handshake negotiation failed" \ |
| 8934 | -S "SSL - Unknown identity received" \ |
| 8935 | -S "SSL - Verification of the message MAC failed" |
| 8936 | |
| 8937 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8938 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, SHA-384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8939 | "$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] | 8940 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8941 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8942 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8943 | -C "session hash for extended master secret"\ |
| 8944 | -S "session hash for extended master secret"\ |
| 8945 | -S "SSL - The handshake negotiation failed" \ |
| 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 | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8950 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8951 | "$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] | 8952 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8953 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8954 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8955 | 0 \ |
| 8956 | -c "session hash for extended master secret"\ |
| 8957 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8958 | -S "SSL - The handshake negotiation failed" \ |
| 8959 | -S "SSL - Unknown identity received" \ |
| 8960 | -S "SSL - Verification of the message MAC failed" |
| 8961 | |
| 8962 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8963 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8964 | "$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] | 8965 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8966 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8967 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8968 | 0 \ |
| 8969 | -c "session hash for extended master secret"\ |
| 8970 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8971 | -S "SSL - The handshake negotiation failed" \ |
| 8972 | -S "SSL - Unknown identity received" \ |
| 8973 | -S "SSL - Verification of the message MAC failed" |
| 8974 | |
| 8975 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8976 | 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] | 8977 | "$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" \ |
| 8978 | "$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] | 8979 | psk_identity=def psk=beef" \ |
| 8980 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8981 | -C "session hash for extended master secret"\ |
| 8982 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8983 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8984 | -S "SSL - Unknown identity received" \ |
| 8985 | -S "SSL - Verification of the message MAC failed" |
| 8986 | |
| 8987 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8988 | 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] | 8989 | "$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" \ |
| 8990 | "$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] | 8991 | psk_identity=def psk=beef" \ |
| 8992 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8993 | -C "session hash for extended master secret"\ |
| 8994 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8995 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8996 | -S "SSL - Unknown identity received" \ |
| 8997 | -S "SSL - Verification of the message MAC failed" |
| 8998 | |
| 8999 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9000 | 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] | 9001 | "$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] | 9002 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9003 | "$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] | 9004 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9005 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9006 | -c "session hash for extended master secret"\ |
| 9007 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9008 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9009 | -S "SSL - Unknown identity received" \ |
| 9010 | -S "SSL - Verification of the message MAC failed" |
| 9011 | |
| 9012 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9013 | 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] | 9014 | "$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] | 9015 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9016 | "$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] | 9017 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9018 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9019 | -c "session hash for extended master secret"\ |
| 9020 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9021 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9022 | -S "SSL - Unknown identity received" \ |
| 9023 | -S "SSL - Verification of the message MAC failed" |
| 9024 | |
| 9025 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9026 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ |
| 9027 | "$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" \ |
| 9028 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 9029 | psk_identity=def psk=beef" \ |
| 9030 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9031 | -C "session hash for extended master secret"\ |
| 9032 | -S "session hash for extended master secret"\ |
| 9033 | -S "SSL - The handshake negotiation failed" \ |
| 9034 | -S "SSL - Unknown identity received" \ |
| 9035 | -S "SSL - Verification of the message MAC failed" |
| 9036 | |
| 9037 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9038 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ |
| 9039 | "$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" \ |
| 9040 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9041 | psk_identity=def psk=beef" \ |
| 9042 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9043 | -C "session hash for extended master secret"\ |
| 9044 | -S "session hash for extended master secret"\ |
| 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 | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9050 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ |
| 9051 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9052 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 9053 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 9054 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9055 | 0 \ |
| 9056 | -c "session hash for extended master secret"\ |
| 9057 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9058 | -S "SSL - The handshake negotiation failed" \ |
| 9059 | -S "SSL - Unknown identity received" \ |
| 9060 | -S "SSL - Verification of the message MAC failed" |
| 9061 | |
| 9062 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9063 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \ |
| 9064 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9065 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 9066 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9067 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9068 | 0 \ |
| 9069 | -c "session hash for extended master secret"\ |
| 9070 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9071 | -S "SSL - The handshake negotiation failed" \ |
| 9072 | -S "SSL - Unknown identity received" \ |
| 9073 | -S "SSL - Verification of the message MAC failed" |
| 9074 | |
| 9075 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9076 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 9077 | "$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" \ |
| 9078 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9079 | psk_identity=def psk=beef" \ |
| 9080 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9081 | -C "session hash for extended master secret"\ |
| 9082 | -S "session hash for extended master secret"\ |
| 9083 | -S "SSL - The handshake negotiation failed" \ |
| 9084 | -S "SSL - Unknown identity received" \ |
| 9085 | -S "SSL - Verification of the message MAC failed" |
| 9086 | |
| 9087 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9088 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 9089 | "$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" \ |
| 9090 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9091 | psk_identity=def psk=beef" \ |
| 9092 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9093 | -C "session hash for extended master secret"\ |
| 9094 | -S "session hash for extended master secret"\ |
| 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 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9100 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 9101 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9102 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 9103 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9104 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9105 | 0 \ |
| 9106 | -c "session hash for extended master secret"\ |
| 9107 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9108 | -S "SSL - The handshake negotiation failed" \ |
| 9109 | -S "SSL - Unknown identity received" \ |
| 9110 | -S "SSL - Verification of the message MAC failed" |
| 9111 | |
| 9112 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9113 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 9114 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9115 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 9116 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9117 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9118 | 0 \ |
| 9119 | -c "session hash for extended master secret"\ |
| 9120 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9121 | -S "SSL - The handshake negotiation failed" \ |
| 9122 | -S "SSL - Unknown identity received" \ |
| 9123 | -S "SSL - Verification of the message MAC failed" |
| 9124 | |
| 9125 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9126 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ |
| 9127 | "$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" \ |
| 9128 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9129 | psk_identity=def psk=beef" \ |
| 9130 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9131 | -C "session hash for extended master secret"\ |
| 9132 | -S "session hash for extended master secret"\ |
| 9133 | -S "SSL - The handshake negotiation failed" \ |
| 9134 | -S "SSL - Unknown identity received" \ |
| 9135 | -S "SSL - Verification of the message MAC failed" |
| 9136 | |
| 9137 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9138 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ |
| 9139 | "$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" \ |
| 9140 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9141 | psk_identity=def psk=beef" \ |
| 9142 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9143 | -C "session hash for extended master secret"\ |
| 9144 | -S "session hash for extended master secret"\ |
| 9145 | -S "SSL - The handshake negotiation failed" \ |
| 9146 | -S "SSL - Unknown identity received" \ |
| 9147 | -S "SSL - Verification of the message MAC failed" |
| 9148 | |
| 9149 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9150 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \ |
| 9151 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9152 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 9153 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9154 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9155 | 0 \ |
| 9156 | -c "session hash for extended master secret"\ |
| 9157 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9158 | -S "SSL - The handshake negotiation failed" \ |
| 9159 | -S "SSL - Unknown identity received" \ |
| 9160 | -S "SSL - Verification of the message MAC failed" |
| 9161 | |
| 9162 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9163 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \ |
| 9164 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9165 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 9166 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9167 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9168 | 0 \ |
| 9169 | -c "session hash for extended master secret"\ |
| 9170 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9171 | -S "SSL - The handshake negotiation failed" \ |
| 9172 | -S "SSL - Unknown identity received" \ |
| 9173 | -S "SSL - Verification of the message MAC failed" |
| 9174 | |
| 9175 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9176 | run_test "PSK callback: raw psk on client, mismatching static raw PSK on server, opaque PSK from callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9177 | "$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] | 9178 | "$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] | 9179 | psk_identity=def psk=beef" \ |
| 9180 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9181 | -C "session hash for extended master secret"\ |
| 9182 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9183 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9184 | -S "SSL - Unknown identity received" \ |
| 9185 | -S "SSL - Verification of the message MAC failed" |
| 9186 | |
| 9187 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9188 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, opaque PSK from callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9189 | "$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] | 9190 | "$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] | 9191 | psk_identity=def psk=beef" \ |
| 9192 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9193 | -C "session hash for extended master secret"\ |
| 9194 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9195 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9196 | -S "SSL - Unknown identity received" \ |
| 9197 | -S "SSL - Verification of the message MAC failed" |
| 9198 | |
| 9199 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9200 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, raw PSK from callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9201 | "$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] | 9202 | "$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] | 9203 | psk_identity=def psk=beef" \ |
| 9204 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9205 | -C "session hash for extended master secret"\ |
| 9206 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9207 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9208 | -S "SSL - Unknown identity received" \ |
| 9209 | -S "SSL - Verification of the message MAC failed" |
| 9210 | |
| 9211 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9212 | run_test "PSK callback: raw psk on client, id-matching but wrong raw PSK on server, opaque PSK from callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9213 | "$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] | 9214 | "$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] | 9215 | psk_identity=def psk=beef" \ |
| 9216 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9217 | -C "session hash for extended master secret"\ |
| 9218 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9219 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9220 | -S "SSL - Unknown identity received" \ |
| 9221 | -S "SSL - Verification of the message MAC failed" |
| 9222 | |
| 9223 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9224 | run_test "PSK callback: raw psk on client, matching opaque PSK on server, wrong opaque PSK from callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9225 | "$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] | 9226 | "$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] | 9227 | psk_identity=def psk=beef" \ |
| 9228 | 1 \ |
| 9229 | -s "SSL - Verification of the message MAC failed" |
| 9230 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9231 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 9232 | "$P_SRV" \ |
| 9233 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9234 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 9235 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 9236 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9237 | -S "SSL - Unknown identity received" \ |
| 9238 | -S "SSL - Verification of the message MAC failed" |
| 9239 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9240 | run_test "PSK callback: callback overrides other settings" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9241 | "$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] | 9242 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9243 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9244 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9245 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9246 | -s "SSL - Unknown identity received" \ |
| 9247 | -S "SSL - Verification of the message MAC failed" |
| 9248 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9249 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9250 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9251 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9252 | psk_identity=abc psk=dead" \ |
| 9253 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9254 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9255 | -S "SSL - Unknown identity received" \ |
| 9256 | -S "SSL - Verification of the message MAC failed" |
| 9257 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9258 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9259 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9260 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9261 | psk_identity=def psk=beef" \ |
| 9262 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9263 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9264 | -S "SSL - Unknown identity received" \ |
| 9265 | -S "SSL - Verification of the message MAC failed" |
| 9266 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9267 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9268 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9269 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9270 | psk_identity=ghi psk=beef" \ |
| 9271 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9272 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9273 | -s "SSL - Unknown identity received" \ |
| 9274 | -S "SSL - Verification of the message MAC failed" |
| 9275 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9276 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9277 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9278 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9279 | psk_identity=abc psk=beef" \ |
| 9280 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9281 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9282 | -S "SSL - Unknown identity received" \ |
| 9283 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 9284 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9285 | # Tests for EC J-PAKE |
| 9286 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9287 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9288 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9289 | run_test "ECJPAKE: client not configured" \ |
| 9290 | "$P_SRV debug_level=3" \ |
| 9291 | "$P_CLI debug_level=3" \ |
| 9292 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 9293 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9294 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9295 | -S "found ecjpake kkpp extension" \ |
| 9296 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9297 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9298 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9299 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9300 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9301 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9302 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9303 | run_test "ECJPAKE: server not configured" \ |
| 9304 | "$P_SRV debug_level=3" \ |
| 9305 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 9306 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9307 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 9308 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9309 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9310 | -s "found ecjpake kkpp extension" \ |
| 9311 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9312 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9313 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9314 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9315 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9316 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9317 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9318 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9319 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9320 | run_test "ECJPAKE: working, TLS" \ |
| 9321 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9322 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 9323 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 9324 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 9325 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9326 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9327 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9328 | -s "found ecjpake kkpp extension" \ |
| 9329 | -S "skip ecjpake kkpp extension" \ |
| 9330 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9331 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9332 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9333 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9334 | -S "SSL - Verification of the message MAC failed" |
| 9335 | |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9336 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | a6b69da | 2022-11-30 16:44:49 +0100 | [diff] [blame] | 9337 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9338 | run_test "ECJPAKE: opaque password client+server, working, TLS" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9339 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9340 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 9341 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9342 | 0 \ |
| 9343 | -c "add ciphersuite: c0ff" \ |
| 9344 | -c "adding ecjpake_kkpp extension" \ |
Valerio Setti | 661b9bc | 2022-11-29 17:19:25 +0100 | [diff] [blame] | 9345 | -c "using opaque password" \ |
| 9346 | -s "using opaque password" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9347 | -C "re-using cached ecjpake parameters" \ |
| 9348 | -s "found ecjpake kkpp extension" \ |
| 9349 | -S "skip ecjpake kkpp extension" \ |
| 9350 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9351 | -s "server hello, ecjpake kkpp extension" \ |
| 9352 | -c "found ecjpake_kkpp extension" \ |
| 9353 | -S "SSL - The handshake negotiation failed" \ |
| 9354 | -S "SSL - Verification of the message MAC failed" |
| 9355 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9356 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9357 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9358 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9359 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9360 | run_test "ECJPAKE: opaque password client only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9361 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9362 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 9363 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9364 | 0 \ |
| 9365 | -c "add ciphersuite: c0ff" \ |
| 9366 | -c "adding ecjpake_kkpp extension" \ |
| 9367 | -c "using opaque password" \ |
| 9368 | -S "using opaque password" \ |
| 9369 | -C "re-using cached ecjpake parameters" \ |
| 9370 | -s "found ecjpake kkpp extension" \ |
| 9371 | -S "skip ecjpake kkpp extension" \ |
| 9372 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9373 | -s "server hello, ecjpake kkpp extension" \ |
| 9374 | -c "found ecjpake_kkpp extension" \ |
| 9375 | -S "SSL - The handshake negotiation failed" \ |
| 9376 | -S "SSL - Verification of the message MAC failed" |
| 9377 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9378 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9379 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9380 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9381 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9382 | run_test "ECJPAKE: opaque password server only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9383 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9384 | "$P_CLI debug_level=3 ecjpake_pw=bla\ |
| 9385 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9386 | 0 \ |
| 9387 | -c "add ciphersuite: c0ff" \ |
| 9388 | -c "adding ecjpake_kkpp extension" \ |
| 9389 | -C "using opaque password" \ |
| 9390 | -s "using opaque password" \ |
| 9391 | -C "re-using cached ecjpake parameters" \ |
| 9392 | -s "found ecjpake kkpp extension" \ |
| 9393 | -S "skip ecjpake kkpp extension" \ |
| 9394 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9395 | -s "server hello, ecjpake kkpp extension" \ |
| 9396 | -c "found ecjpake_kkpp extension" \ |
| 9397 | -S "SSL - The handshake negotiation failed" \ |
| 9398 | -S "SSL - Verification of the message MAC failed" |
| 9399 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9400 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9401 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9402 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 9403 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9404 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 9405 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9406 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9407 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9408 | -s "SSL - Verification of the message MAC failed" |
| 9409 | |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9410 | server_needs_more_time 1 |
| 9411 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9412 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9413 | run_test "ECJPAKE_OPAQUE_PW: opaque password mismatch, TLS" \ |
| 9414 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9415 | "$P_CLI debug_level=3 ecjpake_pw=bad ecjpake_pw_opaque=1 \ |
| 9416 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9417 | 1 \ |
| 9418 | -c "using opaque password" \ |
| 9419 | -s "using opaque password" \ |
| 9420 | -C "re-using cached ecjpake parameters" \ |
| 9421 | -s "SSL - Verification of the message MAC failed" |
| 9422 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9423 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9424 | run_test "ECJPAKE: working, DTLS" \ |
| 9425 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 9426 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 9427 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9428 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9429 | -c "re-using cached ecjpake parameters" \ |
| 9430 | -S "SSL - Verification of the message MAC failed" |
| 9431 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9432 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9433 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 9434 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 9435 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 9436 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9437 | 0 \ |
| 9438 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9439 | -S "SSL - Verification of the message MAC failed" |
| 9440 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9441 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9442 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9443 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 9444 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 9445 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 9446 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9447 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9448 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9449 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9450 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 9451 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9452 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 9453 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 9454 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 9455 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 9456 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9457 | 0 |
| 9458 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 9459 | # Test for ClientHello without extensions |
| 9460 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9461 | # Without extensions, ECC is impossible (no curve negotiation). |
| 9462 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 9463 | requires_gnutls |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9464 | run_test "ClientHello without extensions: RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 9465 | "$P_SRV force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9466 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 9467 | 0 \ |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9468 | -s "Ciphersuite is .*-RSA-WITH-.*" \ |
| 9469 | -S "Ciphersuite is .*-EC.*" \ |
| 9470 | -s "dumping 'client hello extensions' (0 bytes)" |
| 9471 | |
Gilles Peskine | fc73aa0 | 2024-05-13 21:18:41 +0200 | [diff] [blame] | 9472 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_PSK_ENABLED |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9473 | requires_gnutls |
| 9474 | run_test "ClientHello without extensions: PSK" \ |
| 9475 | "$P_SRV force_version=tls12 debug_level=3 psk=73776f726466697368" \ |
| 9476 | "$G_CLI --priority=NORMAL:+PSK:-RSA:-DHE-RSA:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION --pskusername=Client_identity --pskkey=73776f726466697368 localhost" \ |
| 9477 | 0 \ |
| 9478 | -s "Ciphersuite is .*-PSK-.*" \ |
| 9479 | -S "Ciphersuite is .*-EC.*" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 9480 | -s "dumping 'client hello extensions' (0 bytes)" |
| 9481 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9482 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9483 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9484 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9485 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9486 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9487 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9488 | "$P_CLI request_size=100" \ |
| 9489 | 0 \ |
| 9490 | -s "Read from client: 100 bytes read$" |
| 9491 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9492 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9493 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 9494 | "$P_SRV buffer_size=100" \ |
| 9495 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9496 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9497 | -s "Read from client: 101 bytes read (100 + 1)" |
| 9498 | |
| 9499 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9500 | requires_max_content_len 200 |
| 9501 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 9502 | "$P_SRV buffer_size=100" \ |
| 9503 | "$P_CLI request_size=200" \ |
| 9504 | 0 \ |
| 9505 | -s "Read from client: 200 bytes read (100 + 100)" |
| 9506 | |
| 9507 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9508 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
Waleed Elmelegy | bae705c | 2024-01-01 14:21:21 +0000 | [diff] [blame] | 9509 | "$P_SRV buffer_size=100 force_version=tls12" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9510 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 9511 | 0 \ |
| 9512 | -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] | 9513 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9514 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9515 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9516 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9517 | "$P_SRV force_version=tls12" \ |
| 9518 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9519 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9520 | 0 \ |
| 9521 | -s "Read from client: 1 bytes read" |
| 9522 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9523 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9524 | "$P_SRV force_version=tls12" \ |
| 9525 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 9526 | 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] | 9527 | 0 \ |
| 9528 | -s "Read from client: 1 bytes read" |
| 9529 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9530 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9531 | "$P_SRV force_version=tls12" \ |
| 9532 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 9533 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9534 | 0 \ |
| 9535 | -s "Read from client: 1 bytes read" |
| 9536 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9537 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9538 | "$P_SRV force_version=tls12" \ |
| 9539 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9540 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 9541 | 0 \ |
| 9542 | -s "Read from client: 1 bytes read" |
| 9543 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9544 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9545 | "$P_SRV force_version=tls12" \ |
| 9546 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9547 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 9548 | 0 \ |
| 9549 | -s "Read from client: 1 bytes read" |
| 9550 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9551 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9552 | run_test "Small client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9553 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9554 | "$P_CLI request_size=1 \ |
| 9555 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9556 | 0 \ |
| 9557 | -s "Read from client: 1 bytes read" |
| 9558 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9559 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9560 | run_test "Small client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9561 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9562 | "$P_CLI request_size=1 \ |
| 9563 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9564 | 0 \ |
| 9565 | -s "Read from client: 1 bytes read" |
| 9566 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9567 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9568 | |
| 9569 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9570 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9571 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9572 | "$P_CLI dtls=1 request_size=1 \ |
| 9573 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9574 | 0 \ |
| 9575 | -s "Read from client: 1 bytes read" |
| 9576 | |
| 9577 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9578 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9579 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9580 | "$P_CLI dtls=1 request_size=1 \ |
| 9581 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9582 | 0 \ |
| 9583 | -s "Read from client: 1 bytes read" |
| 9584 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9585 | # Tests for small server packets |
| 9586 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9587 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9588 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9589 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9590 | 0 \ |
| 9591 | -c "Read from server: 1 bytes read" |
| 9592 | |
| 9593 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9594 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9595 | "$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] | 9596 | 0 \ |
| 9597 | -c "Read from server: 1 bytes read" |
| 9598 | |
| 9599 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9600 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9601 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9602 | 0 \ |
| 9603 | -c "Read from server: 1 bytes read" |
| 9604 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9605 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9606 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9607 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9608 | 0 \ |
| 9609 | -c "Read from server: 1 bytes read" |
| 9610 | |
| 9611 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9612 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9613 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9614 | 0 \ |
| 9615 | -c "Read from server: 1 bytes read" |
| 9616 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9617 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9618 | run_test "Small server packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9619 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9620 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9621 | 0 \ |
| 9622 | -c "Read from server: 1 bytes read" |
| 9623 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9624 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9625 | run_test "Small server packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9626 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9627 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9628 | 0 \ |
| 9629 | -c "Read from server: 1 bytes read" |
| 9630 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9631 | # Tests for small server packets in DTLS |
| 9632 | |
| 9633 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9634 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9635 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9636 | "$P_CLI dtls=1 \ |
| 9637 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9638 | 0 \ |
| 9639 | -c "Read from server: 1 bytes read" |
| 9640 | |
| 9641 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9642 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9643 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9644 | "$P_CLI dtls=1 \ |
| 9645 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9646 | 0 \ |
| 9647 | -c "Read from server: 1 bytes read" |
| 9648 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9649 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9650 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9651 | # How many fragments do we expect to write $1 bytes? |
| 9652 | fragments_for_write() { |
| 9653 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 9654 | } |
| 9655 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9656 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9657 | "$P_SRV force_version=tls12" \ |
| 9658 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9659 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9660 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9661 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9662 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9663 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9664 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9665 | "$P_SRV force_version=tls12" \ |
| 9666 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 9667 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9668 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9669 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 9670 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9671 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9672 | "$P_SRV force_version=tls12" \ |
| 9673 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 9674 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9675 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9676 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9677 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9678 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9679 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9680 | "$P_SRV force_version=tls12" \ |
| 9681 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9682 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 9683 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9684 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9685 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9686 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9687 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9688 | "$P_SRV force_version=tls12" \ |
| 9689 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9690 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 9691 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9692 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9693 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9694 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9695 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9696 | run_test "Large client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9697 | "$P_SRV" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9698 | "$P_CLI request_size=16383 \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9699 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9700 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9701 | -c "16383 bytes written in $(fragments_for_write 16383) fragments" \ |
| 9702 | -s "Read from client: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9703 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9704 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9705 | run_test "Large client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9706 | "$P_SRV" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9707 | "$P_CLI request_size=16383 \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9708 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9709 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9710 | -c "16383 bytes written in $(fragments_for_write 16383) fragments" \ |
| 9711 | -s "Read from client: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9712 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9713 | # 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] | 9714 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9715 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9716 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9717 | 0 \ |
| 9718 | -c "Read from server: 16384 bytes read" |
| 9719 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9720 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9721 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9722 | "$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] | 9723 | 0 \ |
| 9724 | -s "16384 bytes written in 1 fragments" \ |
| 9725 | -c "Read from server: 16384 bytes read" |
| 9726 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9727 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9728 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9729 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9730 | 0 \ |
| 9731 | -c "Read from server: 16384 bytes read" |
| 9732 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9733 | 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] | 9734 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 9735 | "$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] | 9736 | 0 \ |
| 9737 | -s "16384 bytes written in 1 fragments" \ |
| 9738 | -c "Read from server: 16384 bytes read" |
| 9739 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9740 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9741 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9742 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9743 | 0 \ |
| 9744 | -c "Read from server: 16384 bytes read" |
| 9745 | |
| 9746 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9747 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9748 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9749 | 0 \ |
| 9750 | -c "Read from server: 16384 bytes read" |
| 9751 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9752 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9753 | run_test "Large server packet TLS 1.3 AEAD" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9754 | "$P_SRV response_size=16383" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9755 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9756 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9757 | -c "Read from server: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9758 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9759 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9760 | run_test "Large server packet TLS 1.3 AEAD shorter tag" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9761 | "$P_SRV response_size=16383" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9762 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9763 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9764 | -c "Read from server: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9765 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9766 | # Tests for restartable ECC |
| 9767 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9768 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 9769 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9770 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9771 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9772 | run_test "EC restart: TLS, default" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9773 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9774 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9775 | 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] | 9776 | debug_level=1" \ |
| 9777 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9778 | -C "x509_verify_cert.*4b00" \ |
| 9779 | -C "mbedtls_pk_verify.*4b00" \ |
| 9780 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9781 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9782 | |
| 9783 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9784 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9785 | run_test "EC restart: TLS, max_ops=0" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9786 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9787 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9788 | 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] | 9789 | debug_level=1 ec_max_ops=0" \ |
| 9790 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9791 | -C "x509_verify_cert.*4b00" \ |
| 9792 | -C "mbedtls_pk_verify.*4b00" \ |
| 9793 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9794 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9795 | |
| 9796 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9797 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9798 | run_test "EC restart: TLS, max_ops=65535" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9799 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9800 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9801 | 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] | 9802 | debug_level=1 ec_max_ops=65535" \ |
| 9803 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9804 | -C "x509_verify_cert.*4b00" \ |
| 9805 | -C "mbedtls_pk_verify.*4b00" \ |
| 9806 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9807 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9808 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9809 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9810 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9811 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9812 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9813 | run_test "EC restart: TLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9814 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9815 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9816 | 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] | 9817 | debug_level=1 ec_max_ops=1000" \ |
| 9818 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9819 | -c "x509_verify_cert.*4b00" \ |
| 9820 | -c "mbedtls_pk_verify.*4b00" \ |
| 9821 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9822 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9823 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9824 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9825 | # everything except ECDH (where TLS calls PSA directly). |
| 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_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9829 | run_test "EC restart: TLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9830 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9831 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9832 | 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] | 9833 | debug_level=1 ec_max_ops=1000" \ |
| 9834 | 0 \ |
| 9835 | -c "x509_verify_cert.*4b00" \ |
| 9836 | -c "mbedtls_pk_verify.*4b00" \ |
| 9837 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9838 | -c "mbedtls_pk_sign.*4b00" |
| 9839 | |
| 9840 | # This works the same with & without USE_PSA as we never get to ECDH: |
| 9841 | # 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] | 9842 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9843 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9844 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9845 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9846 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9847 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9848 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9849 | 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] | 9850 | debug_level=1 ec_max_ops=1000" \ |
| 9851 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9852 | -c "x509_verify_cert.*4b00" \ |
| 9853 | -C "mbedtls_pk_verify.*4b00" \ |
| 9854 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9855 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9856 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9857 | -c "! mbedtls_ssl_handshake returned" \ |
| 9858 | -c "X509 - Certificate verification failed" |
| 9859 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9860 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9861 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9862 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9863 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9864 | 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] | 9865 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9866 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9867 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9868 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9869 | 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] | 9870 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 9871 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9872 | -c "x509_verify_cert.*4b00" \ |
| 9873 | -c "mbedtls_pk_verify.*4b00" \ |
| 9874 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9875 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9876 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9877 | -C "! mbedtls_ssl_handshake returned" \ |
| 9878 | -C "X509 - Certificate verification failed" |
| 9879 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9880 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9881 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9882 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9883 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9884 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9885 | 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] | 9886 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9887 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9888 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9889 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9890 | 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] | 9891 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 9892 | 0 \ |
| 9893 | -c "x509_verify_cert.*4b00" \ |
| 9894 | -c "mbedtls_pk_verify.*4b00" \ |
| 9895 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9896 | -c "mbedtls_pk_sign.*4b00" \ |
| 9897 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9898 | -C "! mbedtls_ssl_handshake returned" \ |
| 9899 | -C "X509 - Certificate verification failed" |
| 9900 | |
| 9901 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9902 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9903 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9904 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9905 | 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] | 9906 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9907 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9908 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9909 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9910 | 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] | 9911 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 9912 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9913 | -C "x509_verify_cert.*4b00" \ |
| 9914 | -c "mbedtls_pk_verify.*4b00" \ |
| 9915 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9916 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9917 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 9918 | -C "! mbedtls_ssl_handshake returned" \ |
| 9919 | -C "X509 - Certificate verification failed" |
| 9920 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9921 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9922 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9923 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9924 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9925 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9926 | 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] | 9927 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9928 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9929 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9930 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9931 | 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] | 9932 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 9933 | 0 \ |
| 9934 | -C "x509_verify_cert.*4b00" \ |
| 9935 | -c "mbedtls_pk_verify.*4b00" \ |
| 9936 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9937 | -c "mbedtls_pk_sign.*4b00" \ |
| 9938 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 9939 | -C "! mbedtls_ssl_handshake returned" \ |
| 9940 | -C "X509 - Certificate verification failed" |
| 9941 | |
| 9942 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9943 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9944 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9945 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9946 | run_test "EC restart: DTLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9947 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9948 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9949 | 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] | 9950 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 9951 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9952 | -c "x509_verify_cert.*4b00" \ |
| 9953 | -c "mbedtls_pk_verify.*4b00" \ |
| 9954 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9955 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9956 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9957 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9958 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9959 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9960 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9961 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9962 | run_test "EC restart: DTLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9963 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9964 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9965 | 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] | 9966 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 9967 | 0 \ |
| 9968 | -c "x509_verify_cert.*4b00" \ |
| 9969 | -c "mbedtls_pk_verify.*4b00" \ |
| 9970 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9971 | -c "mbedtls_pk_sign.*4b00" |
| 9972 | |
| 9973 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9974 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9975 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9976 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9977 | 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] | 9978 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9979 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9980 | debug_level=1 ec_max_ops=1000" \ |
| 9981 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9982 | -c "x509_verify_cert.*4b00" \ |
| 9983 | -c "mbedtls_pk_verify.*4b00" \ |
| 9984 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9985 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9986 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9987 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9988 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9989 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9990 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9991 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9992 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9993 | 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] | 9994 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9995 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9996 | debug_level=1 ec_max_ops=1000" \ |
| 9997 | 0 \ |
| 9998 | -c "x509_verify_cert.*4b00" \ |
| 9999 | -c "mbedtls_pk_verify.*4b00" \ |
| 10000 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 10001 | -C "mbedtls_pk_sign.*4b00" |
| 10002 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 10003 | # Restartable is only for ECDHE-ECDSA, with another ciphersuite we expect no |
| 10004 | # restartable behaviour at all (not even client auth). |
| 10005 | # This is the same as "EC restart: TLS, max_ops=1000" except with ECDHE-RSA, |
| 10006 | # and all 4 assertions negated. |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 10007 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 10008 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 10009 | run_test "EC restart: TLS, max_ops=1000, ECDHE-RSA" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 10010 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 10011 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10012 | 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] | 10013 | debug_level=1 ec_max_ops=1000" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 10014 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 10015 | -C "x509_verify_cert.*4b00" \ |
| 10016 | -C "mbedtls_pk_verify.*4b00" \ |
| 10017 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 10018 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 10019 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10020 | # Tests of asynchronous private key support in SSL |
| 10021 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10022 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10023 | run_test "SSL async private: sign, delay=0" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10024 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10025 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10026 | "$P_CLI" \ |
| 10027 | 0 \ |
| 10028 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10029 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10030 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10031 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10032 | run_test "SSL async private: sign, delay=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10033 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10034 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10035 | "$P_CLI" \ |
| 10036 | 0 \ |
| 10037 | -s "Async sign callback: using key slot " \ |
| 10038 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10039 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 10040 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 10041 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 10042 | run_test "SSL async private: sign, delay=2" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10043 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 10044 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 10045 | "$P_CLI" \ |
| 10046 | 0 \ |
| 10047 | -s "Async sign callback: using key slot " \ |
| 10048 | -U "Async sign callback: using key slot " \ |
| 10049 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 10050 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 10051 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 10052 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10053 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 10054 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 10055 | run_test "SSL async private: sign, SNI" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10056 | "$P_SRV force_version=tls12 debug_level=3 \ |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 10057 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10058 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 10059 | 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] | 10060 | "$P_CLI server_name=polarssl.example" \ |
| 10061 | 0 \ |
| 10062 | -s "Async sign callback: using key slot " \ |
| 10063 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 10064 | -s "parse ServerName extension" \ |
| 10065 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 10066 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 10067 | |
| 10068 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10069 | run_test "SSL async private: decrypt, delay=0" \ |
| 10070 | "$P_SRV \ |
| 10071 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 10072 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10073 | 0 \ |
| 10074 | -s "Async decrypt callback: using key slot " \ |
| 10075 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10076 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10077 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10078 | run_test "SSL async private: decrypt, delay=1" \ |
| 10079 | "$P_SRV \ |
| 10080 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 10081 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10082 | 0 \ |
| 10083 | -s "Async decrypt callback: using key slot " \ |
| 10084 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 10085 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10086 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10087 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10088 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10089 | "$P_SRV psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10090 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10091 | "$P_CLI psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10092 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 10093 | 0 \ |
| 10094 | -s "Async decrypt callback: using key slot " \ |
| 10095 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10096 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10097 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10098 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10099 | "$P_SRV psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10100 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10101 | "$P_CLI psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10102 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 10103 | 0 \ |
| 10104 | -s "Async decrypt callback: using key slot " \ |
| 10105 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 10106 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10107 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10108 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10109 | run_test "SSL async private: sign callback not present" \ |
| 10110 | "$P_SRV \ |
| 10111 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10112 | "$P_CLI force_version=tls12; [ \$? -eq 1 ] && |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10113 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10114 | 0 \ |
| 10115 | -S "Async sign callback" \ |
| 10116 | -s "! mbedtls_ssl_handshake returned" \ |
| 10117 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 10118 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 10119 | -s "Successful connection" |
| 10120 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10121 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10122 | run_test "SSL async private: decrypt callback not present" \ |
| 10123 | "$P_SRV debug_level=1 \ |
| 10124 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 10125 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 10126 | [ \$? -eq 1 ] && $P_CLI force_version=tls12" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10127 | 0 \ |
| 10128 | -S "Async decrypt callback" \ |
| 10129 | -s "! mbedtls_ssl_handshake returned" \ |
| 10130 | -s "got no RSA private key" \ |
| 10131 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 10132 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10133 | |
| 10134 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10135 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10136 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10137 | "$P_SRV \ |
| 10138 | async_operations=s async_private_delay1=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10139 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10140 | 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] | 10141 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10142 | 0 \ |
| 10143 | -s "Async sign callback: using key slot 0," \ |
| 10144 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10145 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10146 | |
| 10147 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10148 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10149 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10150 | "$P_SRV \ |
| 10151 | async_operations=s async_private_delay2=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10152 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10153 | 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] | 10154 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10155 | 0 \ |
| 10156 | -s "Async sign callback: using key slot 0," \ |
| 10157 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10158 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10159 | |
| 10160 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10161 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 10162 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10163 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 10164 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10165 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10166 | 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] | 10167 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10168 | 0 \ |
| 10169 | -s "Async sign callback: using key slot 1," \ |
| 10170 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10171 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10172 | |
| 10173 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10174 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10175 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10176 | "$P_SRV \ |
| 10177 | async_operations=s async_private_delay1=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10178 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10179 | 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] | 10180 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10181 | 0 \ |
| 10182 | -s "Async sign callback: no key matches this certificate." |
| 10183 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10184 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10185 | run_test "SSL async private: sign, error in start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10186 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10187 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10188 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10189 | "$P_CLI" \ |
| 10190 | 1 \ |
| 10191 | -s "Async sign callback: injected error" \ |
| 10192 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 10193 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10194 | -s "! mbedtls_ssl_handshake returned" |
| 10195 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10196 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10197 | run_test "SSL async private: sign, cancel after start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10198 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10199 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10200 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10201 | "$P_CLI" \ |
| 10202 | 1 \ |
| 10203 | -s "Async sign callback: using key slot " \ |
| 10204 | -S "Async resume" \ |
| 10205 | -s "Async cancel" |
| 10206 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10207 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10208 | run_test "SSL async private: sign, error in resume" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10209 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10210 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10211 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10212 | "$P_CLI" \ |
| 10213 | 1 \ |
| 10214 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10215 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 10216 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10217 | -s "! mbedtls_ssl_handshake returned" |
| 10218 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10219 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10220 | run_test "SSL async private: decrypt, error in start" \ |
| 10221 | "$P_SRV \ |
| 10222 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10223 | async_private_error=1" \ |
| 10224 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10225 | 1 \ |
| 10226 | -s "Async decrypt callback: injected error" \ |
| 10227 | -S "Async resume" \ |
| 10228 | -S "Async cancel" \ |
| 10229 | -s "! mbedtls_ssl_handshake returned" |
| 10230 | |
| 10231 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 10232 | run_test "SSL async private: decrypt, cancel after start" \ |
| 10233 | "$P_SRV \ |
| 10234 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10235 | async_private_error=2" \ |
| 10236 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10237 | 1 \ |
| 10238 | -s "Async decrypt callback: using key slot " \ |
| 10239 | -S "Async resume" \ |
| 10240 | -s "Async cancel" |
| 10241 | |
| 10242 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 10243 | run_test "SSL async private: decrypt, error in resume" \ |
| 10244 | "$P_SRV \ |
| 10245 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10246 | async_private_error=3" \ |
| 10247 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10248 | 1 \ |
| 10249 | -s "Async decrypt callback: using key slot " \ |
| 10250 | -s "Async resume callback: decrypt done but injected error" \ |
| 10251 | -S "Async cancel" \ |
| 10252 | -s "! mbedtls_ssl_handshake returned" |
| 10253 | |
| 10254 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10255 | run_test "SSL async private: cancel after start then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10256 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10257 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10258 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10259 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 10260 | 0 \ |
| 10261 | -s "Async cancel" \ |
| 10262 | -s "! mbedtls_ssl_handshake returned" \ |
| 10263 | -s "Async resume" \ |
| 10264 | -s "Successful connection" |
| 10265 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10266 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10267 | run_test "SSL async private: error in resume then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10268 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10269 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10270 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10271 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 10272 | 0 \ |
| 10273 | -s "! mbedtls_ssl_handshake returned" \ |
| 10274 | -s "Async resume" \ |
| 10275 | -s "Successful connection" |
| 10276 | |
| 10277 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10278 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 10279 | # Note: the function "detect_required_features()" is not able to detect more than |
| 10280 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 10281 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 10282 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10283 | 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] | 10284 | "$P_SRV \ |
| 10285 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10286 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10287 | 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] | 10288 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 10289 | [ \$? -eq 1 ] && |
| 10290 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10291 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 10292 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10293 | -S "Async resume" \ |
| 10294 | -s "Async cancel" \ |
| 10295 | -s "! mbedtls_ssl_handshake returned" \ |
| 10296 | -s "Async sign callback: no key matches this certificate." \ |
| 10297 | -s "Successful connection" |
| 10298 | |
| 10299 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10300 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 10301 | # Note: the function "detect_required_features()" is not able to detect more than |
| 10302 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 10303 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 10304 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10305 | 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] | 10306 | "$P_SRV \ |
| 10307 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10308 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10309 | 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] | 10310 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 10311 | [ \$? -eq 1 ] && |
| 10312 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10313 | 0 \ |
| 10314 | -s "Async resume" \ |
| 10315 | -s "! mbedtls_ssl_handshake returned" \ |
| 10316 | -s "Async sign callback: no key matches this certificate." \ |
| 10317 | -s "Successful connection" |
| 10318 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10319 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10320 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10321 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10322 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10323 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10324 | exchanges=2 renegotiation=1" \ |
| 10325 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10326 | 0 \ |
| 10327 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10328 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10329 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10330 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10331 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10332 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10333 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10334 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10335 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10336 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 10337 | 0 \ |
| 10338 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10339 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 10340 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10341 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10342 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10343 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10344 | "$P_SRV \ |
| 10345 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10346 | exchanges=2 renegotiation=1" \ |
| 10347 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 10348 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10349 | 0 \ |
| 10350 | -s "Async decrypt callback: using key slot " \ |
| 10351 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10352 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10353 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10354 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10355 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10356 | "$P_SRV \ |
| 10357 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10358 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10359 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 10360 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10361 | 0 \ |
| 10362 | -s "Async decrypt callback: using key slot " \ |
| 10363 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10364 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10365 | # Tests for ECC extensions (rfc 4492) |
| 10366 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10367 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10368 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10369 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 10370 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10371 | "$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] | 10372 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 10373 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10374 | -C "client hello, adding supported_point_formats extension" \ |
| 10375 | -S "found supported elliptic curves extension" \ |
| 10376 | -S "found supported point formats extension" |
| 10377 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10378 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10379 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10380 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10381 | "$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] | 10382 | "$P_CLI debug_level=3" \ |
| 10383 | 0 \ |
| 10384 | -C "found supported_point_formats extension" \ |
| 10385 | -S "server hello, supported_point_formats extension" |
| 10386 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10387 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10388 | run_test "Force an ECC ciphersuite in the client side" \ |
| 10389 | "$P_SRV debug_level=3" \ |
| 10390 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10391 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 10392 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10393 | -c "client hello, adding supported_point_formats extension" \ |
| 10394 | -s "found supported elliptic curves extension" \ |
| 10395 | -s "found supported point formats extension" |
| 10396 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10397 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10398 | run_test "Force an ECC ciphersuite in the server side" \ |
| 10399 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10400 | "$P_CLI debug_level=3" \ |
| 10401 | 0 \ |
| 10402 | -c "found supported_point_formats extension" \ |
| 10403 | -s "server hello, supported_point_formats extension" |
| 10404 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10405 | # Tests for DTLS HelloVerifyRequest |
| 10406 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10407 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10408 | run_test "DTLS cookie: enabled" \ |
| 10409 | "$P_SRV dtls=1 debug_level=2" \ |
| 10410 | "$P_CLI dtls=1 debug_level=2" \ |
| 10411 | 0 \ |
| 10412 | -s "cookie verification failed" \ |
| 10413 | -s "cookie verification passed" \ |
| 10414 | -S "cookie verification skipped" \ |
| 10415 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10416 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10417 | -S "SSL - The requested feature is not available" |
| 10418 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10419 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10420 | run_test "DTLS cookie: disabled" \ |
| 10421 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 10422 | "$P_CLI dtls=1 debug_level=2" \ |
| 10423 | 0 \ |
| 10424 | -S "cookie verification failed" \ |
| 10425 | -S "cookie verification passed" \ |
| 10426 | -s "cookie verification skipped" \ |
| 10427 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10428 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10429 | -S "SSL - The requested feature is not available" |
| 10430 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10431 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10432 | run_test "DTLS cookie: default (failing)" \ |
| 10433 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 10434 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 10435 | 1 \ |
| 10436 | -s "cookie verification failed" \ |
| 10437 | -S "cookie verification passed" \ |
| 10438 | -S "cookie verification skipped" \ |
| 10439 | -C "received hello verify request" \ |
| 10440 | -S "hello verification requested" \ |
| 10441 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10442 | |
| 10443 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10444 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10445 | run_test "DTLS cookie: enabled, IPv6" \ |
| 10446 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 10447 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 10448 | 0 \ |
| 10449 | -s "cookie verification failed" \ |
| 10450 | -s "cookie verification passed" \ |
| 10451 | -S "cookie verification skipped" \ |
| 10452 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10453 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10454 | -S "SSL - The requested feature is not available" |
| 10455 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10456 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 10457 | run_test "DTLS cookie: enabled, nbio" \ |
| 10458 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 10459 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10460 | 0 \ |
| 10461 | -s "cookie verification failed" \ |
| 10462 | -s "cookie verification passed" \ |
| 10463 | -S "cookie verification skipped" \ |
| 10464 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10465 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 10466 | -S "SSL - The requested feature is not available" |
| 10467 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10468 | # Tests for client reconnecting from the same port with DTLS |
| 10469 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10470 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10471 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10472 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10473 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 10474 | "$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] | 10475 | 0 \ |
| 10476 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10477 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10478 | -S "Client initiated reconnection from same port" |
| 10479 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10480 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10481 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10482 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10483 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 10484 | "$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] | 10485 | 0 \ |
| 10486 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10487 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10488 | -s "Client initiated reconnection from same port" |
| 10489 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10490 | 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] | 10491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10492 | 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] | 10493 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 10494 | "$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] | 10495 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10496 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10497 | -s "Client initiated reconnection from same port" |
| 10498 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10499 | 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] | 10500 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10501 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 10502 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 10503 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 10504 | 0 \ |
| 10505 | -S "The operation timed out" \ |
| 10506 | -s "Client initiated reconnection from same port" |
| 10507 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10508 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10509 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 10510 | "$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] | 10511 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 10512 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10513 | -s "The operation timed out" \ |
| 10514 | -S "Client initiated reconnection from same port" |
| 10515 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10516 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 10517 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 10518 | -p "$P_PXY inject_clihlo=1" \ |
| 10519 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 10520 | "$P_CLI dtls=1 exchanges=2" \ |
| 10521 | 0 \ |
| 10522 | -s "possible client reconnect from the same port" \ |
| 10523 | -S "Client initiated reconnection from same port" |
| 10524 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10525 | # Tests for various cases of client authentication with DTLS |
| 10526 | # (focused on handshake flows and message parsing) |
| 10527 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10528 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10529 | run_test "DTLS client auth: required" \ |
| 10530 | "$P_SRV dtls=1 auth_mode=required" \ |
| 10531 | "$P_CLI dtls=1" \ |
| 10532 | 0 \ |
| 10533 | -s "Verifying peer X.509 certificate... ok" |
| 10534 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10535 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10536 | run_test "DTLS client auth: optional, client has no cert" \ |
| 10537 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 10538 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 10539 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10540 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10541 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10542 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10543 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10544 | "$P_SRV dtls=1 auth_mode=none" \ |
| 10545 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 10546 | 0 \ |
| 10547 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10548 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10549 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 10550 | run_test "DTLS wrong PSK: badmac alert" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10551 | "$P_SRV dtls=1 psk=73776f726466697368 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
Gilles Peskine | f9f3d21 | 2024-05-13 21:06:26 +0200 | [diff] [blame] | 10552 | "$P_CLI dtls=1 psk=73776f726466697374" \ |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 10553 | 1 \ |
| 10554 | -s "SSL - Verification of the message MAC failed" \ |
| 10555 | -c "SSL - A fatal alert message was received from our peer" |
| 10556 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10557 | # Tests for receiving fragmented handshake messages with DTLS |
| 10558 | |
| 10559 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10560 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10561 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 10562 | "$G_SRV -u --mtu 2048 -a" \ |
| 10563 | "$P_CLI dtls=1 debug_level=2" \ |
| 10564 | 0 \ |
| 10565 | -C "found fragmented DTLS handshake message" \ |
| 10566 | -C "error" |
| 10567 | |
| 10568 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10569 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10570 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 10571 | "$G_SRV -u --mtu 512" \ |
| 10572 | "$P_CLI dtls=1 debug_level=2" \ |
| 10573 | 0 \ |
| 10574 | -c "found fragmented DTLS handshake message" \ |
| 10575 | -C "error" |
| 10576 | |
| 10577 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10578 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10579 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 10580 | "$G_SRV -u --mtu 128" \ |
| 10581 | "$P_CLI dtls=1 debug_level=2" \ |
| 10582 | 0 \ |
| 10583 | -c "found fragmented DTLS handshake message" \ |
| 10584 | -C "error" |
| 10585 | |
| 10586 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10587 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10588 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 10589 | "$G_SRV -u --mtu 128" \ |
| 10590 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10591 | 0 \ |
| 10592 | -c "found fragmented DTLS handshake message" \ |
| 10593 | -C "error" |
| 10594 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10595 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10596 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
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 | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10598 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 10599 | "$G_SRV -u --mtu 256" \ |
| 10600 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 10601 | 0 \ |
| 10602 | -c "found fragmented DTLS handshake message" \ |
| 10603 | -c "client hello, adding renegotiation extension" \ |
| 10604 | -c "found renegotiation extension" \ |
| 10605 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 10606 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10607 | -C "error" \ |
| 10608 | -s "Extra-header:" |
| 10609 | |
| 10610 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10611 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10612 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10613 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 10614 | "$G_SRV -u --mtu 256" \ |
| 10615 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 10616 | 0 \ |
| 10617 | -c "found fragmented DTLS handshake message" \ |
| 10618 | -c "client hello, adding renegotiation extension" \ |
| 10619 | -c "found renegotiation extension" \ |
| 10620 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 10621 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10622 | -C "error" \ |
| 10623 | -s "Extra-header:" |
| 10624 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10625 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10626 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 10627 | "$O_SRV -dtls -mtu 2048" \ |
| 10628 | "$P_CLI dtls=1 debug_level=2" \ |
| 10629 | 0 \ |
| 10630 | -C "found fragmented DTLS handshake message" \ |
| 10631 | -C "error" |
| 10632 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10633 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10634 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 10635 | "$O_SRV -dtls -mtu 256" \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10636 | "$P_CLI dtls=1 debug_level=2" \ |
| 10637 | 0 \ |
| 10638 | -c "found fragmented DTLS handshake message" \ |
| 10639 | -C "error" |
| 10640 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10641 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10642 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 10643 | "$O_SRV -dtls -mtu 256" \ |
| 10644 | "$P_CLI dtls=1 debug_level=2" \ |
| 10645 | 0 \ |
| 10646 | -c "found fragmented DTLS handshake message" \ |
| 10647 | -C "error" |
| 10648 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10649 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10650 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 10651 | "$O_SRV -dtls -mtu 256" \ |
| 10652 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10653 | 0 \ |
| 10654 | -c "found fragmented DTLS handshake message" \ |
| 10655 | -C "error" |
| 10656 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10657 | # Tests for sending fragmented handshake messages with DTLS |
| 10658 | # |
| 10659 | # Use client auth when we need the client to send large messages, |
| 10660 | # and use large cert chains on both sides too (the long chains we have all use |
| 10661 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 10662 | # Sizes reached (UDP payload): |
| 10663 | # - 2037B for server certificate |
| 10664 | # - 1542B for client certificate |
| 10665 | # - 1013B for newsessionticket |
| 10666 | # - all others below 512B |
| 10667 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 10668 | |
| 10669 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10670 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10671 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10672 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10673 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10674 | run_test "DTLS fragmenting: none (for reference)" \ |
| 10675 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10676 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10677 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10678 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10679 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10680 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10681 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10682 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10683 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10684 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10685 | 0 \ |
| 10686 | -S "found fragmented DTLS handshake message" \ |
| 10687 | -C "found fragmented DTLS handshake message" \ |
| 10688 | -C "error" |
| 10689 | |
| 10690 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10691 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10692 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10693 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10694 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10695 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10696 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10697 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10698 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10699 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10700 | max_frag_len=1024" \ |
| 10701 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10702 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10703 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10704 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10705 | max_frag_len=2048" \ |
| 10706 | 0 \ |
| 10707 | -S "found fragmented DTLS handshake message" \ |
| 10708 | -c "found fragmented DTLS handshake message" \ |
| 10709 | -C "error" |
| 10710 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 10711 | # With the MFL extension, the server has no way of forcing |
| 10712 | # the client to not exceed a certain MTU; hence, the following |
| 10713 | # test can't be replicated with an MTU proxy such as the one |
| 10714 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10715 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10716 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10717 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10718 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10719 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10720 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10721 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10722 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10723 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10724 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10725 | max_frag_len=512" \ |
| 10726 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10727 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10728 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10729 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 10730 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10731 | 0 \ |
| 10732 | -S "found fragmented DTLS handshake message" \ |
| 10733 | -c "found fragmented DTLS handshake message" \ |
| 10734 | -C "error" |
| 10735 | |
| 10736 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10737 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10738 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10739 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10740 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10741 | 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] | 10742 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10743 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10744 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10745 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10746 | max_frag_len=2048" \ |
| 10747 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10748 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10749 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10750 | hs_timeout=2500-60000 \ |
| 10751 | max_frag_len=1024" \ |
| 10752 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10753 | -S "found fragmented DTLS handshake message" \ |
| 10754 | -c "found fragmented DTLS handshake message" \ |
| 10755 | -C "error" |
| 10756 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10757 | # While not required by the standard defining the MFL extension |
| 10758 | # (according to which it only applies to records, not to datagrams), |
| 10759 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 10760 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 10761 | # to the peer. |
| 10762 | # The next test checks that no datagrams significantly larger than the |
| 10763 | # negotiated MFL are sent. |
| 10764 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10765 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10766 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10767 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10768 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10769 | 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] | 10770 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10771 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10772 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10773 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10774 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10775 | max_frag_len=2048" \ |
| 10776 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10777 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10778 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10779 | hs_timeout=2500-60000 \ |
| 10780 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10781 | 0 \ |
| 10782 | -S "found fragmented DTLS handshake message" \ |
| 10783 | -c "found fragmented DTLS handshake message" \ |
| 10784 | -C "error" |
| 10785 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10786 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10787 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10788 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10789 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10790 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10791 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10792 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10793 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10794 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10795 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10796 | max_frag_len=2048" \ |
| 10797 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10798 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10799 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10800 | hs_timeout=2500-60000 \ |
| 10801 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10802 | 0 \ |
| 10803 | -s "found fragmented DTLS handshake message" \ |
| 10804 | -c "found fragmented DTLS handshake message" \ |
| 10805 | -C "error" |
| 10806 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10807 | # While not required by the standard defining the MFL extension |
| 10808 | # (according to which it only applies to records, not to datagrams), |
| 10809 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 10810 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 10811 | # to the peer. |
| 10812 | # The next test checks that no datagrams significantly larger than the |
| 10813 | # negotiated MFL are sent. |
| 10814 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10815 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10816 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10817 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10818 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10819 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 10820 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10821 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10822 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10823 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10824 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10825 | max_frag_len=2048" \ |
| 10826 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10827 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10828 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10829 | hs_timeout=2500-60000 \ |
| 10830 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10831 | 0 \ |
| 10832 | -s "found fragmented DTLS handshake message" \ |
| 10833 | -c "found fragmented DTLS handshake message" \ |
| 10834 | -C "error" |
| 10835 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10836 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10837 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10838 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10839 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10840 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 10841 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10842 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10843 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10844 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10845 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10846 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10847 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10848 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10849 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10850 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10851 | 0 \ |
| 10852 | -S "found fragmented DTLS handshake message" \ |
| 10853 | -C "found fragmented DTLS handshake message" \ |
| 10854 | -C "error" |
| 10855 | |
| 10856 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10857 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10858 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10859 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10860 | run_test "DTLS fragmenting: client (MTU)" \ |
| 10861 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10862 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10863 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10864 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10865 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10866 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10867 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10868 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10869 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10870 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10871 | 0 \ |
| 10872 | -s "found fragmented DTLS handshake message" \ |
| 10873 | -C "found fragmented DTLS handshake message" \ |
| 10874 | -C "error" |
| 10875 | |
| 10876 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10877 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10878 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10879 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10880 | run_test "DTLS fragmenting: server (MTU)" \ |
| 10881 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10882 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10883 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10884 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10885 | mtu=512" \ |
| 10886 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10887 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10888 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10889 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10890 | mtu=2048" \ |
| 10891 | 0 \ |
| 10892 | -S "found fragmented DTLS handshake message" \ |
| 10893 | -c "found fragmented DTLS handshake message" \ |
| 10894 | -C "error" |
| 10895 | |
| 10896 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10897 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10898 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10899 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10900 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10901 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10902 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10903 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10904 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10905 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 10906 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10907 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10908 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10909 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10910 | hs_timeout=2500-60000 \ |
| 10911 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10912 | 0 \ |
| 10913 | -s "found fragmented DTLS handshake message" \ |
| 10914 | -c "found fragmented DTLS handshake message" \ |
| 10915 | -C "error" |
| 10916 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10917 | # 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] | 10918 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10919 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10920 | requires_hash_alg SHA_256 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10921 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10922 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 10923 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 10924 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10925 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10926 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10927 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 10928 | mtu=512" \ |
| 10929 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10930 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10931 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10932 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10933 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10934 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10935 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10936 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10937 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10938 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10939 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10940 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10941 | # 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] | 10942 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 10943 | # retransmissions, but in some cases (like both the server and client using |
| 10944 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 10945 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 10946 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10947 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10948 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10949 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 10950 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10951 | -p "$P_PXY mtu=508" \ |
| 10952 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10953 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10954 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10955 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10956 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10957 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10958 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10959 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10960 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10961 | 0 \ |
| 10962 | -s "found fragmented DTLS handshake message" \ |
| 10963 | -c "found fragmented DTLS handshake message" \ |
| 10964 | -C "error" |
| 10965 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10966 | # 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] | 10967 | only_with_valgrind |
| 10968 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10969 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10970 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 10971 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10972 | -p "$P_PXY mtu=508" \ |
| 10973 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10974 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10975 | key_file=$DATA_FILES_PATH/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10976 | hs_timeout=250-10000" \ |
| 10977 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10978 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10979 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10980 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10981 | hs_timeout=250-10000" \ |
| 10982 | 0 \ |
| 10983 | -s "found fragmented DTLS handshake message" \ |
| 10984 | -c "found fragmented DTLS handshake message" \ |
| 10985 | -C "error" |
| 10986 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10987 | # 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] | 10988 | # OTOH the client might resend if the server is to slow to reset after sending |
| 10989 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10990 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10991 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10992 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10993 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10994 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10995 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10996 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10997 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10998 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10999 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11000 | hs_timeout=10000-60000 \ |
| 11001 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11002 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11003 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11004 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11005 | hs_timeout=10000-60000 \ |
| 11006 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11007 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11008 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11009 | -s "found fragmented DTLS handshake message" \ |
| 11010 | -c "found fragmented DTLS handshake message" \ |
| 11011 | -C "error" |
| 11012 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11013 | # 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] | 11014 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 11015 | # OTOH the client might resend if the server is to slow to reset after sending |
| 11016 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11017 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11018 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11019 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11020 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11021 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11022 | -p "$P_PXY mtu=512" \ |
| 11023 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11024 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11025 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11026 | hs_timeout=10000-60000 \ |
| 11027 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11028 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11029 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11030 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11031 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 11032 | hs_timeout=10000-60000 \ |
| 11033 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11034 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11035 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11036 | -s "found fragmented DTLS handshake message" \ |
| 11037 | -c "found fragmented DTLS handshake message" \ |
| 11038 | -C "error" |
| 11039 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11040 | not_with_valgrind # spurious autoreduction due to timeout |
| 11041 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11042 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11043 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11044 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11045 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11046 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11047 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11048 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11049 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11050 | hs_timeout=10000-60000 \ |
| 11051 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11052 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11053 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11054 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11055 | hs_timeout=10000-60000 \ |
| 11056 | mtu=1024 nbio=2" \ |
| 11057 | 0 \ |
| 11058 | -S "autoreduction" \ |
| 11059 | -s "found fragmented DTLS handshake message" \ |
| 11060 | -c "found fragmented DTLS handshake message" \ |
| 11061 | -C "error" |
| 11062 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11063 | # 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] | 11064 | not_with_valgrind # spurious autoreduction due to timeout |
| 11065 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11066 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11067 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11068 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 11069 | -p "$P_PXY mtu=512" \ |
| 11070 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11071 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11072 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11073 | hs_timeout=10000-60000 \ |
| 11074 | mtu=512 nbio=2" \ |
| 11075 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11076 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11077 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11078 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 11079 | hs_timeout=10000-60000 \ |
| 11080 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11081 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11082 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11083 | -s "found fragmented DTLS handshake message" \ |
| 11084 | -c "found fragmented DTLS handshake message" \ |
| 11085 | -C "error" |
| 11086 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11087 | # 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] | 11088 | # This ensures things still work after session_reset(). |
| 11089 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11090 | # Since we don't support reading fragmented ClientHello yet, |
| 11091 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 11092 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11093 | # An autoreduction on the client-side might happen if the server is |
| 11094 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 11095 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11096 | # resumed listening, which would result in a spurious autoreduction. |
| 11097 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11098 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11099 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11100 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11101 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 11102 | -p "$P_PXY mtu=1450" \ |
| 11103 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11104 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11105 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11106 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11107 | mtu=1450" \ |
| 11108 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11109 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11110 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11111 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11112 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 11113 | 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] | 11114 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11115 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11116 | -s "found fragmented DTLS handshake message" \ |
| 11117 | -c "found fragmented DTLS handshake message" \ |
| 11118 | -C "error" |
| 11119 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11120 | # An autoreduction on the client-side might happen if the server is |
| 11121 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11122 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11123 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11124 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11125 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11126 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11127 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11128 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 11129 | -p "$P_PXY mtu=512" \ |
| 11130 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11131 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11132 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11133 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11134 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11135 | mtu=512" \ |
| 11136 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11137 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11138 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11139 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Ronald Cron | 60f7666 | 2023-11-28 17:52:42 +0100 | [diff] [blame] | 11140 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11141 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11142 | mtu=512" \ |
| 11143 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11144 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11145 | -s "found fragmented DTLS handshake message" \ |
| 11146 | -c "found fragmented DTLS handshake message" \ |
| 11147 | -C "error" |
| 11148 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11149 | # An autoreduction on the client-side might happen if the server is |
| 11150 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11151 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11152 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11153 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11154 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11155 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11156 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11157 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 11158 | -p "$P_PXY mtu=512" \ |
| 11159 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11160 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11161 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11162 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11163 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11164 | mtu=512" \ |
| 11165 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11166 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11167 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11168 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11169 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11170 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11171 | mtu=512" \ |
| 11172 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11173 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11174 | -s "found fragmented DTLS handshake message" \ |
| 11175 | -c "found fragmented DTLS handshake message" \ |
| 11176 | -C "error" |
| 11177 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11178 | # An autoreduction on the client-side might happen if the server is |
| 11179 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11180 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11181 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11182 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11183 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11184 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11185 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11186 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11187 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11188 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11189 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11190 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11191 | exchanges=2 renegotiation=1 \ |
| 11192 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11193 | hs_timeout=10000-60000 \ |
| 11194 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11195 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11196 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11197 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11198 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11199 | hs_timeout=10000-60000 \ |
| 11200 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11201 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11202 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11203 | -s "found fragmented DTLS handshake message" \ |
| 11204 | -c "found fragmented DTLS handshake message" \ |
| 11205 | -C "error" |
| 11206 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11207 | # An autoreduction on the client-side might happen if the server is |
| 11208 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11209 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11210 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11211 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11212 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11213 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11214 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11215 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11216 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11217 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11218 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 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 | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11221 | exchanges=2 renegotiation=1 \ |
| 11222 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11223 | hs_timeout=10000-60000 \ |
| 11224 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11225 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11226 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11227 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11228 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11229 | hs_timeout=10000-60000 \ |
| 11230 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11231 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11232 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11233 | -s "found fragmented DTLS handshake message" \ |
| 11234 | -c "found fragmented DTLS handshake message" \ |
| 11235 | -C "error" |
| 11236 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11237 | # An autoreduction on the client-side might happen if the server is |
| 11238 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11239 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11240 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11241 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11242 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11243 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11244 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11245 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11246 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11247 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11248 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11249 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11250 | exchanges=2 renegotiation=1 \ |
| 11251 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11252 | hs_timeout=10000-60000 \ |
| 11253 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11254 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11255 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11256 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11257 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11258 | hs_timeout=10000-60000 \ |
| 11259 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11260 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11261 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11262 | -s "found fragmented DTLS handshake message" \ |
| 11263 | -c "found fragmented DTLS handshake message" \ |
| 11264 | -C "error" |
| 11265 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11266 | # 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] | 11267 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11268 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11269 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11270 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11271 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 11272 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11273 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11274 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11275 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11276 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11277 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11278 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11279 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11280 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11281 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11282 | 0 \ |
| 11283 | -s "found fragmented DTLS handshake message" \ |
| 11284 | -c "found fragmented DTLS handshake message" \ |
| 11285 | -C "error" |
| 11286 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11287 | # 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] | 11288 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11289 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11290 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11291 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11292 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 11293 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 11294 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11295 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11296 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11297 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 11298 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11299 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11300 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11301 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11302 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 11303 | 0 \ |
| 11304 | -s "found fragmented DTLS handshake message" \ |
| 11305 | -c "found fragmented DTLS handshake message" \ |
| 11306 | -C "error" |
| 11307 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11308 | # interop tests for DTLS fragmentating with reliable connection |
| 11309 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11310 | # here and below we just want to test that the we fragment in a way that |
| 11311 | # pleases other implementations, so we don't need the peer to fragment |
| 11312 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11313 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 11314 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11315 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11316 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 11317 | "$G_SRV -u" \ |
| 11318 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11319 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11320 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11321 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11322 | 0 \ |
| 11323 | -c "fragmenting handshake message" \ |
| 11324 | -C "error" |
| 11325 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 11326 | # We use --insecure for the GnuTLS client because it expects |
| 11327 | # the hostname / IP it connects to to be the name used in the |
| 11328 | # certificate obtained from the server. Here, however, it |
| 11329 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 11330 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 11331 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 11332 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11333 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11334 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 11335 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 11336 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11337 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11338 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Valerio Setti | 3b2c028 | 2023-03-08 10:22:29 +0100 | [diff] [blame] | 11339 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11340 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11341 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11342 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 11343 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11344 | 0 \ |
| 11345 | -s "fragmenting handshake message" |
| 11346 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11347 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11348 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11349 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11350 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 11351 | "$O_SRV -dtls1_2 -verify 10" \ |
| 11352 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11353 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11354 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11355 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11356 | 0 \ |
| 11357 | -c "fragmenting handshake message" \ |
| 11358 | -C "error" |
| 11359 | |
| 11360 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11361 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11362 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11363 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 11364 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11365 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11366 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11367 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11368 | "$O_CLI -dtls1_2" \ |
| 11369 | 0 \ |
| 11370 | -s "fragmenting handshake message" |
| 11371 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11372 | # interop tests for DTLS fragmentating with unreliable connection |
| 11373 | # |
| 11374 | # again we just want to test that the we fragment in a way that |
| 11375 | # pleases other implementations, so we don't need the peer to fragment |
| 11376 | requires_gnutls_next |
| 11377 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11378 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11379 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11380 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11381 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 11382 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11383 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11384 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11385 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11386 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11387 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11388 | 0 \ |
| 11389 | -c "fragmenting handshake message" \ |
| 11390 | -C "error" |
| 11391 | |
| 11392 | requires_gnutls_next |
| 11393 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11394 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11395 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11396 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11397 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 11398 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11399 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11400 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11401 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11402 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11403 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11404 | 0 \ |
| 11405 | -s "fragmenting handshake message" |
| 11406 | |
Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 11407 | ## The test below requires 1.1.1a or higher version of openssl, otherwise |
| 11408 | ## 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] | 11409 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11410 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11411 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11412 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11413 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11414 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 11415 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11416 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11417 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11418 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11419 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11420 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11421 | 0 \ |
| 11422 | -c "fragmenting handshake message" \ |
| 11423 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11424 | |
Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 11425 | ## the test below will time out with certain seed. |
Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 11426 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 11427 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11428 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11429 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11430 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11431 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11432 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 11433 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11434 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11435 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11436 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11437 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11438 | "$O_CLI -dtls1_2" \ |
| 11439 | 0 \ |
| 11440 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11441 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11442 | # Tests for DTLS-SRTP (RFC 5764) |
| 11443 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11444 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11445 | run_test "DTLS-SRTP all profiles supported" \ |
| 11446 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11447 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11448 | 0 \ |
| 11449 | -s "found use_srtp extension" \ |
| 11450 | -s "found srtp profile" \ |
| 11451 | -s "selected srtp profile" \ |
| 11452 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11453 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11454 | -c "client hello, adding use_srtp extension" \ |
| 11455 | -c "found use_srtp extension" \ |
| 11456 | -c "found srtp profile" \ |
| 11457 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11458 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11459 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11460 | -C "error" |
| 11461 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11462 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11463 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11464 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11465 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 11466 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11467 | "$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] | 11468 | 0 \ |
| 11469 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11470 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 11471 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11472 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11473 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11474 | -c "client hello, adding use_srtp extension" \ |
| 11475 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11476 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11477 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11478 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11479 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11480 | -C "error" |
| 11481 | |
| 11482 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11483 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11484 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11485 | "$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] | 11486 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11487 | 0 \ |
| 11488 | -s "found use_srtp extension" \ |
| 11489 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11490 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11491 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11492 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11493 | -c "client hello, adding use_srtp extension" \ |
| 11494 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11495 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11496 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11497 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11498 | -g "find_in_both '^ *Keying material: [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 server and Client support only one matching profile." \ |
| 11504 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11505 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11506 | 0 \ |
| 11507 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11508 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11509 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 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"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11512 | -c "client hello, adding use_srtp extension" \ |
| 11513 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11514 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11515 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11516 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11517 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11518 | -C "error" |
| 11519 | |
| 11520 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11521 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11522 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 11523 | "$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] | 11524 | "$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] | 11525 | 0 \ |
| 11526 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11527 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11528 | -S "selected srtp profile" \ |
| 11529 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11530 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11531 | -c "client hello, adding use_srtp extension" \ |
| 11532 | -C "found use_srtp extension" \ |
| 11533 | -C "found srtp profile" \ |
| 11534 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11535 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11536 | -C "error" |
| 11537 | |
| 11538 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11539 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11540 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 11541 | "$P_SRV dtls=1 debug_level=3" \ |
| 11542 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11543 | 0 \ |
| 11544 | -s "found use_srtp extension" \ |
| 11545 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11546 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11547 | -c "client hello, adding use_srtp extension" \ |
| 11548 | -C "found use_srtp extension" \ |
| 11549 | -C "found srtp profile" \ |
| 11550 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11551 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11552 | -C "error" |
| 11553 | |
| 11554 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11555 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11556 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 11557 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 11558 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11559 | 0 \ |
| 11560 | -s "found use_srtp extension" \ |
| 11561 | -s "found srtp profile" \ |
| 11562 | -s "selected srtp profile" \ |
| 11563 | -s "server hello, adding use_srtp extension" \ |
| 11564 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11565 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11566 | -c "client hello, adding use_srtp extension" \ |
| 11567 | -c "found use_srtp extension" \ |
| 11568 | -c "found srtp profile" \ |
| 11569 | -c "selected srtp profile" \ |
| 11570 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11571 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11572 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11573 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 11574 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11575 | -C "error" |
| 11576 | |
| 11577 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11578 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11579 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 11580 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11581 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11582 | 0 \ |
| 11583 | -s "found use_srtp extension" \ |
| 11584 | -s "found srtp profile" \ |
| 11585 | -s "selected srtp profile" \ |
| 11586 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11587 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 11588 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11589 | -S "dumping 'using mki' (8 bytes)" \ |
| 11590 | -c "client hello, adding use_srtp extension" \ |
| 11591 | -c "found use_srtp extension" \ |
| 11592 | -c "found srtp profile" \ |
| 11593 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11594 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 11595 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11596 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11597 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11598 | -C "dumping 'received mki' (8 bytes)" \ |
| 11599 | -C "error" |
| 11600 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11601 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11603 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 11604 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11605 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11606 | 0 \ |
| 11607 | -s "found use_srtp extension" \ |
| 11608 | -s "found srtp profile" \ |
| 11609 | -s "selected srtp profile" \ |
| 11610 | -s "server hello, adding use_srtp extension" \ |
| 11611 | -s "DTLS-SRTP key material is"\ |
| 11612 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11613 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 11614 | |
| 11615 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11616 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11617 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 11618 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11619 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11620 | 0 \ |
| 11621 | -s "found use_srtp extension" \ |
| 11622 | -s "found srtp profile" \ |
| 11623 | -s "selected srtp profile" \ |
| 11624 | -s "server hello, adding use_srtp extension" \ |
| 11625 | -s "DTLS-SRTP key material is"\ |
| 11626 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11627 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11628 | |
| 11629 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11630 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11631 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 11632 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11633 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11634 | 0 \ |
| 11635 | -s "found use_srtp extension" \ |
| 11636 | -s "found srtp profile" \ |
| 11637 | -s "selected srtp profile" \ |
| 11638 | -s "server hello, adding use_srtp extension" \ |
| 11639 | -s "DTLS-SRTP key material is"\ |
| 11640 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11641 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11642 | |
| 11643 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11644 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11645 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 11646 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11647 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11648 | 0 \ |
| 11649 | -s "found use_srtp extension" \ |
| 11650 | -s "found srtp profile" \ |
| 11651 | -s "selected srtp profile" \ |
| 11652 | -s "server hello, adding use_srtp extension" \ |
| 11653 | -s "DTLS-SRTP key material is"\ |
| 11654 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11655 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11656 | |
| 11657 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11658 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11659 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 11660 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11661 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11662 | 0 \ |
| 11663 | -s "found use_srtp extension" \ |
| 11664 | -s "found srtp profile" \ |
| 11665 | -s "selected srtp profile" \ |
| 11666 | -s "server hello, adding use_srtp extension" \ |
| 11667 | -s "DTLS-SRTP key material is"\ |
| 11668 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11669 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 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 different profile. openssl client." \ |
| 11674 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 11675 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11676 | 0 \ |
| 11677 | -s "found use_srtp extension" \ |
| 11678 | -s "found srtp profile" \ |
| 11679 | -S "selected srtp profile" \ |
| 11680 | -S "server hello, adding use_srtp extension" \ |
| 11681 | -S "DTLS-SRTP key material is"\ |
| 11682 | -C "SRTP Extension negotiated, profile" |
| 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 doesn't support use_srtp extension. openssl client" \ |
| 11687 | "$P_SRV dtls=1 debug_level=3" \ |
| 11688 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11689 | 0 \ |
| 11690 | -s "found use_srtp extension" \ |
| 11691 | -S "server hello, adding use_srtp extension" \ |
| 11692 | -S "DTLS-SRTP key material is"\ |
| 11693 | -C "SRTP Extension negotiated, profile" |
| 11694 | |
| 11695 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11697 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 11698 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11699 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11700 | 0 \ |
| 11701 | -c "client hello, adding use_srtp extension" \ |
| 11702 | -c "found use_srtp extension" \ |
| 11703 | -c "found srtp profile" \ |
| 11704 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 11705 | -c "DTLS-SRTP key material is"\ |
| 11706 | -C "error" |
| 11707 | |
| 11708 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11710 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 11711 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11712 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11713 | 0 \ |
| 11714 | -c "client hello, adding use_srtp extension" \ |
| 11715 | -c "found use_srtp extension" \ |
| 11716 | -c "found srtp profile" \ |
| 11717 | -c "selected srtp profile" \ |
| 11718 | -c "DTLS-SRTP key material is"\ |
| 11719 | -C "error" |
| 11720 | |
| 11721 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11722 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11723 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 11724 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11725 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11726 | 0 \ |
| 11727 | -c "client hello, adding use_srtp extension" \ |
| 11728 | -c "found use_srtp extension" \ |
| 11729 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11730 | -c "selected srtp profile" \ |
| 11731 | -c "DTLS-SRTP key material is"\ |
| 11732 | -C "error" |
| 11733 | |
| 11734 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11735 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11736 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 11737 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11738 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11739 | 0 \ |
| 11740 | -c "client hello, adding use_srtp extension" \ |
| 11741 | -c "found use_srtp extension" \ |
| 11742 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11743 | -c "selected srtp profile" \ |
| 11744 | -c "DTLS-SRTP key material is"\ |
| 11745 | -C "error" |
| 11746 | |
| 11747 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11748 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11749 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 11750 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11751 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11752 | 0 \ |
| 11753 | -c "client hello, adding use_srtp extension" \ |
| 11754 | -c "found use_srtp extension" \ |
| 11755 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11756 | -c "selected srtp profile" \ |
| 11757 | -c "DTLS-SRTP key material is"\ |
| 11758 | -C "error" |
| 11759 | |
| 11760 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11761 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11762 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 11763 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11764 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 11765 | 0 \ |
| 11766 | -c "client hello, adding use_srtp extension" \ |
| 11767 | -C "found use_srtp extension" \ |
| 11768 | -C "found srtp profile" \ |
| 11769 | -C "selected srtp profile" \ |
| 11770 | -C "DTLS-SRTP key material is"\ |
| 11771 | -C "error" |
| 11772 | |
| 11773 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11774 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11775 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 11776 | "$O_SRV -dtls" \ |
| 11777 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11778 | 0 \ |
| 11779 | -c "client hello, adding use_srtp extension" \ |
| 11780 | -C "found use_srtp extension" \ |
| 11781 | -C "found srtp profile" \ |
| 11782 | -C "selected srtp profile" \ |
| 11783 | -C "DTLS-SRTP key material is"\ |
| 11784 | -C "error" |
| 11785 | |
| 11786 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11787 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11788 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 11789 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11790 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11791 | 0 \ |
| 11792 | -c "client hello, adding use_srtp extension" \ |
| 11793 | -c "found use_srtp extension" \ |
| 11794 | -c "found srtp profile" \ |
| 11795 | -c "selected srtp profile" \ |
| 11796 | -c "DTLS-SRTP key material is"\ |
| 11797 | -c "DTLS-SRTP no mki value negotiated"\ |
| 11798 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11799 | -C "dumping 'received mki' (8 bytes)" \ |
| 11800 | -C "error" |
| 11801 | |
| 11802 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11803 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11804 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11805 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11806 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11807 | "$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] | 11808 | 0 \ |
| 11809 | -s "found use_srtp extension" \ |
| 11810 | -s "found srtp profile" \ |
| 11811 | -s "selected srtp profile" \ |
| 11812 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11813 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11814 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 11815 | |
| 11816 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11817 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11818 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11819 | 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] | 11820 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11821 | "$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] | 11822 | 0 \ |
| 11823 | -s "found use_srtp extension" \ |
| 11824 | -s "found srtp profile" \ |
| 11825 | -s "selected srtp profile" \ |
| 11826 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11827 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11828 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 11829 | |
| 11830 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11831 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11832 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11833 | 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] | 11834 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11835 | "$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] | 11836 | 0 \ |
| 11837 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11838 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11839 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11840 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11841 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11842 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 11843 | |
| 11844 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11845 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11846 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11847 | 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] | 11848 | "$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] | 11849 | "$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] | 11850 | 0 \ |
| 11851 | -s "found use_srtp extension" \ |
| 11852 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11853 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11854 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11855 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11856 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 11857 | |
| 11858 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11859 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11860 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11861 | 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] | 11862 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11863 | "$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] | 11864 | 0 \ |
| 11865 | -s "found use_srtp extension" \ |
| 11866 | -s "found srtp profile" \ |
| 11867 | -s "selected srtp profile" \ |
| 11868 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11869 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11870 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 11871 | |
| 11872 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11873 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11874 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11875 | 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] | 11876 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 11877 | "$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] | 11878 | 0 \ |
| 11879 | -s "found use_srtp extension" \ |
| 11880 | -s "found srtp profile" \ |
| 11881 | -S "selected srtp profile" \ |
| 11882 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11883 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11884 | -C "SRTP profile:" |
| 11885 | |
| 11886 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11887 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11888 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11889 | 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] | 11890 | "$P_SRV dtls=1 debug_level=3" \ |
| 11891 | "$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] | 11892 | 0 \ |
| 11893 | -s "found use_srtp extension" \ |
| 11894 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11895 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11896 | -C "SRTP profile:" |
| 11897 | |
| 11898 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11899 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11900 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11901 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 11902 | "$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" \ |
| 11903 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11904 | 0 \ |
| 11905 | -c "client hello, adding use_srtp extension" \ |
| 11906 | -c "found use_srtp extension" \ |
| 11907 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11908 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11909 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11910 | -C "error" |
| 11911 | |
| 11912 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11913 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11914 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11915 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 11916 | "$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" \ |
| 11917 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11918 | 0 \ |
| 11919 | -c "client hello, adding use_srtp extension" \ |
| 11920 | -c "found use_srtp extension" \ |
| 11921 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11922 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11923 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11924 | -C "error" |
| 11925 | |
| 11926 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11927 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11928 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11929 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 11930 | "$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" \ |
| 11931 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11932 | 0 \ |
| 11933 | -c "client hello, adding use_srtp extension" \ |
| 11934 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11935 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11936 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11937 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11938 | -C "error" |
| 11939 | |
| 11940 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11941 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11942 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11943 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 11944 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11945 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11946 | 0 \ |
| 11947 | -c "client hello, adding use_srtp extension" \ |
| 11948 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11949 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11950 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11951 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11952 | -C "error" |
| 11953 | |
| 11954 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11955 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11956 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11957 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 11958 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11959 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11960 | 0 \ |
| 11961 | -c "client hello, adding use_srtp extension" \ |
| 11962 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11963 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11964 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11965 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11966 | -C "error" |
| 11967 | |
| 11968 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11969 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11970 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11971 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 11972 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11973 | "$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] | 11974 | 0 \ |
| 11975 | -c "client hello, adding use_srtp extension" \ |
| 11976 | -C "found use_srtp extension" \ |
| 11977 | -C "found srtp profile" \ |
| 11978 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11979 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11980 | -C "error" |
| 11981 | |
| 11982 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11983 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11984 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11985 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 11986 | "$G_SRV -u" \ |
| 11987 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11988 | 0 \ |
| 11989 | -c "client hello, adding use_srtp extension" \ |
| 11990 | -C "found use_srtp extension" \ |
| 11991 | -C "found srtp profile" \ |
| 11992 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11993 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11994 | -C "error" |
| 11995 | |
| 11996 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11997 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11998 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11999 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 12000 | "$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" \ |
| 12001 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 12002 | 0 \ |
| 12003 | -c "client hello, adding use_srtp extension" \ |
| 12004 | -c "found use_srtp extension" \ |
| 12005 | -c "found srtp profile" \ |
| 12006 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 12007 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 12008 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 12009 | -c "dumping 'sending mki' (8 bytes)" \ |
| 12010 | -c "dumping 'received mki' (8 bytes)" \ |
| 12011 | -C "error" |
| 12012 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 12013 | # Tests for specific things with "unreliable" UDP connection |
| 12014 | |
| 12015 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 12017 | run_test "DTLS proxy: reference" \ |
| 12018 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 12019 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 12020 | "$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] | 12021 | 0 \ |
| 12022 | -C "replayed record" \ |
| 12023 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 12024 | -C "Buffer record from epoch" \ |
| 12025 | -S "Buffer record from epoch" \ |
| 12026 | -C "ssl_buffer_message" \ |
| 12027 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 12028 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 12029 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 12030 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 12031 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 12032 | -c "HTTP/1.0 200 OK" |
| 12033 | |
| 12034 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12035 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 12036 | run_test "DTLS proxy: duplicate every packet" \ |
| 12037 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 12038 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 12039 | "$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] | 12040 | 0 \ |
| 12041 | -c "replayed record" \ |
| 12042 | -s "replayed record" \ |
| 12043 | -c "record from another epoch" \ |
| 12044 | -s "record from another epoch" \ |
| 12045 | -S "resend" \ |
| 12046 | -s "Extra-header:" \ |
| 12047 | -c "HTTP/1.0 200 OK" |
| 12048 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12049 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 12050 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 12051 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12052 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 12053 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 12054 | 0 \ |
| 12055 | -c "replayed record" \ |
| 12056 | -S "replayed record" \ |
| 12057 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12058 | -s "record from another epoch" \ |
| 12059 | -c "resend" \ |
| 12060 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 12061 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12062 | -c "HTTP/1.0 200 OK" |
| 12063 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12064 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 12065 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 12066 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12067 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 12068 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 12069 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12070 | -c "next record in same datagram" \ |
| 12071 | -s "next record in same datagram" |
| 12072 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12073 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12074 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 12075 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12076 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 12077 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 12078 | 0 \ |
| 12079 | -c "next record in same datagram" \ |
| 12080 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12081 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12082 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 12083 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 12084 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12085 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 12086 | "$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] | 12087 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12088 | -c "discarding invalid record (mac)" \ |
| 12089 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12090 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12091 | -c "HTTP/1.0 200 OK" \ |
| 12092 | -S "too many records with bad MAC" \ |
| 12093 | -S "Verification of the message MAC failed" |
| 12094 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12095 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12096 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 12097 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12098 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 12099 | "$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] | 12100 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12101 | -C "discarding invalid record (mac)" \ |
| 12102 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12103 | -S "Extra-header:" \ |
| 12104 | -C "HTTP/1.0 200 OK" \ |
| 12105 | -s "too many records with bad MAC" \ |
| 12106 | -s "Verification of the message MAC failed" |
| 12107 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12108 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12109 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 12110 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12111 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 12112 | "$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] | 12113 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12114 | -c "discarding invalid record (mac)" \ |
| 12115 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12116 | -s "Extra-header:" \ |
| 12117 | -c "HTTP/1.0 200 OK" \ |
| 12118 | -S "too many records with bad MAC" \ |
| 12119 | -S "Verification of the message MAC failed" |
| 12120 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12121 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12122 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 12123 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12124 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 12125 | "$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] | 12126 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12127 | -c "discarding invalid record (mac)" \ |
| 12128 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12129 | -s "Extra-header:" \ |
| 12130 | -c "HTTP/1.0 200 OK" \ |
| 12131 | -s "too many records with bad MAC" \ |
| 12132 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12133 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12134 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12135 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 12136 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 12137 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 12138 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12139 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 12140 | -c "record from another epoch" \ |
| 12141 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12142 | -s "Extra-header:" \ |
| 12143 | -c "HTTP/1.0 200 OK" |
| 12144 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 12145 | # Tests for reordering support with DTLS |
| 12146 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12147 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12148 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12149 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 12150 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12151 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12152 | hs_timeout=2500-60000" \ |
| 12153 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12154 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 12155 | 0 \ |
| 12156 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12157 | -c "Next handshake message has been buffered - load"\ |
| 12158 | -S "Buffering HS message" \ |
| 12159 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12160 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12161 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12162 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12163 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 12164 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12165 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12166 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12167 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 12168 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12169 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12170 | hs_timeout=2500-60000" \ |
| 12171 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12172 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12173 | 0 \ |
| 12174 | -c "Buffering HS message" \ |
| 12175 | -c "found fragmented DTLS handshake message"\ |
| 12176 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 12177 | -c "Next handshake message has been buffered - load"\ |
| 12178 | -S "Buffering HS message" \ |
| 12179 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12180 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12181 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12182 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 12183 | -S "Remember CCS message" |
| 12184 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12185 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 12186 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 12187 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 12188 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12189 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12190 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12191 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12192 | 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] | 12193 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12194 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12195 | hs_timeout=2500-60000" \ |
| 12196 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12197 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12198 | 0 \ |
| 12199 | -c "Buffering HS message" \ |
| 12200 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12201 | -C "attempt to make space by freeing buffered messages" \ |
| 12202 | -S "Buffering HS message" \ |
| 12203 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12204 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12205 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12206 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12207 | -S "Remember CCS message" |
| 12208 | |
| 12209 | # The size constraints ensure that the delayed certificate message can't |
| 12210 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 12211 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12212 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12213 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 12214 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12215 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12216 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 12217 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12218 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12219 | hs_timeout=2500-60000" \ |
| 12220 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12221 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12222 | 0 \ |
| 12223 | -c "Buffering HS message" \ |
| 12224 | -c "attempt to make space by freeing buffered future messages" \ |
| 12225 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12226 | -S "Buffering HS message" \ |
| 12227 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12228 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12229 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12230 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12231 | -S "Remember CCS message" |
| 12232 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12233 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12234 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12235 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 12236 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12237 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 12238 | hs_timeout=2500-60000" \ |
| 12239 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12240 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12241 | 0 \ |
| 12242 | -C "Buffering HS message" \ |
| 12243 | -C "Next handshake message has been buffered - load"\ |
| 12244 | -s "Buffering HS message" \ |
| 12245 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12246 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12247 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12248 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12249 | -S "Remember CCS message" |
| 12250 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12251 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12252 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12253 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12254 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 12255 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12256 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12257 | hs_timeout=2500-60000" \ |
| 12258 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12259 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12260 | 0 \ |
| 12261 | -C "Buffering HS message" \ |
| 12262 | -C "Next handshake message has been buffered - load"\ |
| 12263 | -S "Buffering HS message" \ |
| 12264 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12265 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12266 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12267 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12268 | -S "Remember CCS message" |
| 12269 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12270 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12271 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12272 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 12273 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12274 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12275 | hs_timeout=2500-60000" \ |
| 12276 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12277 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12278 | 0 \ |
| 12279 | -C "Buffering HS message" \ |
| 12280 | -C "Next handshake message has been buffered - load"\ |
| 12281 | -S "Buffering HS message" \ |
| 12282 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12283 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12284 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12285 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12286 | -s "Remember CCS message" |
| 12287 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12288 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12289 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12290 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12291 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12292 | hs_timeout=2500-60000" \ |
| 12293 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12294 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 12295 | 0 \ |
| 12296 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12297 | -s "Found buffered record from current epoch - load" \ |
| 12298 | -c "Buffer record from epoch 1" \ |
| 12299 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12300 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12301 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 12302 | # from the server are delayed, so that the encrypted Finished message |
| 12303 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 12304 | # in afterwards, the encrypted Finished message must be freed in order |
| 12305 | # to make space for the NewSessionTicket to be reassembled. |
| 12306 | # This works only in very particular circumstances: |
| 12307 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 12308 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 12309 | # the encrypted Finished message. |
| 12310 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 12311 | # needs to be fragmented. |
| 12312 | # - All messages sent by the server must be small enough to be either sent |
| 12313 | # without fragmentation or be reassembled within the bounds of |
| 12314 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 12315 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 12316 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 12317 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12318 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 12319 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12320 | "$P_SRV mtu=140 response_size=90 dgram_packing=0 psk=73776f726466697368 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 12321 | "$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] | 12322 | 0 \ |
| 12323 | -s "Buffer record from epoch 1" \ |
| 12324 | -s "Found buffered record from current epoch - load" \ |
| 12325 | -c "Buffer record from epoch 1" \ |
| 12326 | -C "Found buffered record from current epoch - load" \ |
| 12327 | -c "Enough space available after freeing future epoch record" |
| 12328 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 12329 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 12330 | |
| 12331 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12332 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 12333 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Gilles Peskine | 78df617 | 2024-09-07 19:50:46 +0200 | [diff] [blame] | 12334 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12335 | psk=73776f726466697368" \ |
| 12336 | "$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] | 12337 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12338 | 0 \ |
| 12339 | -s "Extra-header:" \ |
| 12340 | -c "HTTP/1.0 200 OK" |
| 12341 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12342 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12343 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 12344 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12345 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 12346 | "$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] | 12347 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 12348 | 0 \ |
| 12349 | -s "Extra-header:" \ |
| 12350 | -c "HTTP/1.0 200 OK" |
| 12351 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12352 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12353 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12354 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 12355 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12356 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 12357 | "$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] | 12358 | 0 \ |
| 12359 | -s "Extra-header:" \ |
| 12360 | -c "HTTP/1.0 200 OK" |
| 12361 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12362 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12363 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12364 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 12365 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12366 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 12367 | "$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] | 12368 | 0 \ |
| 12369 | -s "Extra-header:" \ |
| 12370 | -c "HTTP/1.0 200 OK" |
| 12371 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12372 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12373 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12374 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12375 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 12376 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12377 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 12378 | "$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] | 12379 | 0 \ |
| 12380 | -s "Extra-header:" \ |
| 12381 | -c "HTTP/1.0 200 OK" |
| 12382 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12383 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12384 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12385 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12386 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 12387 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12388 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 12389 | "$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] | 12390 | 0 \ |
| 12391 | -s "Extra-header:" \ |
| 12392 | -c "HTTP/1.0 200 OK" |
| 12393 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12394 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12395 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12396 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12397 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 12398 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12399 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 nbio=2 tickets=1 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 12400 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12401 | "$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] | 12402 | 0 \ |
| 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 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 12407 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 12408 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 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 | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12411 | psk=73776f726466697368 debug_level=3" \ |
| 12412 | "$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] | 12413 | 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] | 12414 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12415 | 0 \ |
| 12416 | -s "a session has been resumed" \ |
| 12417 | -c "a session has been resumed" \ |
| 12418 | -s "Extra-header:" \ |
| 12419 | -c "HTTP/1.0 200 OK" |
| 12420 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12421 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 12422 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 12423 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 12424 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12425 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12426 | psk=73776f726466697368 debug_level=3 nbio=2" \ |
| 12427 | "$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] | 12428 | 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] | 12429 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 12430 | 0 \ |
| 12431 | -s "a session has been resumed" \ |
| 12432 | -c "a session has been resumed" \ |
| 12433 | -s "Extra-header:" \ |
| 12434 | -c "HTTP/1.0 200 OK" |
| 12435 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12436 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12437 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12438 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 12439 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12440 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12441 | psk=73776f726466697368 renegotiation=1 debug_level=2" \ |
| 12442 | "$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] | 12443 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 12444 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12445 | 0 \ |
| 12446 | -c "=> renegotiate" \ |
| 12447 | -s "=> renegotiate" \ |
| 12448 | -s "Extra-header:" \ |
| 12449 | -c "HTTP/1.0 200 OK" |
| 12450 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12451 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12452 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12453 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 12454 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12455 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12456 | psk=73776f726466697368 renegotiation=1 debug_level=2" \ |
| 12457 | "$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] | 12458 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12459 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12460 | 0 \ |
| 12461 | -c "=> renegotiate" \ |
| 12462 | -s "=> renegotiate" \ |
| 12463 | -s "Extra-header:" \ |
| 12464 | -c "HTTP/1.0 200 OK" |
| 12465 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12466 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12467 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12468 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 12469 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12470 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12471 | psk=73776f726466697368 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12472 | debug_level=2" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12473 | "$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] | 12474 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12475 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12476 | 0 \ |
| 12477 | -c "=> renegotiate" \ |
| 12478 | -s "=> renegotiate" \ |
| 12479 | -s "Extra-header:" \ |
| 12480 | -c "HTTP/1.0 200 OK" |
| 12481 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12482 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12483 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12484 | 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] | 12485 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12486 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12487 | psk=73776f726466697368 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12488 | debug_level=2 nbio=2" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12489 | "$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] | 12490 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12491 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12492 | 0 \ |
| 12493 | -c "=> renegotiate" \ |
| 12494 | -s "=> renegotiate" \ |
| 12495 | -s "Extra-header:" \ |
| 12496 | -c "HTTP/1.0 200 OK" |
| 12497 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12498 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 12499 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 12500 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error |
| 12501 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12502 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12503 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12504 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12505 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 12506 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 12507 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ |
| 12508 | "$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] | 12509 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 12510 | -c "HTTP/1.0 200 OK" |
| 12511 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12512 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12513 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12514 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12516 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 12517 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12518 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12519 | "$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] | 12520 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12521 | -c "HTTP/1.0 200 OK" |
| 12522 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12523 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12524 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12525 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12527 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 12528 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12529 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12530 | "$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] | 12531 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12532 | -c "HTTP/1.0 200 OK" |
| 12533 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 12534 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12535 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12536 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12537 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12538 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 12539 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 12540 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12541 | "$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] | 12542 | 0 \ |
| 12543 | -s "Extra-header:" \ |
| 12544 | -c "Extra-header:" |
| 12545 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12546 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12547 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12548 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12549 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12550 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 12551 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12552 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12553 | "$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] | 12554 | 0 \ |
| 12555 | -s "Extra-header:" \ |
| 12556 | -c "Extra-header:" |
| 12557 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12558 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12559 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12560 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12561 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12562 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 12563 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12564 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12565 | "$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] | 12566 | 0 \ |
| 12567 | -s "Extra-header:" \ |
| 12568 | -c "Extra-header:" |
| 12569 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12570 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12571 | run_test "export keys functionality" \ |
| 12572 | "$P_SRV eap_tls=1 debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 12573 | "$P_CLI force_version=tls12 eap_tls=1 debug_level=3" \ |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12574 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 12575 | -c "EAP-TLS key material is:"\ |
| 12576 | -s "EAP-TLS key material is:"\ |
| 12577 | -c "EAP-TLS IV is:" \ |
| 12578 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12579 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 12580 | # openssl feature tests: check if tls1.3 exists. |
| 12581 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12582 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 12583 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 12584 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 12585 | 0 \ |
| 12586 | -c "TLS 1.3" \ |
| 12587 | -s "TLS 1.3" |
| 12588 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 12589 | # 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] | 12590 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 12591 | requires_gnutls_next_no_ticket |
| 12592 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12593 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 12594 | "$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] | 12595 | "$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] | 12596 | 0 \ |
| 12597 | -s "Version: TLS1.3" \ |
| 12598 | -c "Version: TLS1.3" |
| 12599 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 12600 | # TLS1.3 test cases |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12601 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12602 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12603 | requires_ciphersuite_enabled TLS1-3-CHACHA20-POLY1305-SHA256 |
Valerio Setti | cf29c5d | 2023-09-01 09:03:41 +0200 | [diff] [blame] | 12604 | requires_any_configs_enabled "PSA_WANT_ECC_MONTGOMERY_255" |
| 12605 | requires_any_configs_enabled "PSA_WANT_ECC_SECP_R1_256" |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12606 | run_test "TLS 1.3: Default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12607 | "$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] | 12608 | "$P_CLI allow_sha1=0" \ |
| 12609 | 0 \ |
| 12610 | -s "Protocol is TLSv1.3" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12611 | -s "Ciphersuite is TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12612 | -s "ECDH/FFDH group: " \ |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12613 | -s "selected signature algorithm ecdsa_secp256r1_sha256" |
| 12614 | |
Ronald Cron | 587cfe6 | 2024-02-08 08:56:09 +0100 | [diff] [blame] | 12615 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12616 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12617 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 12618 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 12619 | run_test "Establish TLS 1.2 then TLS 1.3 session" \ |
| 12620 | "$P_SRV" \ |
| 12621 | "( $P_CLI force_version=tls12; \ |
| 12622 | $P_CLI force_version=tls13 )" \ |
| 12623 | 0 \ |
| 12624 | -s "Protocol is TLSv1.2" \ |
| 12625 | -s "Protocol is TLSv1.3" \ |
| 12626 | |
Ronald Cron | 90abb22 | 2024-02-08 09:02:49 +0100 | [diff] [blame] | 12627 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12629 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 12630 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 12631 | run_test "Establish TLS 1.3 then TLS 1.2 session" \ |
| 12632 | "$P_SRV" \ |
| 12633 | "( $P_CLI force_version=tls13; \ |
| 12634 | $P_CLI force_version=tls12 )" \ |
| 12635 | 0 \ |
| 12636 | -s "Protocol is TLSv1.3" \ |
| 12637 | -s "Protocol is TLSv1.2" \ |
| 12638 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12639 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12640 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12641 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12642 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12643 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12644 | "$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] | 12645 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 12646 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12647 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12648 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12649 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12650 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12651 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12652 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12653 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12654 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12655 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12656 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12657 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12658 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12659 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12660 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12661 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 12662 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12663 | -c "=> parse certificate verify" \ |
| 12664 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12665 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12666 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 12667 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12668 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 12669 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 12670 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 12671 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12672 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12673 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12674 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12675 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12676 | "$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] | 12677 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 12678 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12679 | -s "SERVER HELLO was queued" \ |
| 12680 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12681 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12682 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12683 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12684 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12685 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12686 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12687 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12688 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12689 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12690 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12691 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12692 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12693 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12694 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 12695 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12696 | -c "=> parse certificate verify" \ |
| 12697 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12698 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12699 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 12700 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12701 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12702 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12703 | requires_openssl_tls1_3_with_compatible_ephemeral |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12704 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12705 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12706 | requires_config_enabled MBEDTLS_SSL_ALPN |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12707 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12708 | run_test "TLS 1.3: alpn - openssl" \ |
| 12709 | "$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] | 12710 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12711 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12712 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12713 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12714 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12715 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12716 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12717 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12718 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12719 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12720 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12721 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12722 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12723 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12724 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12725 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12726 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12727 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12728 | -c "=> parse certificate verify" \ |
| 12729 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12730 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 12731 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12732 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12733 | -c "HTTP/1.0 200 ok" \ |
| 12734 | -c "Application Layer Protocol is h2" |
| 12735 | |
| 12736 | requires_gnutls_tls1_3 |
| 12737 | requires_gnutls_next_no_ticket |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12738 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12739 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12740 | requires_config_enabled MBEDTLS_SSL_ALPN |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12741 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12742 | run_test "TLS 1.3: alpn - gnutls" \ |
| 12743 | "$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] | 12744 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12745 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12746 | -s "SERVER HELLO was queued" \ |
| 12747 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12748 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12749 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12750 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12751 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12752 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12753 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12754 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12755 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12756 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12757 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12758 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12759 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12760 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12761 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12762 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12763 | -c "=> parse certificate verify" \ |
| 12764 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12765 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 12766 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12767 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12768 | -c "HTTP/1.0 200 OK" \ |
| 12769 | -c "Application Layer Protocol is h2" |
| 12770 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12771 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12772 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 12773 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12774 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12775 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12776 | run_test "TLS 1.3: server alpn - openssl" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12777 | "$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] | 12778 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ |
| 12779 | 0 \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12780 | -s "found alpn extension" \ |
| 12781 | -s "server side, adding alpn extension" \ |
| 12782 | -s "Protocol is TLSv1.3" \ |
| 12783 | -s "HTTP/1.0 200 OK" \ |
| 12784 | -s "Application Layer Protocol is h2" |
| 12785 | |
| 12786 | requires_gnutls_tls1_3 |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12787 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 12788 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12789 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12790 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12791 | run_test "TLS 1.3: server alpn - gnutls" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12792 | "$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] | 12793 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ |
| 12794 | 0 \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12795 | -s "found alpn extension" \ |
| 12796 | -s "server side, adding alpn extension" \ |
| 12797 | -s "Protocol is TLSv1.3" \ |
| 12798 | -s "HTTP/1.0 200 OK" \ |
| 12799 | -s "Application Layer Protocol is h2" |
| 12800 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12801 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12802 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12803 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12804 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12805 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12806 | "$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] | 12807 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12808 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12809 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12810 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12811 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12812 | -c "HTTP/1.0 200 ok" \ |
| 12813 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12814 | |
| 12815 | requires_gnutls_tls1_3 |
| 12816 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12817 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12818 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12819 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12820 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12821 | "$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] | 12822 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12823 | 0 \ |
| 12824 | -c "got a certificate request" \ |
| 12825 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 12826 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12827 | -c "HTTP/1.0 200 OK" \ |
| 12828 | -c "Protocol is TLSv1.3" |
| 12829 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12830 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12831 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12832 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12833 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12834 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12835 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12836 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12837 | "$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] | 12838 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12839 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12840 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12841 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12842 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12843 | |
| 12844 | requires_gnutls_tls1_3 |
| 12845 | requires_gnutls_next_no_ticket |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12846 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12847 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12848 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12849 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12850 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12851 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/cli2.crt \ |
| 12852 | key_file=$DATA_FILES_PATH/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 12853 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12854 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12855 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12856 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12857 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12858 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12859 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12860 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12861 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12862 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12863 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12864 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12865 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12866 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12867 | 0 \ |
| 12868 | -c "got a certificate request" \ |
| 12869 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12870 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12871 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12872 | |
| 12873 | requires_gnutls_tls1_3 |
| 12874 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12875 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12876 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12877 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12878 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12879 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12880 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12881 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12882 | 0 \ |
| 12883 | -c "got a certificate request" \ |
| 12884 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12885 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12886 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12887 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12888 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12889 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12890 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12891 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12892 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12893 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12894 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12895 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12896 | 0 \ |
| 12897 | -c "got a certificate request" \ |
| 12898 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12899 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12900 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12901 | |
| 12902 | requires_gnutls_tls1_3 |
| 12903 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12904 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12905 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12906 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12907 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12908 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12909 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12910 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12911 | 0 \ |
| 12912 | -c "got a certificate request" \ |
| 12913 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12914 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12915 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12916 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12917 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12918 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12919 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12920 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12921 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12922 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12923 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12924 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12925 | 0 \ |
| 12926 | -c "got a certificate request" \ |
| 12927 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12928 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12929 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12930 | |
| 12931 | requires_gnutls_tls1_3 |
| 12932 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12933 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12934 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12935 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12936 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12937 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12938 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12939 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12940 | 0 \ |
| 12941 | -c "got a certificate request" \ |
| 12942 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12943 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12944 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12945 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12946 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12947 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12948 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12949 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12950 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12951 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12952 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12953 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12954 | 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] | 12955 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12956 | -c "got a certificate request" \ |
| 12957 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12958 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12959 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12960 | |
| 12961 | requires_gnutls_tls1_3 |
| 12962 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12963 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12964 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12965 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12966 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12967 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12968 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12969 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12970 | 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] | 12971 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12972 | -c "got a certificate request" \ |
| 12973 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12974 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12975 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12976 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12977 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12978 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12979 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12980 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12981 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12982 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 12983 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12984 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12985 | 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] | 12986 | 0 \ |
| 12987 | -c "got a certificate request" \ |
| 12988 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12989 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12990 | -c "Protocol is TLSv1.3" |
| 12991 | |
| 12992 | requires_gnutls_tls1_3 |
| 12993 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12994 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12995 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12996 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12997 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12998 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 12999 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13000 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13001 | 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] | 13002 | 0 \ |
| 13003 | -c "got a certificate request" \ |
| 13004 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13005 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13006 | -c "Protocol is TLSv1.3" |
| 13007 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13008 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 13009 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13010 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13011 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13012 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 13013 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 13014 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13015 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13016 | 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] | 13017 | 0 \ |
| 13018 | -c "got a certificate request" \ |
| 13019 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13020 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13021 | -c "Protocol is TLSv1.3" |
| 13022 | |
| 13023 | requires_gnutls_tls1_3 |
| 13024 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 13025 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13026 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13027 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13028 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 13029 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 13030 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13031 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13032 | 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] | 13033 | 0 \ |
| 13034 | -c "got a certificate request" \ |
| 13035 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13036 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13037 | -c "Protocol is TLSv1.3" |
| 13038 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13039 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 13040 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13041 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13042 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13043 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 13044 | 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] | 13045 | "$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] | 13046 | -sigalgs ecdsa_secp256r1_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13047 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13048 | 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] | 13049 | 1 \ |
| 13050 | -c "got a certificate request" \ |
| 13051 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13052 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13053 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 13054 | |
| 13055 | requires_gnutls_tls1_3 |
| 13056 | requires_gnutls_next_no_ticket |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 13057 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13058 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13059 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13060 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 13061 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 13062 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13063 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13064 | 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] | 13065 | 1 \ |
| 13066 | -c "got a certificate request" \ |
| 13067 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13068 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13069 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 13070 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13071 | # Test using an opaque private key for client authentication |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13072 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13073 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13074 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13075 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13076 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13077 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 13078 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13079 | "$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] | 13080 | 0 \ |
| 13081 | -c "got a certificate request" \ |
| 13082 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13083 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13084 | -c "Protocol is TLSv1.3" |
| 13085 | |
| 13086 | requires_gnutls_tls1_3 |
| 13087 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13088 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13089 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13090 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13091 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13092 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 13093 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13094 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/cli2.crt \ |
| 13095 | key_file=$DATA_FILES_PATH/cli2.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13096 | 0 \ |
| 13097 | -c "got a certificate request" \ |
| 13098 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13099 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13100 | -c "Protocol is TLSv1.3" |
| 13101 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13102 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13103 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13104 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13105 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13106 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13107 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 13108 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13109 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 13110 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13111 | 0 \ |
| 13112 | -c "got a certificate request" \ |
| 13113 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13114 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13115 | -c "Protocol is TLSv1.3" |
| 13116 | |
| 13117 | requires_gnutls_tls1_3 |
| 13118 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13119 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13120 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13121 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13122 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13123 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 13124 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13125 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 13126 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13127 | 0 \ |
| 13128 | -c "got a certificate request" \ |
| 13129 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13130 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13131 | -c "Protocol is TLSv1.3" |
| 13132 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13133 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13134 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13135 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13136 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13137 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13138 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 13139 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13140 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 13141 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13142 | 0 \ |
| 13143 | -c "got a certificate request" \ |
| 13144 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13145 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13146 | -c "Protocol is TLSv1.3" |
| 13147 | |
| 13148 | requires_gnutls_tls1_3 |
| 13149 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13150 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13151 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13152 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13153 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13154 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 13155 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13156 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 13157 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13158 | 0 \ |
| 13159 | -c "got a certificate request" \ |
| 13160 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13161 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13162 | -c "Protocol is TLSv1.3" |
| 13163 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13164 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13165 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13166 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13167 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13168 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13169 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 13170 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13171 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13172 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13173 | 0 \ |
| 13174 | -c "got a certificate request" \ |
| 13175 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13176 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13177 | -c "Protocol is TLSv1.3" |
| 13178 | |
| 13179 | requires_gnutls_tls1_3 |
| 13180 | requires_gnutls_next_no_ticket |
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 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13183 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13184 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13185 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 13186 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13187 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13188 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13189 | 0 \ |
| 13190 | -c "got a certificate request" \ |
| 13191 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13192 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13193 | -c "Protocol is TLSv1.3" |
| 13194 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13195 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13196 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13197 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13198 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13199 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13200 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13201 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 13202 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13203 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13204 | 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] | 13205 | 0 \ |
| 13206 | -c "got a certificate request" \ |
| 13207 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13208 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13209 | -c "Protocol is TLSv1.3" |
| 13210 | |
| 13211 | requires_gnutls_tls1_3 |
| 13212 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13213 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13214 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13215 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13216 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13217 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13218 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 13219 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13220 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13221 | 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] | 13222 | 0 \ |
| 13223 | -c "got a certificate request" \ |
| 13224 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13225 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13226 | -c "Protocol is TLSv1.3" |
| 13227 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13228 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13229 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13230 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13231 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13232 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13233 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13234 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 13235 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13236 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13237 | 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] | 13238 | 0 \ |
| 13239 | -c "got a certificate request" \ |
| 13240 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13241 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13242 | -c "Protocol is TLSv1.3" |
| 13243 | |
| 13244 | requires_gnutls_tls1_3 |
| 13245 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13246 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13247 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13248 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13249 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13250 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13251 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 13252 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13253 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13254 | 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] | 13255 | 0 \ |
| 13256 | -c "got a certificate request" \ |
| 13257 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13258 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13259 | -c "Protocol is TLSv1.3" |
| 13260 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13261 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13262 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13263 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13264 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13265 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13266 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13267 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 13268 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13269 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13270 | 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] | 13271 | 0 \ |
| 13272 | -c "got a certificate request" \ |
| 13273 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13274 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13275 | -c "Protocol is TLSv1.3" |
| 13276 | |
| 13277 | requires_gnutls_tls1_3 |
| 13278 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13279 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13280 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13281 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13282 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13283 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13284 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \ |
| 13285 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13286 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13287 | 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] | 13288 | 0 \ |
| 13289 | -c "got a certificate request" \ |
| 13290 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13291 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13292 | -c "Protocol is TLSv1.3" |
| 13293 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13294 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13295 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13296 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13297 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13298 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13299 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13300 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 13301 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 13302 | -sigalgs ecdsa_secp256r1_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13303 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13304 | 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] | 13305 | 1 \ |
| 13306 | -c "got a certificate request" \ |
| 13307 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13308 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13309 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13310 | |
| 13311 | requires_gnutls_tls1_3 |
| 13312 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13313 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13314 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13315 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13316 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13317 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13318 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 13319 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13320 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13321 | 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] | 13322 | 1 \ |
| 13323 | -c "got a certificate request" \ |
| 13324 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13325 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13326 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13327 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13328 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13329 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13330 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13331 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13332 | 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] | 13333 | "$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] | 13334 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13335 | 0 \ |
| 13336 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13337 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13338 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13339 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13340 | -c "HTTP/1.0 200 ok" |
| 13341 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13342 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13343 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13344 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13345 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13346 | 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] | 13347 | "$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] | 13348 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 13349 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13350 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13351 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13352 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13353 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 13354 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13355 | |
| 13356 | requires_gnutls_tls1_3 |
| 13357 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13358 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13359 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13360 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13361 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13362 | 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] | 13363 | "$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] | 13364 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13365 | 0 \ |
| 13366 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13367 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13368 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13369 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13370 | -c "HTTP/1.0 200 OK" |
| 13371 | |
| 13372 | requires_gnutls_tls1_3 |
| 13373 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13374 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13375 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13376 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13377 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13378 | 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] | 13379 | "$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] | 13380 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 13381 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13382 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13383 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13384 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13385 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 13386 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13387 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13388 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13389 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 13390 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13391 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 13392 | run_test "TLS 1.3: Server side check - openssl" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13393 | "$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] | 13394 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 13395 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 13396 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13397 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13398 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13399 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 13400 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13401 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13402 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 13403 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13404 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13405 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13406 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13407 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13408 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13409 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13410 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13411 | "$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] | 13412 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13413 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13414 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13415 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13416 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13417 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 13418 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13419 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13420 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13421 | -s "=> parse client hello" \ |
| 13422 | -s "<= parse client hello" |
| 13423 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13424 | requires_gnutls_tls1_3 |
| 13425 | requires_gnutls_next_no_ticket |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13426 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 13427 | requires_config_enabled MBEDTLS_SSL_SRV_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 |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 13429 | run_test "TLS 1.3: Server side check - gnutls" \ |
David Horstmann | 184c4f0 | 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" \ |
XiaokangQian | 3f84d5d | 2022-04-19 06:36:17 +0000 | [diff] [blame] | 13431 | "$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] | 13432 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +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 | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13436 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 13437 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13438 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13439 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 13440 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 13441 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13442 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13443 | requires_gnutls_tls1_3 |
| 13444 | requires_gnutls_next_no_ticket |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13445 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13446 | requires_config_enabled MBEDTLS_SSL_SRV_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 - gnutls with client authentication" \ |
David Horstmann | 184c4f0 | 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 | "$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] | 13451 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +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_CERTIFICATE_REQUEST" \ |
| 13456 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 13457 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13458 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13459 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13460 | -s "=> parse client hello" \ |
| 13461 | -s "<= parse client hello" |
| 13462 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13463 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13464 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 13465 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13466 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13467 | run_test "TLS 1.3: Server side check - mbedtls" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13468 | "$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] | 13469 | "$P_CLI debug_level=4" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 13470 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13471 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13472 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13473 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13474 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13475 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13476 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13477 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 13478 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 13479 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 13480 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13481 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13482 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13483 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13484 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13485 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13486 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13487 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13488 | "$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] | 13489 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13490 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13491 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13492 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13493 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13494 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13495 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13496 | -s "=> parse client hello" \ |
| 13497 | -s "<= parse client hello" |
| 13498 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13499 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13500 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13501 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13502 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13503 | run_test "TLS 1.3: Server side check - mbedtls with client empty certificate" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13504 | "$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] | 13505 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13506 | 1 \ |
| 13507 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13508 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13509 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13510 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13511 | -s "=> write certificate request" \ |
| 13512 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 13513 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13514 | -s "=> parse client hello" \ |
| 13515 | -s "<= parse client hello" |
| 13516 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13517 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13518 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13519 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13520 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13521 | run_test "TLS 1.3: Server side check - mbedtls with optional client authentication" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13522 | "$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] | 13523 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13524 | 0 \ |
| 13525 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13526 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13527 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13528 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13529 | -s "=> write certificate request" \ |
| 13530 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13531 | -s "=> parse client hello" \ |
| 13532 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13533 | |
| 13534 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13535 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13536 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13537 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13538 | requires_config_enabled PSA_WANT_ALG_ECDH |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13539 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13540 | "$P_SRV debug_level=4 groups=secp384r1" \ |
| 13541 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 13542 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13543 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13544 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13545 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13546 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 13547 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13548 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13549 | -s "=> write hello retry request" \ |
| 13550 | -s "<= write hello retry request" |
| 13551 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13552 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13553 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13554 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13555 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13556 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13557 | "$P_SRV debug_level=4 crt_file=none key_file=none" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 13558 | "$P_CLI debug_level=4" \ |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13559 | 1 \ |
| 13560 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13561 | -s "No certificate available." |
| 13562 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13563 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13564 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13565 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13566 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13567 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13568 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13569 | 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,-,-,-" \ |
| 13570 | "$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] | 13571 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13572 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13573 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13574 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 13575 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13576 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13577 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13578 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13579 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13580 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13581 | 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,-,-,-" \ |
| 13582 | "$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] | 13583 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13584 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13585 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13586 | |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [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 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13590 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13591 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13592 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13593 | 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,-,-,-" \ |
| 13594 | "$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] | 13595 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13596 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13597 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 13598 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 13599 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 13600 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 13601 | TEST_SUITE_NAME=${i##*/} |
| 13602 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 13603 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 13604 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 13605 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 13606 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13607 | # Test 1.3 compatibility mode |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13608 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13609 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13610 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13611 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13612 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13613 | 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] | 13614 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13615 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13616 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13617 | -s "Protocol is TLSv1.3" \ |
| 13618 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13619 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13620 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13621 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13622 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13623 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13624 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13625 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13626 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13627 | run_test "TLS 1.3 m->m both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13628 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13629 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13630 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13631 | -s "Protocol is TLSv1.3" \ |
| 13632 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13633 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13634 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13635 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13636 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13637 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13638 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13639 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13640 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13641 | 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] | 13642 | "$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] | 13643 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13644 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13645 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13646 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13647 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13648 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13649 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13650 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13651 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13652 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13653 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13654 | 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] | 13655 | "$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] | 13656 | "$P_CLI debug_level=4" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13657 | 0 \ |
| 13658 | -c "Protocol is TLSv1.3" \ |
| 13659 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13660 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13661 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13662 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13663 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13664 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13665 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13666 | run_test "TLS 1.3 m->O both with middlebox compat support" \ |
| 13667 | "$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] | 13668 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13669 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13670 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13671 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13672 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13673 | requires_gnutls_tls1_3 |
| 13674 | requires_gnutls_next_no_ticket |
| 13675 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13676 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13677 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13678 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13679 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13680 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 13681 | "$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] | 13682 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13683 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13684 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13685 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13686 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13687 | |
| 13688 | requires_gnutls_tls1_3 |
| 13689 | requires_gnutls_next_no_ticket |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13690 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13691 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13692 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13693 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13694 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 13695 | "$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] | 13696 | "$P_CLI debug_level=4" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13697 | 0 \ |
| 13698 | -c "Protocol is TLSv1.3" \ |
| 13699 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13700 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13701 | requires_gnutls_tls1_3 |
| 13702 | requires_gnutls_next_no_ticket |
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_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13705 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13706 | requires_config_enabled 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 m->G both with middlebox compat support" \ |
| 13708 | "$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] | 13709 | "$P_CLI debug_level=4" \ |
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 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13712 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13713 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13714 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13715 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13716 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13717 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13718 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13719 | run_test "TLS 1.3 O->m both peers do not support middlebox compatibility" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13720 | "$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] | 13721 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13722 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13723 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13724 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13725 | -C "14 03 03 00 01" |
| 13726 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13727 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13728 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13729 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13730 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13731 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13732 | run_test "TLS 1.3 O->m server with middlebox compat support, not client" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13733 | "$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] | 13734 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13735 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13736 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13737 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" |
| 13738 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13739 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13740 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13741 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13742 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13743 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13744 | run_test "TLS 1.3 O->m both with middlebox compat support" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13745 | "$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] | 13746 | "$O_NEXT_CLI -msg -debug" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13747 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13748 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13749 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13750 | -c "14 03 03 00 01" |
| 13751 | |
| 13752 | requires_gnutls_tls1_3 |
| 13753 | requires_gnutls_next_no_ticket |
| 13754 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13755 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13756 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13757 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13758 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13759 | run_test "TLS 1.3 G->m both peers do not support middlebox compatibility" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13760 | "$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] | 13761 | "$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] | 13762 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13763 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13764 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13765 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 13766 | |
| 13767 | requires_gnutls_tls1_3 |
| 13768 | requires_gnutls_next_no_ticket |
| 13769 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13770 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13771 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13772 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13773 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13774 | run_test "TLS 1.3 G->m server with middlebox compat support, not client" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13775 | "$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] | 13776 | "$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] | 13777 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13778 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13779 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13780 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 13781 | -c "discarding change cipher spec in TLS1.3" |
| 13782 | |
| 13783 | requires_gnutls_tls1_3 |
| 13784 | requires_gnutls_next_no_ticket |
| 13785 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13786 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13787 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13788 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13789 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13790 | run_test "TLS 1.3 G->m both with middlebox compat support" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13791 | "$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] | 13792 | "$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] | 13793 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13794 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13795 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13796 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 13797 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13798 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13799 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13800 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13801 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13802 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13803 | 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] | 13804 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 13805 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13806 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13807 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13808 | -c "Protocol is TLSv1.3" \ |
| 13809 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13810 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13811 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13812 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13813 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13814 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13815 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13816 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13817 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13818 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13819 | 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] | 13820 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 13821 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13822 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13823 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13824 | -c "Protocol is TLSv1.3" \ |
| 13825 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13826 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13827 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13828 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13829 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13830 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13831 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13832 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13833 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13834 | run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ |
| 13835 | "$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] | 13836 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13837 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13838 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13839 | -c "received HelloRetryRequest message" \ |
| 13840 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13841 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13842 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13843 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13844 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13845 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13846 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13847 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13848 | run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ |
| 13849 | "$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] | 13850 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13851 | 0 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13852 | -c "received HelloRetryRequest message" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13853 | -c "Protocol is TLSv1.3" \ |
| 13854 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13855 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13856 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13857 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13858 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13859 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13860 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13861 | run_test "TLS 1.3 m->O HRR both with middlebox compat support" \ |
| 13862 | "$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] | 13863 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13864 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13865 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13866 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13867 | |
| 13868 | requires_gnutls_tls1_3 |
| 13869 | requires_gnutls_next_no_ticket |
| 13870 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13871 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13872 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13873 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13874 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13875 | run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ |
| 13876 | "$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] | 13877 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13878 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13879 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13880 | -c "received HelloRetryRequest message" \ |
| 13881 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13882 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13883 | |
| 13884 | requires_gnutls_tls1_3 |
| 13885 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13886 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13887 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13888 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13889 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13890 | run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \ |
| 13891 | "$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] | 13892 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13893 | 0 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13894 | -c "received HelloRetryRequest message" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13895 | -c "Protocol is TLSv1.3" \ |
| 13896 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13897 | |
| 13898 | requires_gnutls_tls1_3 |
| 13899 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13900 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13901 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13902 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13903 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13904 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13905 | run_test "TLS 1.3 m->G HRR both with middlebox compat support" \ |
| 13906 | "$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] | 13907 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13908 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13909 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13910 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13911 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13912 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13913 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13914 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13915 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13916 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13917 | run_test "TLS 1.3 O->m HRR both peers do not support middlebox compatibility" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13918 | "$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] | 13919 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13920 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13921 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13922 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13923 | -C "14 03 03 00 01" |
| 13924 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13925 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13926 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13927 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13928 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13929 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13930 | run_test "TLS 1.3 O->m HRR server with middlebox compat support, not client" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13931 | "$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] | 13932 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13933 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13934 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13935 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13936 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13937 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13938 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13939 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13940 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13941 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13942 | run_test "TLS 1.3 O->m HRR both with middlebox compat support" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13943 | "$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] | 13944 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13945 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13946 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13947 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13948 | -c "14 03 03 00 01" |
| 13949 | |
| 13950 | requires_gnutls_tls1_3 |
| 13951 | requires_gnutls_next_no_ticket |
| 13952 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13953 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13954 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13955 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13956 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13957 | run_test "TLS 1.3 G->m HRR both peers do not support middlebox compatibility" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13958 | "$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] | 13959 | "$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] | 13960 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13961 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13962 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13963 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 13964 | |
| 13965 | requires_gnutls_tls1_3 |
| 13966 | requires_gnutls_next_no_ticket |
| 13967 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13968 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13969 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13970 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13971 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13972 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13973 | run_test "TLS 1.3 G->m HRR server with middlebox compat support, not client" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13974 | "$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] | 13975 | "$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] | 13976 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13977 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13978 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13979 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 13980 | -c "discarding change cipher spec in TLS1.3" |
| 13981 | |
| 13982 | requires_gnutls_tls1_3 |
| 13983 | requires_gnutls_next_no_ticket |
| 13984 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13985 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13986 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13987 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13988 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13989 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13990 | run_test "TLS 1.3 G->m HRR both with middlebox compat support" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13991 | "$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] | 13992 | "$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] | 13993 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13994 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13995 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13996 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 13997 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13998 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13999 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14000 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14001 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14002 | run_test "TLS 1.3: Check signature algorithm order, m->O" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14003 | "$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] | 14004 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 14005 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14006 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 14007 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14008 | 0 \ |
| 14009 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14010 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14011 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14012 | |
| 14013 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14014 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14015 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14016 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14017 | run_test "TLS 1.3: Check signature algorithm order, m->G" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14018 | "$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] | 14019 | -d 4 |
| 14020 | --priority=NORMAL:-VERS-ALL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14021 | "$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] | 14022 | 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] | 14023 | 0 \ |
| 14024 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14025 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14026 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14027 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14028 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14029 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14030 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14031 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14032 | run_test "TLS 1.3: Check signature algorithm order, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14033 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14034 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14035 | 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] | 14036 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14037 | "$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] | 14038 | 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] | 14039 | 0 \ |
| 14040 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14041 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 14042 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14043 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 14044 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14045 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14046 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14047 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14048 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14049 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14050 | run_test "TLS 1.3: Check signature algorithm order, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14051 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14052 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14053 | 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] | 14054 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14055 | "$O_NEXT_CLI_NO_CERT -msg -CAfile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14056 | -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] | 14057 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 14058 | 0 \ |
| 14059 | -c "TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14060 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14061 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 14062 | |
| 14063 | requires_gnutls_tls1_3 |
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 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14066 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14067 | run_test "TLS 1.3: Check signature algorithm order, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14068 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14069 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14070 | 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] | 14071 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14072 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14073 | --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] | 14074 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" \ |
| 14075 | 0 \ |
| 14076 | -c "Negotiated version: 3.4" \ |
| 14077 | -c "HTTP/1.0 200 [Oo][Kk]" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14078 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14079 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 14080 | |
| 14081 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14082 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14083 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14084 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14085 | 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] | 14086 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14087 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14088 | 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] | 14089 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14090 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14091 | --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] | 14092 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512" \ |
| 14093 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 14094 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14095 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14096 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14097 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14098 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14099 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14100 | 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] | 14101 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14102 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14103 | 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] | 14104 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14105 | "$O_NEXT_CLI_NO_CERT -msg -CAfile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14106 | -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] | 14107 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \ |
| 14108 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 14109 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14110 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14111 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14112 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14113 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14114 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14115 | run_test "TLS 1.3: Check server no suitable signature algorithm, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14116 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14117 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14118 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14119 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14120 | "$P_CLI allow_sha1=0 debug_level=4 crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 14121 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14122 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 14123 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14124 | |
| 14125 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14126 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14127 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14128 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14129 | run_test "TLS 1.3: Check server no suitable certificate, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14130 | "$P_SRV debug_level=4 |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14131 | 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] | 14132 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14133 | "$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] | 14134 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \ |
| 14135 | 1 \ |
| 14136 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14137 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14138 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14139 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14140 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14141 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14142 | run_test "TLS 1.3: Check server no suitable certificate, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14143 | "$P_SRV debug_level=4 |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14144 | 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] | 14145 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14146 | "$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] | 14147 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \ |
| 14148 | 1 \ |
| 14149 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14150 | |
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_SRV_C |
| 14153 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14154 | requires_config_enabled 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 server no suitable certificate, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14156 | "$P_SRV debug_level=4 |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14157 | 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] | 14158 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 14159 | "$P_CLI allow_sha1=0 debug_level=4 \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 14160 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14161 | 1 \ |
| 14162 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14163 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14164 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14165 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14166 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14167 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14168 | run_test "TLS 1.3: Check client no signature algorithm, m->O" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14169 | "$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] | 14170 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 14171 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp521r1_sha512" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14172 | "$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] | 14173 | 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] | 14174 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14175 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14176 | |
| 14177 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14178 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14179 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14180 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14181 | run_test "TLS 1.3: Check client no signature algorithm, m->G" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14182 | "$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] | 14183 | -d 4 |
| 14184 | --priority=NORMAL:-VERS-ALL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14185 | "$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] | 14186 | 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] | 14187 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14188 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14189 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14190 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14191 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14192 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14193 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14194 | run_test "TLS 1.3: Check client no signature algorithm, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14195 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14196 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14197 | 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] | 14198 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp521r1_sha512" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14199 | "$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] | 14200 | 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] | 14201 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14202 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14203 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14204 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 14205 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 14206 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14207 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 14208 | run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->O" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14209 | "$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] | 14210 | -msg -tls1_2 |
| 14211 | -Verify 10 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14212 | "$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] | 14213 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 14214 | min_version=tls12 max_version=tls13 " \ |
| 14215 | 0 \ |
| 14216 | -c "Protocol is TLSv1.2" \ |
| 14217 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14218 | |
| 14219 | |
| 14220 | requires_gnutls_tls1_3 |
| 14221 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 14222 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14223 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 14224 | run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->G" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14225 | "$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] | 14226 | -d 4 |
| 14227 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14228 | "$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] | 14229 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 14230 | min_version=tls12 max_version=tls13 " \ |
| 14231 | 0 \ |
| 14232 | -c "Protocol is TLSv1.2" \ |
| 14233 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14234 | |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14235 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14236 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14237 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14238 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14239 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14240 | requires_config_enabled PSA_WANT_DH_RFC7919_3072 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14241 | requires_gnutls_tls1_3 |
| 14242 | requires_gnutls_next_no_ticket |
| 14243 | requires_gnutls_next_disable_tls13_compat |
| 14244 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe3072,rsa_pss_rsae_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14245 | "$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" \ |
| 14246 | "$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] | 14247 | 0 \ |
| 14248 | -s "Protocol is TLSv1.3" \ |
| 14249 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14250 | -s "received signature algorithm: 0x804" \ |
| 14251 | -s "got named group: ffdhe3072(0101)" \ |
| 14252 | -s "Certificate verification was skipped" \ |
| 14253 | -C "received HelloRetryRequest message" |
| 14254 | |
| 14255 | |
| 14256 | requires_gnutls_tls1_3 |
| 14257 | requires_gnutls_next_no_ticket |
| 14258 | requires_gnutls_next_disable_tls13_compat |
| 14259 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14260 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14261 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14262 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14263 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14264 | requires_config_enabled PSA_WANT_DH_RFC7919_3072 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14265 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe3072,rsa_pss_rsae_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14266 | "$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" \ |
| 14267 | "$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] | 14268 | 0 \ |
| 14269 | -c "HTTP/1.0 200 OK" \ |
| 14270 | -c "Protocol is TLSv1.3" \ |
| 14271 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14272 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14273 | -c "NamedGroup: ffdhe3072 ( 101 )" \ |
| 14274 | -c "Verifying peer X.509 certificate... ok" \ |
| 14275 | -C "received HelloRetryRequest message" |
| 14276 | |
| 14277 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14278 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14279 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14280 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14281 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14282 | requires_config_enabled PSA_WANT_DH_RFC7919_4096 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14283 | requires_gnutls_tls1_3 |
| 14284 | requires_gnutls_next_no_ticket |
| 14285 | requires_gnutls_next_disable_tls13_compat |
| 14286 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe4096,rsa_pss_rsae_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14287 | "$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" \ |
| 14288 | "$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] | 14289 | 0 \ |
| 14290 | -s "Protocol is TLSv1.3" \ |
| 14291 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14292 | -s "received signature algorithm: 0x804" \ |
| 14293 | -s "got named group: ffdhe4096(0102)" \ |
| 14294 | -s "Certificate verification was skipped" \ |
| 14295 | -C "received HelloRetryRequest message" |
| 14296 | |
| 14297 | |
| 14298 | requires_gnutls_tls1_3 |
| 14299 | requires_gnutls_next_no_ticket |
| 14300 | requires_gnutls_next_disable_tls13_compat |
| 14301 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14302 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14303 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14304 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14305 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14306 | requires_config_enabled PSA_WANT_DH_RFC7919_4096 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14307 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe4096,rsa_pss_rsae_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14308 | "$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" \ |
| 14309 | "$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] | 14310 | 0 \ |
| 14311 | -c "HTTP/1.0 200 OK" \ |
| 14312 | -c "Protocol is TLSv1.3" \ |
| 14313 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14314 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14315 | -c "NamedGroup: ffdhe4096 ( 102 )" \ |
| 14316 | -c "Verifying peer X.509 certificate... ok" \ |
| 14317 | -C "received HelloRetryRequest message" |
| 14318 | |
| 14319 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14320 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14321 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14322 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14323 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14324 | requires_config_enabled PSA_WANT_DH_RFC7919_6144 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14325 | requires_gnutls_tls1_3 |
| 14326 | requires_gnutls_next_no_ticket |
| 14327 | requires_gnutls_next_disable_tls13_compat |
| 14328 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe6144,rsa_pss_rsae_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14329 | "$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" \ |
| 14330 | "$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] | 14331 | 0 \ |
| 14332 | -s "Protocol is TLSv1.3" \ |
| 14333 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14334 | -s "received signature algorithm: 0x804" \ |
| 14335 | -s "got named group: ffdhe6144(0103)" \ |
| 14336 | -s "Certificate verification was skipped" \ |
| 14337 | -C "received HelloRetryRequest message" |
| 14338 | |
| 14339 | requires_gnutls_tls1_3 |
| 14340 | requires_gnutls_next_no_ticket |
| 14341 | requires_gnutls_next_disable_tls13_compat |
| 14342 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14343 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14344 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 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_6144 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14348 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe6144,rsa_pss_rsae_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14349 | "$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" \ |
| 14350 | "$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] | 14351 | 0 \ |
| 14352 | -c "HTTP/1.0 200 OK" \ |
| 14353 | -c "Protocol is TLSv1.3" \ |
| 14354 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14355 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14356 | -c "NamedGroup: ffdhe6144 ( 103 )" \ |
| 14357 | -c "Verifying peer X.509 certificate... ok" \ |
| 14358 | -C "received HelloRetryRequest message" |
| 14359 | |
| 14360 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14361 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14362 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14363 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14364 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14365 | requires_config_enabled PSA_WANT_DH_RFC7919_8192 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14366 | requires_gnutls_tls1_3 |
| 14367 | requires_gnutls_next_no_ticket |
| 14368 | requires_gnutls_next_disable_tls13_compat |
| 14369 | client_needs_more_time 4 |
| 14370 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe8192,rsa_pss_rsae_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14371 | "$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" \ |
| 14372 | "$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] | 14373 | 0 \ |
| 14374 | -s "Protocol is TLSv1.3" \ |
| 14375 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14376 | -s "received signature algorithm: 0x804" \ |
| 14377 | -s "got named group: ffdhe8192(0104)" \ |
| 14378 | -s "Certificate verification was skipped" \ |
| 14379 | -C "received HelloRetryRequest message" |
| 14380 | |
| 14381 | requires_gnutls_tls1_3 |
| 14382 | requires_gnutls_next_no_ticket |
| 14383 | requires_gnutls_next_disable_tls13_compat |
| 14384 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14385 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14386 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14387 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14388 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14389 | requires_config_enabled PSA_WANT_DH_RFC7919_8192 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14390 | client_needs_more_time 4 |
| 14391 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe8192,rsa_pss_rsae_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14392 | "$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" \ |
| 14393 | "$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] | 14394 | 0 \ |
| 14395 | -c "HTTP/1.0 200 OK" \ |
| 14396 | -c "Protocol is TLSv1.3" \ |
| 14397 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14398 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14399 | -c "NamedGroup: ffdhe8192 ( 104 )" \ |
| 14400 | -c "Verifying peer X.509 certificate... ok" \ |
| 14401 | -C "received HelloRetryRequest message" |
| 14402 | |
Ronald Cron | 8a74f07 | 2023-06-14 17:59:29 +0200 | [diff] [blame] | 14403 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 14404 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14405 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14406 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 14407 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14408 | run_test "TLS 1.3: no HRR in case of PSK key exchange mode" \ |
Gilles Peskine | f9f3d21 | 2024-05-13 21:06:26 +0200 | [diff] [blame] | 14409 | "$P_SRV nbio=2 psk=73776f726466697368 psk_identity=0a0b0c tls13_kex_modes=psk groups=none" \ |
| 14410 | "$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] | 14411 | 0 \ |
| 14412 | -C "received HelloRetryRequest message" \ |
| 14413 | -c "Selected key exchange mode: psk$" \ |
| 14414 | -c "HTTP/1.0 200 OK" |
| 14415 | |
Waleed Elmelegy | 0b190f1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14416 | # Legacy_compression_methods testing |
| 14417 | |
| 14418 | requires_gnutls |
Waleed Elmelegy | dc99c89 | 2024-07-15 17:25:04 +0000 | [diff] [blame] | 14419 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Waleed Elmelegy | 0b190f1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14420 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Waleed Elmelegy | dc99c89 | 2024-07-15 17:25:04 +0000 | [diff] [blame] | 14421 | run_test "TLS 1.2 ClientHello indicating support for deflate compression method" \ |
| 14422 | "$P_SRV debug_level=3" \ |
| 14423 | "$G_CLI --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+COMP-DEFLATE localhost" \ |
| 14424 | 0 \ |
| 14425 | -c "Handshake was completed" \ |
| 14426 | -s "dumping .client hello, compression. (2 bytes)" |
Waleed Elmelegy | 0b190f1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14427 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14428 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 14429 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14430 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 14431 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 14432 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 14433 | requires_max_content_len 16384 |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 14434 | run_tests_memory_after_handshake |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14435 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14436 | if [ "$LIST_TESTS" -eq 0 ]; then |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 14437 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14438 | # Final report |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 14439 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14440 | echo "------------------------------------------------------------------------" |
| 14441 | |
| 14442 | if [ $FAILS = 0 ]; then |
| 14443 | printf "PASSED" |
| 14444 | else |
| 14445 | printf "FAILED" |
| 14446 | fi |
| 14447 | PASSES=$(( $TESTS - $FAILS )) |
| 14448 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
| 14449 | |
Gilles Peskine | 39c5207 | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 14450 | if [ $((TESTS - SKIPS)) -lt $MIN_TESTS ]; then |
| 14451 | cat <<EOF |
| 14452 | Error: Expected to run at least $MIN_TESTS, but only ran $((TESTS - SKIPS)). |
| 14453 | Maybe a bad filter ('$FILTER') or a bad configuration? |
| 14454 | EOF |
| 14455 | if [ $FAILS -eq 0 ]; then |
| 14456 | FAILS=1 |
| 14457 | fi |
| 14458 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 14459 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 14460 | |
Tom Cosgrove | fc0e79e | 2023-01-13 12:13:41 +0000 | [diff] [blame] | 14461 | if [ $FAILS -gt 255 ]; then |
| 14462 | # Clamp at 255 as caller gets exit code & 0xFF |
| 14463 | # (so 256 would be 0, or success, etc) |
| 14464 | FAILS=255 |
| 14465 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 14466 | exit $FAILS |